xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *supported_temp_units();
void print_unit_info() {
  char *sup_units = supported_temp_units();
  printf("%s\n", "This program supports the following units:");
  printf("%s\n", sup_units);
  free(sup_units);
}


x86 assembly (clang, -O0):
<print_unit_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <supported_temp_units@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb6(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_unit_info>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <supported_temp_units@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%r14
lea    0xeb8(%rip),%rsi
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [43 x i8] c"This program supports the following units:\00"
define void @print_unit_info() {
%1 = alloca i8*
%2 = call i8* (...) @supported_temp_units()
store i8* %2, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [43 x i8] c"This program supports the following units:\00"
define void @print_unit_info() {
%1 = tail call i8* (...) @supported_temp_units()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @free(i8* %1)
ret void
}
int Round_off(double x) { return (x - (int)x >= 0.5 ? (int)x + 1 : (int)x); }


x86 assembly (clang, -O0):
<Round_off>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  0xedd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     113d <Round_off+0x3d>
cvttsd2si -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <Round_off+0x45>
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Round_off>:
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0xee8(%rip),%xmm0
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @Round_off(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fsub double %3, %6
%8 = fcmp oge double %7, 5.000000e-01
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fptosi double %10 to i32
%12 = add nsw i32 %11, 1
br label %16
13: ; preds = %1
%14 = load double, double* %2
%15 = fptosi double %14 to i32
br label %16
16: ; preds = %13, %9
%17 = phi i32 [ %12, %9 ], [ %15, %13 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @Round_off(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
%5 = fcmp oge double %4, 5.000000e-01
%6 = zext i1 %5 to i32
%7 = add nsw i32 %6, %2
ret i32 %7
}
void fa133(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    a:
      ({
        P024A:
          goto P024A;
          0;
      });
    p02B:
      goto p02B;
      goto a;
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa133>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa133+0x4>

x86 assembly (clang, -O2):
<fa133>:
jmp    1100 <fa133>

LLVM IR (-O0):
define void @fa133() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %17
br label %19
19: ; preds = %19, %18
br label %19
20: ; preds = %20
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa133() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ s1_1();
int /*<<< orphan*/ s1_2();
int /*<<< orphan*/ s1_3();
int /*<<< orphan*/ s1_4();
int /*<<< orphan*/ s1_5();
void test_endian_swap_s1() {
  s1_1();
  s1_2();
  s1_3();
  s1_4();
  s1_5();
}


x86 assembly (clang, -O0):
<test_endian_swap_s1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <s1_1@plt>
mov    $0x0,%al
call   1070 <s1_2@plt>
mov    $0x0,%al
call   1050 <s1_3@plt>
mov    $0x0,%al
call   1060 <s1_4@plt>
mov    $0x0,%al
call   1040 <s1_5@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_endian_swap_s1>:
push   %rax
xor    %eax,%eax
call   1030 <s1_1@plt>
xor    %eax,%eax
call   1070 <s1_2@plt>
xor    %eax,%eax
call   1050 <s1_3@plt>
xor    %eax,%eax
call   1060 <s1_4@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <s1_5@plt>

LLVM IR (-O0):
define void @test_endian_swap_s1() {
%1 = call i32 (...) @s1_1()
%2 = call i32 (...) @s1_2()
%3 = call i32 (...) @s1_3()
%4 = call i32 (...) @s1_4()
%5 = call i32 (...) @s1_5()
ret void
}

LLVM IR (-O2):
define void @test_endian_swap_s1() {
%1 = tail call i32 (...) @s1_1()
%2 = tail call i32 (...) @s1_2()
%3 = tail call i32 (...) @s1_3()
%4 = tail call i32 (...) @s1_4()
%5 = tail call i32 (...) @s1_5()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char *);
int /*<<< orphan*/ stripslash(char *);
char *strrchr(int /*<<< orphan*/, char);
char *basenamex(char *pathname) {
  char *dup = strdup(pathname);
  char *ptr = strrchr(stripslash(dup), '/');
  if (ptr == NULL)
    return dup;
  ptr = strdup(ptr + 1);
  free(dup);
  return ptr;
}


x86 assembly (clang, -O0):
<basenamex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <stripslash@plt>
mov    %eax,%edi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    118a <basenamex+0x4a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ac <basenamex+0x6c>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1060 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basenamex>:
push   %r14
push   %rbx
push   %rax
call   1060 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <stripslash@plt>
mov    %eax,%edi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     1181 <basenamex+0x41>
add    $0x1,%rax
mov    %rax,%rdi
call   1060 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    1184 <basenamex+0x44>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @basenamex(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @stripslash(i8* %8)
%10 = call i8* @strrchr(i32 %9, i8 signext 47)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i8*, i8** %4
store i8* %14, i8** %2
br label %22
15: ; preds = %1
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = call i8* @strdup(i8* %17)
store i8* %18, i8** %5
%19 = load i8*, i8** %4
%20 = call i32 @free(i8* %19)
%21 = load i8*, i8** %5
store i8* %21, i8** %2
br label %22
22: ; preds = %15, %13
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @basenamex(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i32 @stripslash(i8* %2)
%4 = tail call i8* @strrchr(i32 %3, i8 signext 47)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = tail call i8* @strdup(i8* %7)
%9 = tail call i32 @free(i8* %2)
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %8, %6 ], [ %2, %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void osexit(int sts) { exit(sts); }


x86 assembly (clang, -O0):
<osexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<osexit>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @osexit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @osexit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ reread();
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void sighup(int signo) {
  syslog(LOG_INFO, "Re-reading confituration file");
  reread();
}


x86 assembly (clang, -O0):
<sighup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <reread@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighup>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <syslog@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reread@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [30 x i8] c"Re-reading confituration file\00"
define void @sighup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_INFO
%4 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @reread()
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [30 x i8] c"Re-reading confituration file\00"
define void @sighup(i32 %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @reread()
ret void
}
void __alloc_pages(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__alloc_pages>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__alloc_pages>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__alloc_pages = [14 x i8] c"__alloc_pages\00"
define void @__alloc_pages() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.__alloc_pages, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__alloc_pages = [14 x i8] c"__alloc_pages\00"
define void @__alloc_pages() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.__alloc_pages, i64 0, i64 0))
ret void
}
int base9() { return 0; }


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

x86 assembly (clang, -O2):
<base9>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @base9() {
ret i32 0
}

LLVM IR (-O2):
define i32 @base9() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage() {
  fprintf(stderr, "Usage: maapi <-e -path> |  <-p <path> [-v <strval>]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Usage: maapi <-e -path> | <-p <path> [-v <strval>]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Usage: maapi <-e -path> | <-p <path> [-v <strval>]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int hash(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/ const *, size_t, int,
         int);
int sha3_224(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen) {
  if (outlen > (224 / 8)) {
    return -1;
  }
  return hash(out, outlen, in, inlen, 200 - (224 / 4), 0x06);
}


x86 assembly (clang, -O0):
<sha3_224>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x1c,-0x18(%rbp)
jbe    113f <sha3_224+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <sha3_224+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x90,%r8d
mov    $0x6,%r9d
call   1030 <hash@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha3_224>:
cmp    $0x1c,%rsi
jbe    111c <sha3_224+0xc>
mov    $0xffffffff,%eax
ret
mov    $0x90,%r8d
mov    $0x6,%r9d
jmp    1030 <hash@plt>

LLVM IR (-O0):
define i32 @sha3_224(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
store i32* %0, i32** %6
store i64 %1, i64* %7
store i32* %2, i32** %8
store i64 %3, i64* %9
%10 = load i64, i64* %7
%11 = icmp ugt i64 %10, 28
br i1 %11, label %12, label %13
12: ; preds = %4
store i32 -1, i32* %5
br label %19
13: ; preds = %4
%14 = load i32*, i32** %6
%15 = load i64, i64* %7
%16 = load i32*, i32** %8
%17 = load i64, i64* %9
%18 = call i32 @hash(i32* %14, i64 %15, i32* %16, i64 %17, i32 144, i32 6)
store i32 %18, i32* %5
br label %19
19: ; preds = %13, %12
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @sha3_224(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = icmp ugt i64 %1, 28
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @hash(i32* %0, i64 %1, i32* %2, i64 %3, i32 144, i32 6)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ -1, %4 ]
ret i32 %9
}
double scale_dh22(double x, double y, double z) { return 0.0; }


x86 assembly (clang, -O0):
<scale_dh22>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_dh22>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @scale_dh22(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @scale_dh22(double %0, double %1, double %2) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ print(int);
void main() {
  int i, sum = 0;
  for (i = 0; i <= 10; i++) {
    sum = sum + i;
  }
  print(sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     1147 <main+0x37>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%edi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x37,%edi
jmp    1030 <print@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = add nsw i32 %7, %8
store i32 %9, i32* %2
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %3
13: ; preds = %3
%14 = load i32, i32* %2
%15 = call i32 @print(i32 %14)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @print(i32 55)
ret void
}
int strln(char arr[]) {
  int i = 0;
  while (arr[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strln>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strln+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strln+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strln>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strln+0x10>
ret

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

LLVM IR (-O2):
define i32 @strln(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
double qd_to_double(const double *a) { return a[0]; }


x86 assembly (clang, -O0):
<qd_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_to_double>:
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @qd_to_double(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @qd_to_double(double* nocapture %0) {
%2 = load double, double* %0
ret double %2
}
/* Variables and functions */
scalar_t__ chars_is_lower(char);
scalar_t__ chars_is_upper(char);
bool chars_is_alpha(char c) { return chars_is_lower(c) || chars_is_upper(c); }


x86 assembly (clang, -O0):
<chars_is_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <chars_is_lower@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <chars_is_alpha+0x3c>
movsbl -0x1(%rbp),%edi
call   1040 <chars_is_upper@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_is_alpha>:
push   %rbx
mov    %edi,%ebx
call   1030 <chars_is_lower@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <chars_is_alpha+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <chars_is_upper@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chars_is_alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @chars_is_lower(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @chars_is_upper(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @chars_is_alpha(i8 signext %0) {
%2 = tail call i64 @chars_is_lower(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @chars_is_upper(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int RAND_MAX;
int random();
int random_compare(const void *a, const void *b) {
  return random() < RAND_MAX / 2;
}


x86 assembly (clang, -O0):
<random_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_compare>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
xor    %ecx,%ecx
cmp    %edx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @random_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @random()
%6 = load i32, i32* @RAND_MAX
%7 = sdiv i32 %6, 2
%8 = icmp slt i32 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @random_compare(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @random()
%4 = load i32, i32* @RAND_MAX
%5 = sdiv i32 %4, 2
%6 = icmp slt i32 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void event_space() {}


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

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

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

LLVM IR (-O2):
define void @event_space() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int AwSensorFromFile(char *, int /*<<< orphan*/ *, char **, char **, char **);
int AwSensorDiscover(time_t *last, char *tbcur[], char *tbdel[],
                     char *tbnew[]) {
  return AwSensorFromFile("discoverpan.txt", last, tbcur, tbdel, tbnew);
}


x86 assembly (clang, -O0):
<AwSensorDiscover>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xec1(%rip),%rdi
call   1030 <AwSensorFromFile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AwSensorDiscover>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xedd(%rip),%rdi
jmp    1030 <AwSensorFromFile@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"discoverpan.txt\00"
define i32 @AwSensorDiscover(i32* %0, i8** %1, i8** %2, i8** %3) {
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
store i32* %0, i32** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%9 = load i32*, i32** %5
%10 = load i8**, i8*** %6
%11 = load i8**, i8*** %7
%12 = load i8**, i8*** %8
%13 = call i32 @AwSensorFromFile(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %9, i8** %10, i8** %11, i8** %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"discoverpan.txt\00"
define i32 @AwSensorDiscover(i32* %0, i8** %1, i8** %2, i8** %3) {
%5 = tail call i32 @AwSensorFromFile(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %0, i8** %1, i8** %2, i8** %3)
ret i32 %5
}
/* Variables and functions */
int strlen(char const *);
int warts_str_size(const char *str) { return strlen(str) + 1; }


x86 assembly (clang, -O0):
<warts_str_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warts_str_size>:
push   %rax
call   1030 <strlen@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @warts_str_size(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @warts_str_size(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "manbomber-srv [-b address] [-p port]\n");
  fprintf(stderr,
          "  -b <value>\tIPv4 address to bind to. Defaults to 0.0.0.0\n");
  fprintf(stderr, "  -p <value>\tPort number bind to. Defaults to 12345\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xeed(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xf13(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef7(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf24(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"manbomber-srv [-b address] [-p port]\0A\00"
@.str.1 = [59 x i8] c" -b <value>\09IPv4 address to bind to. Defaults to 0.0.0.0\0A\00"
@.str.2 = [53 x i8] c" -p <value>\09Port number bind to. Defaults to 12345\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"manbomber-srv [-b address] [-p port]\0A\00"
@.str.1 = [59 x i8] c" -b <value>\09IPv4 address to bind to. Defaults to 0.0.0.0\0A\00"
@.str.2 = [53 x i8] c" -p <value>\09Port number bind to. Defaults to 12345\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int IFF_RUNNING;
int IFF_UP;
int set_if_flag(char *, int, int);
int if_up(char *ifname) { return set_if_flag(ifname, IFF_UP | IFF_RUNNING, 1); }


x86 assembly (clang, -O0):
<if_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
or     (%rax),%esi
mov    $0x1,%edx
call   1030 <set_if_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_up>:
mov    0x2ec9(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1,%edx
jmp    1030 <set_if_flag@plt>

LLVM IR (-O0):
@IFF_UP = global i32 0
@IFF_RUNNING = global i32 0
define i32 @if_up(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @IFF_UP
%5 = load i32, i32* @IFF_RUNNING
%6 = or i32 %4, %5
%7 = call i32 @set_if_flag(i8* %3, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
@IFF_UP = global i32 0
@IFF_RUNNING = global i32 0
define i32 @if_up(i8* %0) {
%2 = load i32, i32* @IFF_UP
%3 = load i32, i32* @IFF_RUNNING
%4 = or i32 %3, %2
%5 = tail call i32 @set_if_flag(i8* %0, i32 %4, i32 1)
ret i32 %5
}
/* Variables and functions */
int pow1(int, int);
int pow2(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int x = 3;
  int p = 1000000000;
  printf("pow1(%d, %d) == %d\n", x, p, pow1(x, p));
  printf("pow2(%d, %d) == %d\n", x, p, pow2(x, p));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x3b9aca00,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <pow1@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <pow2@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x3b9aca00,%esi
call   1050 <pow1@plt>
lea    0xeb9(%rip),%rdi
mov    $0x3,%esi
mov    $0x3b9aca00,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
mov    $0x3,%edi
mov    $0x3b9aca00,%esi
call   1030 <pow2@plt>
lea    0xea6(%rip),%rdi
mov    $0x3,%esi
mov    $0x3b9aca00,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"pow1(%d, %d) == %d\0A\00"
@.str.1 = [20 x i8] c"pow2(%d, %d) == %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 1000000000, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @pow1(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @pow2(i32 %12, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"pow1(%d, %d) == %d\0A\00"
@.str.1 = [20 x i8] c"pow2(%d, %d) == %d\0A\00"
define i32 @main() {
%1 = tail call i32 @pow1(i32 3, i32 1000000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 3, i32 1000000000, i32 %1)
%3 = tail call i32 @pow2(i32 3, i32 1000000000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 1000000000, i32 %3)
ret i32 0
}
int __attribute__((target("arch=sandybridge"))) redecl3(void) { return 2; }


x86 assembly (clang, -O0):
<redecl3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<redecl3>:
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @redecl3() {
ret i32 2
}

LLVM IR (-O2):
define i32 @redecl3() {
ret i32 2
}
int main() {
  int x = 14;
  int y = 7 - x / 2;
  return y * (28 / x + 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xe,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x7,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x1c,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    $0x2,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 14, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 2
%6 = sub nsw i32 7, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = sdiv i32 28, %8
%10 = add nsw i32 %9, 2
%11 = mul nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void main() {
  unsigned char i = 0;
  do {
    printf("%x\n", i++);
  } while (i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,-0x1(%rbp)
movzbl %al,%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
cmpb   $0x0,-0x1(%rbp)
jne    111c <main+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
lea    0xee4(%rip),%rbx
nopl   0x0(%rax)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %ebp,%esi
cmp    $0x100,%ebp
jne    1120 <main+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ %3, %1 ], [ 0, %0 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = icmp eq i32 %3, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
void foo_with_protected_visibility() {}


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

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

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

LLVM IR (-O2):
define void @foo_with_protected_visibility() {
ret void
}
/* Type definitions */
struct ottery_state {
  int dummy;
};

/* Variables and functions */
scalar_t__ ottery_st_rand_check_init(struct ottery_state *);
scalar_t__ ottery_st_rand_check_pid(struct ottery_state *);
int ottery_st_rand_lock_and_check(struct ottery_state *st) {
  if (ottery_st_rand_check_init(st))
    return -1;
  ((void)0);
  if (ottery_st_rand_check_pid(st)) {
    ((void)0);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ottery_st_rand_lock_and_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ottery_st_rand_check_init@plt>
cmp    $0x0,%rax
je     114b <ottery_st_rand_lock_and_check+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <ottery_st_rand_lock_and_check+0x51>
mov    -0x10(%rbp),%rdi
call   1040 <ottery_st_rand_check_pid@plt>
cmp    $0x0,%rax
je     116a <ottery_st_rand_lock_and_check+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <ottery_st_rand_lock_and_check+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ottery_st_rand_lock_and_check>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ottery_st_rand_check_init@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1138 <ottery_st_rand_lock_and_check+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <ottery_st_rand_check_pid@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ottery_state = type { i32 }
define i32 @ottery_st_rand_lock_and_check(%struct.ottery_state* %0) {
%2 = alloca i32
%3 = alloca %struct.ottery_state*
store %struct.ottery_state* %0, %struct.ottery_state** %3
%4 = load %struct.ottery_state*, %struct.ottery_state** %3
%5 = call i64 @ottery_st_rand_check_init(%struct.ottery_state* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %14
8: ; preds = %1
%9 = load %struct.ottery_state*, %struct.ottery_state** %3
%10 = call i64 @ottery_st_rand_check_pid(%struct.ottery_state* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.ottery_state = type { i32 }
define i32 @ottery_st_rand_lock_and_check(%struct.ottery_state* %0) {
%2 = tail call i64 @ottery_st_rand_check_init(%struct.ottery_state* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ottery_st_rand_check_pid(%struct.ottery_state* %0)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct pattern_image {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ytht_mgrep_releasepf(struct pattern_image *patt_img) {
  free((void *)patt_img);
  return 0;
}


x86 assembly (clang, -O0):
<ytht_mgrep_releasepf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ytht_mgrep_releasepf>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pattern_image = type { i32 }
define i32 @ytht_mgrep_releasepf(%struct.pattern_image* %0) {
%2 = alloca %struct.pattern_image*
store %struct.pattern_image* %0, %struct.pattern_image** %2
%3 = load %struct.pattern_image*, %struct.pattern_image** %2
%4 = bitcast %struct.pattern_image* %3 to i8*
%5 = call i32 @free(i8* %4)
ret i32 0
}

LLVM IR (-O2):
%struct.pattern_image = type { i32 }
define i32 @ytht_mgrep_releasepf(%struct.pattern_image* nocapture %0) {
%2 = bitcast %struct.pattern_image* %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
int ArgNum();
scalar_t__ GetFlag(int);
int Cnd_EqF(void) {
  int v = ArgNum();
  return (GetFlag(v) == GetFlag(ArgNum()));
}


x86 assembly (clang, -O0):
<Cnd_EqF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GetFlag@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_EqF>:
push   %rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Cnd_EqF() {
%1 = alloca i32
%2 = call i32 (...) @ArgNum()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i64 @GetFlag(i32 %3)
%5 = call i32 (...) @ArgNum()
%6 = call i64 @GetFlag(i32 %5)
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @Cnd_EqF() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i64 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = tail call i64 @GetFlag(i32 %3)
%5 = icmp eq i64 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mempool_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<mempool_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mempool_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void aesRead(uint32_t offset, uint32_t *pVal32) {
  void (*p_aesRead)(uint32_t offset, uint32_t * pVal32);
  p_aesRead = (void (*)(uint32_t offset, uint32_t * pVal32))0x030011a5U;
  p_aesRead(offset, pVal32);
}


x86 assembly (clang, -O0):
<aesRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x30011a5,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aesRead>:
mov    $0x30011a5,%eax
jmp    *%rax

LLVM IR (-O0):
define void @aesRead(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca void (i32, i32*)*
store i32 %0, i32* %3
store i32* %1, i32** %4
store void (i32, i32*)* inttoptr (i64 50336165 to void (i32, i32*)*), void (i32, i32*)** %5
%6 = load void (i32, i32*)*, void (i32, i32*)** %5
%7 = load i32, i32* %3
%8 = load i32*, i32** %4
ret void
}

LLVM IR (-O2):
define void @aesRead(i32 %0, i32* %1) {
tail call void inttoptr (i64 50336165 to void (i32, i32*)*)(i32 %0, i32* %1)
ret void
}
void OM_init() {
  extern void load_snapshot();
  load_snapshot();
}


x86 assembly (clang, -O0):
<OM_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <load_snapshot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OM_init>:
xor    %eax,%eax
jmp    1030 <load_snapshot@plt>

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

LLVM IR (-O2):
define void @OM_init() {
tail call void (...) @load_snapshot()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pledge(char *, int /*<<< orphan*/ *);
int main(void) { return !!pledge("stdio", NULL); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pledge@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <pledge@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"stdio\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @pledge(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* null)
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"stdio\00"
define i32 @main() {
%1 = tail call i32 @pledge(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int cntstc(void) { return (0); }


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

x86 assembly (clang, -O2):
<cntstc>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cntstc() {
ret i32 0
}

LLVM IR (-O2):
define i32 @cntstc() {
ret i32 0
}
void TCPInit() {}


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

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

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

LLVM IR (-O2):
define void @TCPInit() {
ret void
}
void mt_trace_sft_end(void *func) {}


x86 assembly (clang, -O0):
<mt_trace_sft_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mt_trace_sft_end(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t pcr_unsigned_diff(uint64_t x, uint64_t y) {
  return x > y ? x - y : 300ULL * (1ULL << 33) - (y - x);
}


x86 assembly (clang, -O0):
<pcr_unsigned_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    112b <pcr_unsigned_diff+0x2b>
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1144 <pcr_unsigned_diff+0x44>
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
movabs $0x25800000000,%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcr_unsigned_diff>:
mov    %rdi,%rcx
sub    %rsi,%rcx
movabs $0x25800000000,%rax
add    %rcx,%rax
sub    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @pcr_unsigned_diff(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = sub nsw i64 %9, %10
br label %17
12: ; preds = %2
%13 = load i64, i64* %4
%14 = load i64, i64* %3
%15 = sub nsw i64 %13, %14
%16 = sub i64 2576980377600, %15
br label %17
17: ; preds = %12, %8
%18 = phi i64 [ %11, %8 ], [ %16, %12 ]
ret i64 %18
}

LLVM IR (-O2):
define i64 @pcr_unsigned_diff(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = sub i64 %0, %1
%5 = add i64 %4, 2576980377600
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srandom(time(NULL));
  while (1)
    loop();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
mov    $0x0,%al
call   1040 <loop@plt>
jmp    1156 <main+0x26>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
nop
xor    %eax,%eax
call   1040 <loop@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @time(i32* null)
%7 = call i32 @srandom(i32 %6)
br label %8
8: ; preds = %2, %8
%9 = call i32 (...) @loop()
br label %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srandom(i32 %3)
br label %5
5: ; preds = %2, %5
%6 = tail call i32 (...) @loop()
br label %5
}