#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ run_test(int, int);
void run_tests(int threads, int count) {
  for (int i = 0; i < count; i++) {
    if (i && i % 10000000 == 0)
      printf("still truckin' %d\n", i);
    run_test(threads, i);
  }
}


x86 assembly (clang, -O0):
<run_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1187 <run_tests+0x67>
cmpl   $0x0,-0xc(%rbp)
je     116e <run_tests+0x4e>
mov    -0xc(%rbp),%eax
mov    $0x989680,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116e <run_tests+0x4e>
mov    -0xc(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <run_test@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <run_tests+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_tests>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1178 <run_tests+0x58>
mov    %esi,%ebx
mov    %edi,%r14d
xor    %ebp,%ebp
lea    0xec7(%rip),%r15
jmp    1151 <run_tests+0x31>
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %ebp,%esi
call   1040 <run_test@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
je     1178 <run_tests+0x58>
test   %ebp,%ebp
je     1140 <run_tests+0x20>
mov    %ebp,%eax
imul   $0x6b5fca6b,%rax,%rax
shr    $0x36,%rax
imul   $0x989680,%eax,%eax
cmp    %ebp,%eax
jne    1140 <run_tests+0x20>
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
jmp    1140 <run_tests+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"still truckin' %d\0A\00"
define void @run_tests(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %24, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %27
10: ; preds = %6
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %5
%15 = srem i32 %14, 10000000
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %5
%19 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %13, %10
%21 = load i32, i32* %3
%22 = load i32, i32* %5
%23 = call i32 @run_test(i32 %21, i32 %22)
br label %24
24: ; preds = %20
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %6
27: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"still truckin' %d\0A\00"
define void @run_tests(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %13, %2
ret void
5: ; preds = %2, %13
%6 = phi i32 [ %15, %13 ], [ 0, %2 ]
%7 = icmp ne i32 %6, 0
%8 = urem i32 %6, 10000000
%9 = icmp eq i32 %8, 0
%10 = and i1 %7, %9
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %13
13: ; preds = %11, %5
%14 = tail call i32 @run_test(i32 %0, i32 %6)
%15 = add nuw nsw i32 %6, 1
%16 = icmp eq i32 %15, %1
br i1 %16, label %4, label %5
}