// File: /workspace/github_c_makefile_star2_O0/cirocosta[P]stress/src/context-switches.c
// Function: main
int
main()
{
	pthread_t threads[NTHREADS];

	srand(time(NULL));
	for (int i = 0; i < NTHREADS; i++) {
		_STRESS_MUST(
		  (!pthread_create(&threads[i], NULL, &thread_handler, NULL)),
		  "Unexpected error creating thread %d",
		  i);
	}

	for (int i = 0; i < NTHREADS; i++) {
		_STRESS_MUST((!pthread_join(threads[i], NULL)),
		             "Unexpected error waiting for thread %d",
		             i);
	}

	return 0;
}

// Assembly:
subq $0x1a8, %rsp            # imm = 0x1A8
movl $0x0, 0x1a4(%rsp)
xorl %eax, %eax
movl %eax, %edi
callq 0x10f0
movl %eax, %edi
callq 0x10d0
movl $0x0, 0xc(%rsp)
cmpl $0x32, 0xc(%rsp)
jge 0x1c72
jmp 0x1b57
movslq 0xc(%rsp), %rax
leaq 0x10(%rsp), %rdi
shlq $0x3, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x1d3(%rip), %rdx      # 0x19a0
movq %rcx, %rsi
callq 0x1100
cmpl $0x0, %eax
je 0x1c5e
movq 0x246d(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x4a3(%rip), %rsi       # 0x2038
movb $0x0, %al
callq 0x10e0
movq 0x2455(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x491(%rip), %rsi       # 0x203e
movb $0x0, %al
callq 0x10e0
movq 0x243d(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movl 0xc(%rsp), %edx
leaq 0x5b0(%rip), %rsi       # 0x2179
movb $0x0, %al
callq 0x10e0
movq 0x2421(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x484(%rip), %rsi       # 0x2065
movb $0x0, %al
callq 0x10e0
movq 0x2409(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x46f(%rip), %rsi       # 0x2068
leaq 0x540(%rip), %rdx       # 0x2140
movb $0x0, %al
callq 0x10e0
movq 0x23ea(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x46c(%rip), %rsi       # 0x2084
movl $0x3d, %edx
movb $0x0, %al
callq 0x10e0
movq 0x23cd(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x431(%rip), %rsi       # 0x2066
movb $0x0, %al
callq 0x10e0
movq 0x23b5(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x444(%rip), %rsi       # 0x2091
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1160
jmp 0x1c60
jmp 0x1c62
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x1b4a
movl $0x0, 0x8(%rsp)
cmpl $0x32, 0x8(%rsp)
jge 0x1d91
jmp 0x1c87
movslq 0x8(%rsp), %rax
movq 0x10(%rsp,%rax,8), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1170
cmpl $0x0, %eax
je 0x1d7d
movq 0x234e(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x384(%rip), %rsi       # 0x2038
movb $0x0, %al
callq 0x10e0
movq 0x2336(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x372(%rip), %rsi       # 0x203e
movb $0x0, %al
callq 0x10e0
movq 0x231e(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movl 0x8(%rsp), %edx
leaq 0x4b5(%rip), %rsi       # 0x219d
movb $0x0, %al
callq 0x10e0
movq 0x2302(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x365(%rip), %rsi       # 0x2065
movb $0x0, %al
callq 0x10e0
movq 0x22ea(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x350(%rip), %rsi       # 0x2068
leaq 0x421(%rip), %rdx       # 0x2140
movb $0x0, %al
callq 0x10e0
movq 0x22cb(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x34d(%rip), %rsi       # 0x2084
movl $0x43, %edx
movb $0x0, %al
callq 0x10e0
movq 0x22ae(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x312(%rip), %rsi       # 0x2066
movb $0x0, %al
callq 0x10e0
movq 0x2296(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x325(%rip), %rsi       # 0x2091
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1160
jmp 0x1d7f
jmp 0x1d81
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x1c7a
xorl %eax, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
retq