xunge/DecIR huggingface dataset:
int isupper(int c) {
  switch (c) {
  case 'A':
  case 'B':
  case 'C':
  case 'D':
  case 'E':
  case 'F':
  case 'G':
  case 'H':
  case 'I':
  case 'J':
  case 'K':
  case 'L':
  case 'M':
  case 'N':
  case 'O':
  case 'P':
  case 'Q':
  case 'R':
  case 'S':
  case 'T':
  case 'U':
  case 'V':
  case 'W':
  case 'X':
  case 'Y':
  case 'Z':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffbf,%eax
sub    $0x19,%eax
ja     1127 <isupper+0x27>
jmp    111b <isupper+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 65, label %5
i32 66, label %5
i32 67, label %5
i32 68, label %5
i32 69, label %5
i32 70, label %5
i32 71, label %5
i32 72, label %5
i32 73, label %5
i32 74, label %5
i32 75, label %5
i32 76, label %5
i32 77, label %5
i32 78, label %5
i32 79, label %5
i32 80, label %5
i32 81, label %5
i32 82, label %5
i32 83, label %5
i32 84, label %5
i32 85, label %5
i32 86, label %5
i32 87, label %5
i32 88, label %5
i32 89, label %5
i32 90, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char fact(char);
void main(void) {
  char *x = (char *)2000;
  float *y = (float *)2004;
  x[0] = 5;
  x[1] = fact(x[0]);
  *y = 3.14;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7d0,%eax
mov    %rax,-0x8(%rbp)
mov    $0x7d4,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x5,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <fact@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movss  0xeae(%rip),%xmm0
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x5,0x7d0
05
mov    $0x5,%edi
call   1030 <fact@plt>
mov    %al,0x7d1
movl   $0x4048f5c3,0x7d4
c3 f5 48 40
pop    %rax
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i8*
%2 = alloca float*
store i8* inttoptr (i64 2000 to i8*), i8** %1
store float* inttoptr (i64 2004 to float*), float** %2
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 5, i8* %4
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = call signext i8 @fact(i8 signext %7)
%9 = load i8*, i8** %1
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %8, i8* %10
%11 = load float*, float** %2
store float 0x40091EB860000000, float* %11
ret void
}

LLVM IR (-O2):
define void @main() {
store i8 5, i8* inttoptr (i64 2000 to i8*)
%1 = tail call signext i8 @fact(i8 signext 5)
store i8 %1, i8* inttoptr (i64 2001 to i8*)
store float 0x40091EB860000000, float* inttoptr (i64 2004 to float*)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t lt_int64_t(int64_t a, int64_t b) { return a < b; }


x86 assembly (clang, -O0):
<lt_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_int64_t>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @lt_int64_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lt_int64_t(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void __attribute__((__unused__))
_hash_pthread_mtx_unlock_hnode_hh(void *m,
                                  void *_HU_d __attribute__((__unused__))) {
  pthread_mutex_t *mtx = (pthread_mutex_t *)m;
  pthread_mutex_unlock(mtx);
}


x86 assembly (clang, -O0):
<_hash_pthread_mtx_unlock_hnode_hh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash_pthread_mtx_unlock_hnode_hh>:
jmp    1030 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
define void @_hash_pthread_mtx_unlock_hnode_hh(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @pthread_mutex_unlock(i32* %8)
ret void
}

LLVM IR (-O2):
define void @_hash_pthread_mtx_unlock_hnode_hh(i8* %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @pthread_mutex_unlock(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_status(char *, char const *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void test_ok(const char *test) { test_status("ok", test, NULL, NULL); }


x86 assembly (clang, -O0):
<test_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <test_status@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ok>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <test_status@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ok\00"
define void @test_ok(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @test_status(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
define void @test_ok(i8* %0) {
%2 = tail call i32 @test_status(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0, i32* null, i32* null)
ret void
}
void strConcatChar(char dest[], const char ch_source, int *count, int max) {
  if (max > (*count + 1))
    dest[(*count)++] = ch_source;
  dest[*count] = '\0';
}


x86 assembly (clang, -O0):
<strConcatChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jle    1143 <strConcatChar+0x43>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strConcatChar>:
mov    (%rdx),%eax
lea    0x1(%rax),%r8d
cmp    %ecx,%r8d
jge    1116 <strConcatChar+0x16>
cltq
mov    %r8d,(%rdx)
mov    %sil,(%rdi,%rax,1)
mov    (%rdx),%eax
cltq
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @strConcatChar(i8* %0, i8 signext %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store i8 %1, i8* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
%13 = icmp sgt i32 %9, %12
br i1 %13, label %14, label %22
14: ; preds = %4
%15 = load i8, i8* %6
%16 = load i8*, i8** %5
%17 = load i32*, i32** %7
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %17
%20 = sext i32 %18 to i64
%21 = getelementptr inbounds i8, i8* %16, i64 %20
store i8 %15, i8* %21
br label %22
22: ; preds = %14, %4
%23 = load i8*, i8** %5
%24 = load i32*, i32** %7
%25 = load i32, i32* %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %23, i64 %26
store i8 0, i8* %27
ret void
}

LLVM IR (-O2):
define void @strConcatChar(i8* nocapture writeonly %0, i8 signext %1, i32* nocapture %2, i32 %3) {
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = icmp slt i32 %6, %3
br i1 %7, label %8, label %12
8: ; preds = %4
store i32 %6, i32* %2
%9 = sext i32 %5 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 %1, i8* %10
%11 = load i32, i32* %2
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ %11, %8 ], [ %5, %4 ]
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret void
}
int squareVisited(int (*visited)[13 / 2], int row, int col) {
  return visited[row][col];
}


x86 assembly (clang, -O0):
<squareVisited>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<squareVisited>:
movslq %esi,%rax
movslq %edx,%rcx
lea    (%rax,%rax,2),%rax
lea    (%rdi,%rax,8),%rax
mov    (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @squareVisited([6 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca [6 x i32]*
%5 = alloca i32
%6 = alloca i32
store [6 x i32]* %0, [6 x i32]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load [6 x i32]*, [6 x i32]** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 %9
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %10, i64 0, i64 %12
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @squareVisited([6 x i32]* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %0, i64 %4, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ isupper(int /*<<< orphan*/);
int is_upper(char *s) {
  while (*s) {
    if (isupper(*s++)) {
      continue;
    }
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <is_upper+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     114f <is_upper+0x3f>
jmp    111c <is_upper+0xc>
movl   $0x0,-0x4(%rbp)
jmp    1162 <is_upper+0x52>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_upper>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
test   %edi,%edi
je     1139 <is_upper+0x29>
add    $0x1,%rbx
call   1030 <isupper@plt>
test   %rax,%rax
jne    1120 <is_upper+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_upper(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %15, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i64 @isupper(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %8
br label %4
16: ; preds = %8
store i32 0, i32* %2
br label %18
17: ; preds = %4
store i32 1, i32* %2
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_upper(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = tail call i64 @isupper(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Dump(char, int /*<<< orphan*/, int /*<<< orphan*/, int);
void DumpOp(char OpCode, int Fi) { Dump(OpCode, 0, 0, Fi); }


x86 assembly (clang, -O0):
<DumpOp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%ecx
xor    %edx,%edx
movsbl %al,%edi
mov    %edx,%esi
call   1030 <Dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpOp>:
mov    %esi,%ecx
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <Dump@plt>

LLVM IR (-O0):
define void @DumpOp(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = load i32, i32* %4
%7 = call i32 @Dump(i8 signext %5, i32 0, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @DumpOp(i8 signext %0, i32 %1) {
%3 = tail call i32 @Dump(i8 signext %0, i32 0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x, y;
  assert((x - y > 0) == (x > y));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = sub nsw i32 %3, %4
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = icmp sgt i32 %8, %9
%11 = zext i1 %10 to i32
%12 = icmp eq i32 %7, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
void fun() {
#pragma omp parallel
  {
#pragma omp master
    { printf("Thread in master %d\n", omp_get_thread_num()); }
#pragma omp single
    { printf("Thread in single %d\n", omp_get_thread_num()); }
  }
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Thread in master %d\0A\00"
@.str.1 = [21 x i8] c"Thread in single %d\0A\00"
define void @fun() {
%1 = call i32 (...) @omp_get_thread_num()
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @omp_get_thread_num()
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Thread in master %d\0A\00"
@.str.1 = [21 x i8] c"Thread in single %d\0A\00"
define void @fun() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo();
int main(void) {
  if (5 != foo())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
je     114c <main+0x2c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x5,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 5, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 5
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int IsMantissaZero(unsigned short *mant) {
  int i;
  int n;
  n = 0;
  for (i = 0; i < 4; i++)
    n |= mant[i];
  return (!n);
}


x86 assembly (clang, -O0):
<IsMantissaZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1140 <IsMantissaZero+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <IsMantissaZero+0x16>
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsMantissaZero>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @IsMantissaZero(i16* %0) {
%2 = alloca i16*
%3 = alloca i32
%4 = alloca i32
store i16* %0, i16** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i16*, i16** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i16, i16* %9, i64 %11
%13 = load i16, i16* %12
%14 = zext i16 %13 to i32
%15 = load i32, i32* %4
%16 = or i32 %15, %14
store i32 %16, i32* %4
br label %17
17: ; preds = %8
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %5
20: ; preds = %5
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @IsMantissaZero(i16* nocapture %0) {
%2 = bitcast i16* %0 to <4 x i16>*
%3 = load <4 x i16>, <4 x i16>* %2
%4 = call i16 @llvm.vector.reduce.or.v4i16(<4 x i16> %3)
%5 = icmp eq i16 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  {
    state[0UL] = (input[0UL] + 51238316UL) + 274866410U;
    if ((state[0UL] >> 4U) & 1U) {
      if ((state[0UL] >> 3U) & 1U) {
      }
    } else if ((state[0UL] >> 3U) & 1U) {
    }
    output[0UL] = state[0UL] + 119333056UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x30dd5ac,%rax
add    $0x106220ea,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x4,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <RandomFunc+0x4f>
mov    -0x14(%rbp),%eax
shr    $0x3,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114a <RandomFunc+0x4a>
jmp    114a <RandomFunc+0x4a>
jmp    116b <RandomFunc+0x6b>
mov    -0x14(%rbp),%eax
shr    $0x3,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1166 <RandomFunc+0x66>
jmp    1166 <RandomFunc+0x66>
jmp    116b <RandomFunc+0x6b>
mov    -0x14(%rbp),%eax
add    $0x71ce0c0,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x1a8cd756,%eax
add    (%rdi),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = zext i32 %8 to i64
%10 = add i64 %9, 51238316
%11 = add i64 %10, 274866410
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %12, i32* %13
%14 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%15 = load i32, i32* %14
%16 = lshr i32 %15, 4
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %27
19: ; preds = %2
%20 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%21 = load i32, i32* %20
%22 = lshr i32 %21, 3
%23 = and i32 %22, 1
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
br label %26
26: ; preds = %25, %19
br label %35
27: ; preds = %2
%28 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%29 = load i32, i32* %28
%30 = lshr i32 %29, 3
%31 = and i32 %30, 1
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %27
br label %34
34: ; preds = %33, %27
br label %35
35: ; preds = %34, %26
%36 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%37 = load i32, i32* %36
%38 = zext i32 %37 to i64
%39 = add i64 %38, 119333056
%40 = trunc i64 %39 to i32
%41 = load i32*, i32** %4
%42 = getelementptr inbounds i32, i32* %41, i64 0
store i32 %40, i32* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 445437782
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isnanf(float const);
int flt_isreal(const float x) { return !isnanf(x); }


x86 assembly (clang, -O0):
<flt_isreal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <isnanf@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_isreal>:
push   %rax
call   1030 <isnanf@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @flt_isreal(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @isnanf(float %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @flt_isreal(float %0) {
%2 = tail call i32 @isnanf(float %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void str_all_to_upper(char *str) {
  int l = strlen(str);
  {
    int i;
    for (i = 0; (i < l); ++i)
      str[i] = toupper(str[i]);
  }
}


x86 assembly (clang, -O0):
<str_all_to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <str_all_to_upper+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <str_all_to_upper+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_all_to_upper>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    1157 <str_all_to_upper+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <str_all_to_upper+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @str_all_to_upper(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %22, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call signext i8 @toupper(i8 signext %16)
%18 = load i8*, i8** %2
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
br label %22
22: ; preds = %11
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %7
25: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @str_all_to_upper(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
void foo650(int p) {}


x86 assembly (clang, -O0):
<foo650>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo650>:
ret

LLVM IR (-O0):
define void @foo650(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo650(i32 %0) {
ret void
}
/* Variables and functions */
int int_input();
int /*<<< orphan*/ printf(char *);
int prompt_month(void) {
  int temp_value = 0;
  printf("Enter Month as a Number (Jan = 1, Dec = 12): ");
  temp_value = int_input();
  return temp_value;
}


x86 assembly (clang, -O0):
<prompt_month>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <int_input@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_month>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <int_input@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Enter Month as a Number (Jan = 1, Dec = 12): \00"
define i32 @prompt_month() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @int_input()
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [46 x i8] c"Enter Month as a Number (Jan = 1, Dec = 12): \00"
define i32 @prompt_month() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @int_input()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 1; i <= 255; i++) {
    printf("%d - %c\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d - %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d - %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
double sin(double);
int /*<<< orphan*/ sincos(double, double *, double *);
double f3(double x) {
  double s, c, tmp;
  sincos(x, &tmp, &c);
  s = sin(x);
  return s + c;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <sincos@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <sincos@plt>
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f3(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = call i32 @sincos(double %6, double* %5, double* %4)
%8 = load double, double* %2
%9 = call double @sin(double %8)
store double %9, double* %3
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fadd double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @f3(double %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = call i32 @sincos(double %0, double* %3, double* %2)
%7 = call double @sin(double %0)
%8 = load double, double* %2
%9 = fadd double %7, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ vectorSet(float *, float, float, float);
void vectorScale(float dest[3], float s, const float src[3]) {
  vectorSet(dest, s * src[0], s * src[1], s * src[2]);
}


x86 assembly (clang, -O0):
<vectorScale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mulss  (%rax),%xmm0
movss  -0xc(%rbp),%xmm1
mov    -0x18(%rbp),%rax
mulss  0x4(%rax),%xmm1
movss  -0xc(%rbp),%xmm2
mov    -0x18(%rbp),%rax
mulss  0x8(%rax),%xmm2
call   1030 <vectorSet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorScale>:
movaps %xmm0,%xmm2
movss  (%rsi),%xmm0
mulss  %xmm2,%xmm0
movss  0x4(%rsi),%xmm1
mulss  %xmm2,%xmm1
mulss  0x8(%rsi),%xmm2
jmp    1030 <vectorSet@plt>

LLVM IR (-O0):
define void @vectorScale(float* %0, float %1, float* %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float*
store float* %0, float** %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float, float* %5
%9 = load float*, float** %6
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
%12 = fmul float %8, %11
%13 = load float, float* %5
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = load float, float* %5
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = fmul float %18, %21
%23 = call i32 @vectorSet(float* %7, float %12, float %17, float %22)
ret void
}

LLVM IR (-O2):
define void @vectorScale(float* %0, float %1, float* nocapture %2) {
%4 = load float, float* %2
%5 = fmul float %4, %1
%6 = getelementptr inbounds float, float* %2, i64 1
%7 = load float, float* %6
%8 = fmul float %7, %1
%9 = getelementptr inbounds float, float* %2, i64 2
%10 = load float, float* %9
%11 = fmul float %10, %1
%12 = tail call i32 @vectorSet(float* %0, float %5, float %8, float %11)
ret void
}
char *to_func(char *s, int len, int (*func)(int)) {
  char *p = s;
  for (; len > 0; p++, len--)
    *p = func(*p);
  return s;
}


x86 assembly (clang, -O0):
<to_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1154 <to_func+0x54>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%edi
call   *%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <to_func+0x1b>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_func>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1134 <to_func+0x34>
mov    %rdx,%r15
mov    %esi,%ebp
add    $0x1,%ebp
mov    %r14,%rbx
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   *%r15
mov    %al,(%rbx)
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <to_func+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @to_func(i8* %0, i32 %1, i32 (i32)* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32 (i32)*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 (i32)* %2, i32 (i32)** %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
br label %9
9: ; preds = %20, %3
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load i32 (i32)*, i32 (i32)** %6
%14 = load i8*, i8** %7
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 %13(i32 %16)
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %7
store i8 %18, i8* %19
br label %20
20: ; preds = %12
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %7
%23 = load i32, i32* %5
%24 = add nsw i32 %23, -1
store i32 %24, i32* %5
br label %9
25: ; preds = %9
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @to_func(i8* returned %0, i32 %1, i32 (i32)* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3, %5
%6 = phi i8* [ %12, %5 ], [ %0, %3 ]
%7 = phi i32 [ %13, %5 ], [ %1, %3 ]
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = tail call i32 %2(i32 %9)
%11 = trunc i32 %10 to i8
store i8 %11, i8* %6
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = add nsw i32 %7, -1
%14 = icmp ugt i32 %7, 1
br i1 %14, label %5, label %15
15: ; preds = %5, %3
ret i8* %0
}
/* Type definitions */
struct winsize {
  int ws_row;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int term_height() {
  struct winsize w;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  return w.ws_row;
}


x86 assembly (clang, -O0):
<term_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_height>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @term_height() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @term_height() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int calculate_output(int);
int main() {
  int output = -1;
  while (1) {
    int input;
    input = __VERIFIER_nondet_int();
    if ((input != 1) && (input != 2) && (input != 3) && (input != 4) &&
        (input != 5) && (input != 6))
      return -2;
    output = calculate_output(input);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1187 <main+0x67>
cmpl   $0x2,-0xc(%rbp)
je     1187 <main+0x67>
cmpl   $0x3,-0xc(%rbp)
je     1187 <main+0x67>
cmpl   $0x4,-0xc(%rbp)
je     1187 <main+0x67>
cmpl   $0x5,-0xc(%rbp)
je     1187 <main+0x67>
cmpl   $0x6,-0xc(%rbp)
je     1187 <main+0x67>
mov    $0xfffffffe,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0xc(%rbp),%edi
call   1030 <calculate_output@plt>
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
lea    -0x7(%rax),%ecx
cmp    $0xfffffffa,%ecx
jb     1148 <main+0x28>
mov    %eax,%edi
call   1030 <calculate_output@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
add    $0xfffffff9,%ecx
cmp    $0xfffffff9,%ecx
ja     1130 <main+0x10>
mov    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
br label %4
4: ; preds = %0, %24
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %24
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 4
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 5
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp ne i32 %21, 6
br i1 %22, label %23, label %24
23: ; preds = %20
ret i32 -2
24: ; preds = %20, %17, %14, %11, %8, %4
%25 = load i32, i32* %3
%26 = call i32 @calculate_output(i32 %25)
store i32 %26, i32* %2
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = add i32 %1, -7
%3 = icmp ult i32 %2, -6
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @calculate_output(i32 %5)
%7 = tail call i32 (...) @__VERIFIER_nondet_int()
%8 = add i32 %7, -7
%9 = icmp ult i32 %8, -6
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 -2
}
/* Variables and functions */
int wwviaudio_add_sound_to_slot(int, int);
int wwviaudio_add_sound(int which_sound) {
  return wwviaudio_add_sound_to_slot(which_sound, (-1));
}


x86 assembly (clang, -O0):
<wwviaudio_add_sound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xffffffff,%esi
call   1030 <wwviaudio_add_sound_to_slot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wwviaudio_add_sound>:
mov    $0xffffffff,%esi
jmp    1030 <wwviaudio_add_sound_to_slot@plt>

LLVM IR (-O0):
define i32 @wwviaudio_add_sound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @wwviaudio_add_sound_to_slot(i32 %3, i32 -1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @wwviaudio_add_sound(i32 %0) {
%2 = tail call i32 @wwviaudio_add_sound_to_slot(i32 %0, i32 -1)
ret i32 %2
}
void swap(char *left, char *right) {
  char blank;
  blank = *left;
  *left = *right;
  *right = blank;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
unsigned int PJWHash(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strlen(unsigned char *);
int main(int argc, char *argv[]) {
  unsigned char *str = argv[1];
  unsigned int hash = PJWHash(str, strlen(str));
  if (hash == 0xaf9bec9)
    printf("You win!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1050 <PJWHash@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xaf9bec9,-0x1c(%rbp)
jne    118a <main+0x5a>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <PJWHash@plt>
cmp    $0xaf9bec9,%eax
jne    115a <main+0x2a>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"You win!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @PJWHash(i8* %11, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 184139465
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"You win!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i32 @PJWHash(i8* %4, i32 %5)
%7 = icmp eq i32 %6, 184139465
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}
void apr_pool_cleanup_for_exec(void) { return; }


x86 assembly (clang, -O0):
<apr_pool_cleanup_for_exec>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apr_pool_cleanup_for_exec>:
ret

LLVM IR (-O0):
define void @apr_pool_cleanup_for_exec() {
ret void
}

LLVM IR (-O2):
define void @apr_pool_cleanup_for_exec() {
ret void
}
decremento(void *arg) {}


x86 assembly (clang, -O0):
<decremento>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decremento>:
ret

LLVM IR (-O0):
define i32 @decremento(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @decremento(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
char *my_newString_double(double);
char *value_to_string_FL64(double value) { return my_newString_double(value); }


x86 assembly (clang, -O0):
<value_to_string_FL64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <my_newString_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_to_string_FL64>:
jmp    1030 <my_newString_double@plt>

LLVM IR (-O0):
define i8* @value_to_string_FL64(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i8* @my_newString_double(double %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @value_to_string_FL64(double %0) {
%2 = tail call i8* @my_newString_double(double %0)
ret i8* %2
}
/* Variables and functions */
int baz();
int foo();
int main(void) {
  int y, z;
  y = 2;
  z = 9;
  y = foo();
  z = y;
  y = y + 2;
  y = baz();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <baz@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
call   1030 <baz@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 9, i32* %3
%4 = call i32 (...) @foo()
store i32 %4, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 2
store i32 %7, i32* %2
%8 = call i32 (...) @baz()
store i32 %8, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @baz()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
scalar_t__ pthread_self();
void funcion(void) {
  printf("HIlo %d \n", (int)pthread_self());
  pthread_exit(0);
}


x86 assembly (clang, -O0):
<funcion>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <pthread_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcion>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"HIlo %d \0A\00"
define void @funcion() {
%1 = call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @pthread_exit(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"HIlo %d \0A\00"
define void @funcion() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @pthread_exit(i32 0)
ret void
}