.file "external.c" .version "01.01" gcc2_compiled.: .section .rodata .LC0: .string "Construct Locksmith!\n" .align 32 .LC1: .string "Error initializing locksmith.\n" .text .align 4 .globl construct_locksmith .type construct_locksmith,@function construct_locksmith: pushl %ebp movl %esp, %ebp subl $8, %esp subl $8, %esp pushl $1 pushl $5 call signal addl $16, %esp subl $12, %esp pushl $.LC0 call printf addl $16, %esp subl $8, %esp pushl $0 pushl $stats_lock call pthread_mutex_init addl $16, %esp movl %eax, %eax testl %eax, %eax je .L3 subl $8, %esp pushl $.LC1 pushl stderr call fprintf addl $16, %esp movl $0, is_active movl $-1, %eax jmp .L2 .p2align 2 .L3: subl $12, %esp pushl $stats_lock call pthread_mutex_lock addl $16, %esp subl $12, %esp movl 8(%ebp), %eax addl $3, %eax pushl %eax call construct_pthread_hash addl $16, %esp movl %eax, %eax testl %eax, %eax je .L4 subl $12, %esp pushl $stats_lock call pthread_mutex_unlock addl $16, %esp subl $8, %esp pushl $.LC1 pushl stderr call fprintf addl $16, %esp movl $-1, %eax jmp .L2 .p2align 2 .L4: subl $12, %esp movl 8(%ebp), %eax addl $3, %eax pushl %eax call construct_hash addl $16, %esp movl %eax, %eax testl %eax, %eax je .L5 subl $12, %esp pushl $stats_lock call pthread_mutex_unlock addl $16, %esp subl $8, %esp pushl $.LC1 pushl stderr call fprintf addl $16, %esp movl $-1, %eax jmp .L2 .p2align 2 .L5: movl $1, is_active subl $12, %esp pushl $stats_lock call pthread_mutex_unlock addl $16, %esp movl $0, %eax .L2: leave ret .Lfe1: .size construct_locksmith,.Lfe1-construct_locksmith .section .rodata .LC2: .string "Locksmith is bailing.\n" .text .align 4 .globl locksmith_bail .type locksmith_bail,@function locksmith_bail: pushl %ebp movl %esp, %ebp subl $8, %esp call destroy_pthread_hash call destroy_hash subl $8, %esp pushl $.LC2 pushl stderr call fprintf addl $16, %esp movl $0, is_active subl $8, %esp pushl $1 pushl $jbuff call longjmp .Lfe2: .size locksmith_bail,.Lfe2-locksmith_bail .align 4 .globl destroy_locksmith .type destroy_locksmith,@function destroy_locksmith: pushl %ebp movl %esp, %ebp subl $8, %esp subl $12, %esp pushl $stats_lock call pthread_mutex_lock addl $16, %esp call destroy_pthread_hash call destroy_hash movl $0, is_active subl $12, %esp pushl $stats_lock call pthread_mutex_unlock addl $16, %esp leave ret .Lfe3: .size destroy_locksmith,.Lfe3-destroy_locksmith .align 4 .globl locksmith_add_lock_to_thread .type locksmith_add_lock_to_thread,@function locksmith_add_lock_to_thread: pushl %ebp movl %esp, %ebp subl $8, %esp movl %eax, -4(%ebp) subl $12, %esp pushl $stats_lock call pthread_mutex_lock addl $16, %esp subl $8, %esp pushl $1 pushl $5 call signal addl $16, %esp cmpl $0, is_active jne .L9 jmp .L8 .p2align 2 .L9: subl $12, %esp pushl $jbuff call _setjmp addl $16, %esp movl %eax, %eax testl %eax, %eax je .L10 subl $12, %esp pushl $stats_lock call pthread_mutex_unlock addl $16, %esp jmp .L8 .p2align 2 .L10: subl $8, %esp subl $8, %esp call pthread_self addl $8, %esp movl %eax, %eax pushl %eax pushl -4(%ebp) call add_lock_to_thread addl $16, %esp subl $12, %esp pushl $stats_lock call pthread_mutex_unlock addl $16, %esp .L8: leave ret .Lfe4: .size locksmith_add_lock_to_thread,.Lfe4-locksmith_add_lock_to_thread .align 4 .globl locksmith_remove_lock_from_thread .type locksmith_remove_lock_from_thread,@function locksmith_remove_lock_from_thread: pushl %ebp movl %esp, %ebp subl $8, %esp movl %eax, -4(%ebp) subl $12, %esp pushl $stats_lock call pthread_mutex_lock addl $16, %esp subl $8, %esp pushl $1 pushl $5 call signal addl $16, %esp cmpl $0, is_active jne .L12 jmp .L11 .p2align 2 .L12: subl $12, %esp pushl $jbuff call _setjmp addl $16, %esp movl %eax, %eax testl %eax, %eax je .L13 subl $12, %esp pushl $stats_lock call pthread_mutex_unlock addl $16, %esp jmp .L11 .p2align 2 .L13: subl $8, %esp subl $8, %esp call pthread_self addl $8, %esp movl %eax, %eax pushl %eax pushl -4(%ebp) call remove_lock_from_thread addl $16, %esp subl $12, %esp pushl $stats_lock call pthread_mutex_unlock addl $16, %esp .L11: leave ret .Lfe5: .size locksmith_remove_lock_from_thread,.Lfe5-locksmith_remove_lock_from_thread .section .rodata .LC3: .string "Access Thread No %d\n" .text .align 4 .globl locksmith_add_memory_access .type locksmith_add_memory_access,@function locksmith_add_memory_access: pushl %ebp movl %esp, %ebp subl $8, %esp subl $12, %esp pushl $stats_lock call pthread_mutex_lock addl $16, %esp subl $8, %esp pushl $1 pushl $5 call signal addl $16, %esp cmpl $0, is_active jne .L15 jmp .L14 .p2align 2 .L15: subl $12, %esp pushl $jbuff call _setjmp addl $16, %esp movl %eax, %eax testl %eax, %eax je .L16 subl $12, %esp pushl $stats_lock call pthread_mutex_unlock addl $16, %esp jmp .L14 .p2align 2 .L16: subl $8, %esp subl $8, %esp call pthread_self addl $8, %esp movl %eax, %eax pushl %eax pushl $.LC3 call printf addl $16, %esp subl $4, %esp subl $12, %esp call pthread_self addl $12, %esp movl %eax, %eax pushl %eax pushl 12(%ebp) pushl 8(%ebp) call add_memory_access addl $16, %esp subl $12, %esp pushl $stats_lock call pthread_mutex_unlock addl $16, %esp .L14: leave ret .Lfe6: .size locksmith_add_memory_access,.Lfe6-locksmith_add_memory_access .comm stats_lock,24,4 .comm is_active,4,4 .comm jbuff,156,32 .ident "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.1 2.96-81)"