#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 /*<<< orphan*/ sleep(int);
void *threadMainFunction1(void *arg) {
  int i, j, n = (int)arg;
  for (i = 0; i < 10; i++) {
    sleep(1);
    for (j = 0; j < n; j++)
      printf("\t\t");
    printf(" ...... %d ...........\n", n);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<threadMainFunction1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    119c <threadMainFunction1+0x7c>
mov    $0x1,%edi
call   1040 <sleep@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    117d <threadMainFunction1+0x5d>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <threadMainFunction1+0x35>
mov    -0x14(%rbp),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <threadMainFunction1+0x1a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadMainFunction1>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x1,%edi
call   1040 <sleep@plt>
test   %r14d,%r14d
jle    1191 <threadMainFunction1+0x71>
lea    0xec3(%rip),%rbx
mov    %r14d,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1140 <threadMainFunction1+0x20>
lea    0xead(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
test   %r14d,%r14d
jle    120e <threadMainFunction1+0xee>
lea    0xe86(%rip),%rbx
mov    %r14d,%ebp
nopl   (%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1180 <threadMainFunction1+0x60>
jmp    11ac <threadMainFunction1+0x8c>
lea    0xe6b(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xe50(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
test   %r14d,%r14d
jle    11f1 <threadMainFunction1+0xd1>
lea    0xe2d(%rip),%rbx
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    11e0 <threadMainFunction1+0xc0>
jmp    1229 <threadMainFunction1+0x109>
lea    0xe0b(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    126f <threadMainFunction1+0x14f>
lea    0xdee(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xdd3(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
test   %r14d,%r14d
jle    12b1 <threadMainFunction1+0x191>
lea    0xdb0(%rip),%rbx
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1260 <threadMainFunction1+0x140>
lea    0xd8d(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
test   %r14d,%r14d
jle    1311 <threadMainFunction1+0x1f1>
lea    0xd66(%rip),%rbx
mov    %r14d,%ebp
nopl   (%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    12a0 <threadMainFunction1+0x180>
jmp    12cc <threadMainFunction1+0x1ac>
lea    0xd4b(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xd30(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
test   %r14d,%r14d
jle    1371 <threadMainFunction1+0x251>
lea    0xd09(%rip),%rbx
mov    %r14d,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1300 <threadMainFunction1+0x1e0>
jmp    132c <threadMainFunction1+0x20c>
lea    0xceb(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xcd0(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
test   %r14d,%r14d
jle    13d1 <threadMainFunction1+0x2b1>
lea    0xca9(%rip),%rbx
mov    %r14d,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1360 <threadMainFunction1+0x240>
jmp    138c <threadMainFunction1+0x26c>
lea    0xc8b(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xc70(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
test   %r14d,%r14d
jle    1431 <threadMainFunction1+0x311>
lea    0xc49(%rip),%rbx
mov    %r14d,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    13c0 <threadMainFunction1+0x2a0>
jmp    13ec <threadMainFunction1+0x2cc>
lea    0xc2b(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xc10(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
test   %r14d,%r14d
jle    1491 <threadMainFunction1+0x371>
lea    0xbe9(%rip),%rbx
mov    %r14d,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1420 <threadMainFunction1+0x300>
jmp    144c <threadMainFunction1+0x32c>
lea    0xbcb(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xbb0(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
test   %r14d,%r14d
jle    14ac <threadMainFunction1+0x38c>
lea    0xb8d(%rip),%rbx
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1480 <threadMainFunction1+0x360>
jmp    14ac <threadMainFunction1+0x38c>
lea    0xb6b(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xb50(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"\09\09\00"
@.str.1 = [24 x i8] c" ...... %d ...........\0A\00"
define noalias i8* @threadMainFunction1(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
%5 = tail call i32 @sleep(i32 1)
br i1 %4, label %6, label %19
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %3
br i1 %10, label %11, label %6
11: ; preds = %6
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%13 = tail call i32 @sleep(i32 1)
br i1 %4, label %14, label %30
14: ; preds = %11, %14
%15 = phi i32 [ %17, %14 ], [ 0, %11 ]
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = add nuw nsw i32 %15, 1
%18 = icmp eq i32 %17, %3
br i1 %18, label %22, label %14
19: ; preds = %1
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%21 = tail call i32 @sleep(i32 1)
br label %22
22: ; preds = %14, %19
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%24 = tail call i32 @sleep(i32 1)
br i1 %4, label %25, label %41
25: ; preds = %22, %25
%26 = phi i32 [ %28, %25 ], [ 0, %22 ]
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%28 = add nuw nsw i32 %26, 1
%29 = icmp eq i32 %28, %3
br i1 %29, label %33, label %25
30: ; preds = %11
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%32 = tail call i32 @sleep(i32 1)
br label %33
33: ; preds = %25, %30
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%35 = tail call i32 @sleep(i32 1)
br i1 %4, label %36, label %52
36: ; preds = %33, %36
%37 = phi i32 [ %39, %36 ], [ 0, %33 ]
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%39 = add nuw nsw i32 %37, 1
%40 = icmp eq i32 %39, %3
br i1 %40, label %44, label %36
41: ; preds = %22
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%43 = tail call i32 @sleep(i32 1)
br label %44
44: ; preds = %36, %41
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%46 = tail call i32 @sleep(i32 1)
br i1 %4, label %47, label %63
47: ; preds = %44, %47
%48 = phi i32 [ %50, %47 ], [ 0, %44 ]
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%50 = add nuw nsw i32 %48, 1
%51 = icmp eq i32 %50, %3
br i1 %51, label %55, label %47
52: ; preds = %33
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%54 = tail call i32 @sleep(i32 1)
br label %55
55: ; preds = %47, %52
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%57 = tail call i32 @sleep(i32 1)
br i1 %4, label %58, label %74
58: ; preds = %55, %58
%59 = phi i32 [ %61, %58 ], [ 0, %55 ]
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%61 = add nuw nsw i32 %59, 1
%62 = icmp eq i32 %61, %3
br i1 %62, label %66, label %58
63: ; preds = %44
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%65 = tail call i32 @sleep(i32 1)
br label %66
66: ; preds = %58, %63
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%68 = tail call i32 @sleep(i32 1)
br i1 %4, label %69, label %85
69: ; preds = %66, %69
%70 = phi i32 [ %72, %69 ], [ 0, %66 ]
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%72 = add nuw nsw i32 %70, 1
%73 = icmp eq i32 %72, %3
br i1 %73, label %77, label %69
74: ; preds = %55
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%76 = tail call i32 @sleep(i32 1)
br label %77
77: ; preds = %69, %74
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%79 = tail call i32 @sleep(i32 1)
br i1 %4, label %80, label %96
80: ; preds = %77, %80
%81 = phi i32 [ %83, %80 ], [ 0, %77 ]
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%83 = add nuw nsw i32 %81, 1
%84 = icmp eq i32 %83, %3
br i1 %84, label %88, label %80
85: ; preds = %66
%86 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%87 = tail call i32 @sleep(i32 1)
br label %88
88: ; preds = %80, %85
%89 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%90 = tail call i32 @sleep(i32 1)
br i1 %4, label %91, label %107
91: ; preds = %88, %91
%92 = phi i32 [ %94, %91 ], [ 0, %88 ]
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%94 = add nuw nsw i32 %92, 1
%95 = icmp eq i32 %94, %3
br i1 %95, label %99, label %91
96: ; preds = %77
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%98 = tail call i32 @sleep(i32 1)
br label %99
99: ; preds = %91, %96
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%101 = tail call i32 @sleep(i32 1)
br i1 %4, label %102, label %110
102: ; preds = %99, %102
%103 = phi i32 [ %105, %102 ], [ 0, %99 ]
%104 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%105 = add nuw nsw i32 %103, 1
%106 = icmp eq i32 %105, %3
br i1 %106, label %110, label %102
107: ; preds = %88
%108 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%109 = tail call i32 @sleep(i32 1)
br label %110
110: ; preds = %102, %107, %99
%111 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i8* null
}