xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void aspetta(void) {
  printf("... premi un tasto\n");
  (void)getchar();
}


x86 assembly (clang, -O0):
<aspetta>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"... premi un tasto\0A\00"
define void @aspetta() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"... premi un tasto\00"
define void @aspetta() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
void capturing2capturingNon_rv_endCapturing() {}


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

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

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

LLVM IR (-O2):
define void @capturing2capturingNon_rv_endCapturing() {
ret void
}
void SteamAPI_ISteamGameServer_SetKeyValue(void *self, const char *pKey,
                                           const char *pValue) {
  xlogf("%s(self = %p, pKey = %s, pValue = %s)\n", __func__, self, pKey,
        pValue);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamGameServer_SetKeyValue>:
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee0(%rip),%rdi
lea    0xf00(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"%s(self = %p, pKey = %s, pValue = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetKeyValue = [38 x i8] c"SteamAPI_ISteamGameServer_SetKeyValue\00"
define void @SteamAPI_ISteamGameServer_SetKeyValue(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamGameServer_SetKeyValue, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"%s(self = %p, pKey = %s, pValue = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetKeyValue = [38 x i8] c"SteamAPI_ISteamGameServer_SetKeyValue\00"
define void @SteamAPI_ISteamGameServer_SetKeyValue(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamGameServer_SetKeyValue, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_EqualsVec2_init(void) {
  _hmt_register_covercase("HMM_EqualsVec2", "1");
}


x86 assembly (clang, -O0):
<_hmt_covercase_HMM_EqualsVec2_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
call   1030 <_hmt_register_covercase@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_EqualsVec2_init>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"HMM_EqualsVec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_EqualsVec2_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"HMM_EqualsVec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_EqualsVec2_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_setup();
int /*<<< orphan*/ input_setup();
int /*<<< orphan*/ output_setup();
void io_setup() {
  default_setup();
  input_setup();
  output_setup();
}


x86 assembly (clang, -O0):
<io_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <default_setup@plt>
mov    $0x0,%al
call   1040 <input_setup@plt>
mov    $0x0,%al
call   1050 <output_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_setup>:
push   %rax
xor    %eax,%eax
call   1030 <default_setup@plt>
xor    %eax,%eax
call   1040 <input_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <output_setup@plt>

LLVM IR (-O0):
define void @io_setup() {
%1 = call i32 (...) @default_setup()
%2 = call i32 (...) @input_setup()
%3 = call i32 (...) @output_setup()
ret void
}

LLVM IR (-O2):
define void @io_setup() {
%1 = tail call i32 (...) @default_setup()
%2 = tail call i32 (...) @input_setup()
%3 = tail call i32 (...) @output_setup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testA(int a, float b, float c) { printf("testA int\n"); }


x86 assembly (clang, -O0):
<testA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testA>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"testA int\0A\00"
define void @testA(i32 %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
store float %2, float* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"testA int\00"
define void @testA(i32 %0, float %1, float %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
void fa105(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;
  ({
    p02A:
      goto p02A;
      goto a;
    a:
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


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

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

LLVM IR (-O0):
define void @fa105() {
%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 = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
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 @fa105() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("Hello from %s!\n", argv[1]);
  return 0;
}


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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rsi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Hello from %s!\0A\00"
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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello from %s!\0A\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 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef double uint64_t;

/* Variables and functions */
double sfmt_to_res53(uint64_t v) { return v * (1.0 / 18446744073709551616.0); }


x86 assembly (clang, -O0):
<sfmt_to_res53>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfmt_to_res53>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sfmt_to_res53(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3BF0000000000000
ret double %4
}

LLVM IR (-O2):
define double @sfmt_to_res53(double %0) {
%2 = fmul double %0, 0x3BF0000000000000
ret double %2
}
int smb347_set_fast_charge(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @smb347_set_fast_charge() {
ret i32 0
}
/* Variables and functions */
unsigned long long be64toh(unsigned long long const);
unsigned long long change_endian64(const unsigned long long *d) {
  return be64toh(*d);
}


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

x86 assembly (clang, -O2):
<change_endian64>:
mov    (%rdi),%rdi
jmp    1030 <be64toh@plt>

LLVM IR (-O0):
define i64 @change_endian64(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i64 @be64toh(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @change_endian64(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i64 @be64toh(i64 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ TCFLSH;
int _ioctl(int, int /*<<< orphan*/, int *);
int _tcflush(int fd, int queue_selector) {
  return (_ioctl(fd, TCFLSH, &queue_selector));
}


x86 assembly (clang, -O0):
<_tcflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <_ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tcflush>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <_ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@TCFLSH = global i32 0
define i32 @_tcflush(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* @TCFLSH
%7 = call i32 @_ioctl(i32 %5, i32 %6, i32* %4)
ret i32 %7
}

LLVM IR (-O2):
@TCFLSH = global i32 0
define i32 @_tcflush(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @TCFLSH
%5 = call i32 @_ioctl(i32 %0, i32 %4, i32* %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void clear_memory(uint32_t *dst, int words) {
  while (words--) {
    *dst++ = 0;
  }
}


x86 assembly (clang, -O0):
<clear_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1139 <clear_memory+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x0,(%rax)
jmp    110b <clear_memory+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_memory>:
test   %esi,%esi
je     1126 <clear_memory+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear_memory(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
char *propt(c)
int c;
{
  static char buf[8];
  sprintf(buf, "-%s", prchar(c));
  return (buf);
}


x86 assembly (clang, -O0):
<propt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <prchar@plt>
mov    %eax,%edx
lea    0x2ef3(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    0x2ede(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<propt>:
push   %rbx
xor    %eax,%eax
call   1030 <prchar@plt>
lea    0x2f02(%rip),%rbx
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@propt.buf = internal global [8 x i8] zeroinitializer
@.str = [4 x i8] c"-%s\00"
define i8* @propt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @prchar to i32 (i32, ...)*)(i32 %3)
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @propt.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @propt.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@propt.buf = internal global [8 x i8] zeroinitializer
@.str = [4 x i8] c"-%s\00"
define i8* @propt(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @prchar to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @propt.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @propt.buf, i64 0, i64 0)
}
int do_283() { return 283; }


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

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

LLVM IR (-O0):
define i32 @do_283() {
ret i32 283
}

LLVM IR (-O2):
define i32 @do_283() {
ret i32 283
}
int hexval(char c) {
  return (c >= '0' && c <= '9') ? (c - '0') : (10 + c - 'A');
}


x86 assembly (clang, -O0):
<hexval>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <hexval+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <hexval+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <hexval+0x40>
movsbl -0x1(%rbp),%eax
add    $0xa,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexval>:
lea    -0x30(%rdi),%ecx
lea    -0x37(%rdi),%edx
lea    -0x30(%rdi),%eax
cmp    $0xa,%cl
cmovae %edx,%eax
ret

LLVM IR (-O0):
define i32 @hexval(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
br label %19
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = add nsw i32 10, %16
%18 = sub nsw i32 %17, 65
br label %19
19: ; preds = %14, %10
%20 = phi i32 [ %13, %10 ], [ %18, %14 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @hexval(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = select i1 %4, i32 -48, i32 -55
%6 = add nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void MyApiFun2() { printf("this is MyApiFun2()\n"); }


x86 assembly (clang, -O0):
<MyApiFun2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyApiFun2>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"this is MyApiFun2()\0A\00"
define void @MyApiFun2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"this is MyApiFun2()\00"
define void @MyApiFun2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_matrix(void **matrix, int n) {
  int i;
  for (i = 0; i < n; i++) {
    free(matrix[i]);
  }
  free(matrix);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_matrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_matrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_matrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = bitcast i8** %8 to i8***
%10 = load i8**, i8*** %9
%11 = tail call i32 @free(i8** %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float num;
  scanf("%f", &num);
  printf("%f", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Type definitions */
typedef int off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
off_t zeropad(off_t numbytes, FILE *file) {
  if (numbytes <= 0)
    return 0;
  if (numbytes > 1)
    fseek(file, numbytes - 1, SEEK_CUR);
  fputc(0, file);
  return numbytes;
}


x86 assembly (clang, -O0):
<zeropad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1145 <zeropad+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1178 <zeropad+0x58>
cmpl   $0x1,-0x8(%rbp)
jle    1167 <zeropad+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeropad>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1152 <zeropad+0x32>
mov    %rsi,%r14
mov    %edi,%ebx
cmp    $0x1,%edi
je     1146 <zeropad+0x26>
lea    -0x1(%rbx),%esi
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
call   1040 <fseek@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
jmp    1154 <zeropad+0x34>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define i32 @zeropad(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %22
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32*, i32** %5
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* @SEEK_CUR
%17 = call i32 @fseek(i32* %13, i32 %15, i32 %16)
br label %18
18: ; preds = %12, %9
%19 = load i32*, i32** %5
%20 = call i32 @fputc(i32 0, i32* %19)
%21 = load i32, i32* %4
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define i32 @zeropad(i32 %0, i32* nocapture %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, 1
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = add nsw i32 %0, -1
%8 = load i32, i32* @SEEK_CUR
%9 = tail call i32 @fseek(i32* %1, i32 %7, i32 %8)
br label %10
10: ; preds = %6, %4
%11 = tail call i32 @fputc(i32 0, i32* %1)
br label %12
12: ; preds = %2, %10
%13 = phi i32 [ %0, %10 ], [ 0, %2 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
void main() {
  char *ptr = (char *)malloc(32);
  printf("hello, world!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20,%edi
call   1040 <malloc@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define void @main() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 32)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @main() {
%1 = tail call i64 @malloc(i32 32)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void test_assert_fail(void) { exit(1); }


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

x86 assembly (clang, -O2):
<test_assert_fail>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @test_assert_fail() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @test_assert_fail() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int fun1280() { return 1280; }


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

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

LLVM IR (-O0):
define i32 @fun1280() {
ret i32 1280
}

LLVM IR (-O2):
define i32 @fun1280() {
ret i32 1280
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *strdup(char *);
char *wfd2str(int wfd) {
  char buf[128];
  snprintf(buf, 128, "%d", wfd);
  return strdup(buf);
}


x86 assembly (clang, -O0):
<wfd2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x80,%esi
lea    0xebc(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfd2str>:
push   %rbx
sub    $0x80,%rsp
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @wfd2str(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i8* @strdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @wfd2str(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, unsigned int);
void __check(const char *msg, bool cond, const char *file, unsigned line) {
  if (cond) {
    printf("\033[32;1m[PASS]\033[0m %-40s\t(%s:%i)\n", msg, file, line);
  } else {
    printf("\033[31;1m[FAIL]\033[0m %-40s\t(%s:%i)\n", msg, file, line);
  }
}


x86 assembly (clang, -O0):
<__check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <__check+0x3c>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    1163 <__check+0x53>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__check>:
mov    %rdi,%rax
test   %esi,%esi
lea    0xf05(%rip),%rsi
lea    0xedd(%rip),%rdi
cmove  %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\1B[32;1m[PASS]\1B[0m %-40s\09(%s:%i)\0A\00"
@.str.1 = [33 x i8] c"\1B[31;1m[FAIL]\1B[0m %-40s\09(%s:%i)\0A\00"
define void @__check(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i32 %14)
br label %21
16: ; preds = %4
%17 = load i8*, i8** %5
%18 = load i8*, i8** %7
%19 = load i32, i32* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %18, i32 %19)
br label %21
21: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"\1B[32;1m[PASS]\1B[0m %-40s\09(%s:%i)\0A\00"
@.str.1 = [33 x i8] c"\1B[31;1m[FAIL]\1B[0m %-40s\09(%s:%i)\0A\00"
define void @__check(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, i8* %0, i8* %2, i32 %3)
ret void
}
/* Type definitions */
struct ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vdso_has_getcpu();
void getcpu_notes(struct ctx *ctx) {
  if (!vdso_has_getcpu())
    printf("Note: vDSO version of getcpu not found\n");
}


x86 assembly (clang, -O0):
<getcpu_notes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <vdso_has_getcpu@plt>
cmp    $0x0,%eax
jne    1148 <getcpu_notes+0x28>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcpu_notes>:
push   %rax
xor    %eax,%eax
call   1040 <vdso_has_getcpu@plt>
test   %eax,%eax
je     112e <getcpu_notes+0xe>
pop    %rax
ret
lea    0xecb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.ctx = type { i32 }
@.str = [40 x i8] c"Note: vDSO version of getcpu not found\0A\00"
define void @getcpu_notes(%struct.ctx* %0) {
%2 = alloca %struct.ctx*
store %struct.ctx* %0, %struct.ctx** %2
%3 = call i32 (...) @vdso_has_getcpu()
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.ctx = type { i32 }
@str = [39 x i8] c"Note: vDSO version of getcpu not found\00"
define void @getcpu_notes(%struct.ctx* nocapture readnone %0) {
%2 = tail call i32 (...) @vdso_has_getcpu()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(const char *cmd, int rc) {
  fprintf(rc ? stderr : stdout, "Usage: %s <image1> <image2>\n", cmd);
  exit(rc);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114a <usage+0x2a>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <usage+0x36>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
test   %esi,%esi
jne    1133 <usage+0x13>
mov    0x2ea7(%rip),%rax
jmp    113a <usage+0x1a>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [29 x i8] c"Usage: %s <image1> <image2>\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* @stderr
br label %11
9: ; preds = %2
%10 = load i32, i32* @stdout
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %4
%16 = call i32 @exit(i32 %15)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [29 x i8] c"Usage: %s <image1> <image2>\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @stdout
%6 = select i1 %3, i32 %5, i32 %4
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Intmm(int);
int main() {
  int i;
  for (i = 0; i < 2; i++)
    Intmm(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <Intmm@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   %rax
xor    %edi,%edi
call   1030 <Intmm@plt>
mov    $0x1,%edi
call   1030 <Intmm@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Intmm(i32 0)
%2 = tail call i32 @Intmm(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(char, int);
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ nvme_verify_chr(int);
int nvme_subsystem_reset(int fd) {
  nvme_verify_chr(fd);
  return ioctl(fd, _IO('N', 0x45));
}


x86 assembly (clang, -O0):
<nvme_subsystem_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <nvme_verify_chr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x4e,%edi
mov    $0x45,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvme_subsystem_reset>:
push   %rbx
mov    %edi,%ebx
call   1050 <nvme_verify_chr@plt>
mov    $0x4e,%edi
mov    $0x45,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @nvme_subsystem_reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @nvme_verify_chr(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @_IO(i8 signext 78, i32 69)
%7 = call i32 @ioctl(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @nvme_subsystem_reset(i32 %0) {
%2 = tail call i32 @nvme_verify_chr(i32 %0)
%3 = tail call i32 @_IO(i8 signext 78, i32 69)
%4 = tail call i32 @ioctl(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, char *, double *, double *);
int main() {
  double salary, value, TOTAL;
  char name;
  scanf("%s %lf %lf", &name, &salary, &value);
  TOTAL = salary + value * .15;
  printf("TOTAL = R$ %.2lf\n", TOTAL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x21(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xea7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
lea    0x7(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xeb3(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s %lf %lf\00"
@.str.1 = [18 x i8] c"TOTAL = R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i8
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5, double* %2, double* %3)
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double %8, double 1.500000e-01, double %7)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s %lf %lf\00"
@.str.1 = [18 x i8] c"TOTAL = R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca i8
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, double* %1, double* %2)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = call double @llvm.fmuladd.f64(double %8, double 1.500000e-01, double %7)
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_max_slots_changed_get_lmp_max_slots(const uint8_t *event) {
  return event[4];
}


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

x86 assembly (clang, -O2):
<hci_event_max_slots_changed_get_lmp_max_slots>:
mov    0x10(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hci_event_max_slots_changed_get_lmp_max_slots(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int adb_condition(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int adb_exists(const char *path) {
  char buf[2048] = {0};
  sprintf(buf, "-e %s", path);
  return adb_condition(buf);
}


x86 assembly (clang, -O0):
<adb_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1030 <memset@plt>
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x810(%rbp),%rdi
call   1040 <adb_condition@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adb_exists>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x800,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xeaa(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1040 <adb_condition@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"-e %s\00"
define i32 @adb_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca [2048 x i8]
store i8* %0, i8** %2
%4 = bitcast [2048 x i8]* %3 to i8*
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%9 = call i32 @adb_condition(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"-e %s\00"
define i32 @adb_exists(i8* %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @adb_condition(i8* %3)
ret i32 %5
}
int test_imm_B5int16_reg(short val) {
  return ((val) & (-0xB5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B5int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff4b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B5int16_reg>:
test   $0xff4b,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B5int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -181
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_B5int16_reg(i16 signext %0) {
%2 = and i16 %0, -181
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void end_task_section() { write("json-task.json", "]\n", NULL); }


x86 assembly (clang, -O0):
<end_task_section>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_task_section>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"]\0A\00"
define void @end_task_section() {
%1 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"]\0A\00"
define void @end_task_section() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
int init(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @init() {
ret i32 1
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ECHILD;
int /*<<< orphan*/ errno;
pid_t wait(int *status) {
  errno = ECHILD;
  return -1;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ECHILD = global i32 0
@errno = global i32 0
define i32 @wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ECHILD
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ECHILD = global i32 0
@errno = global i32 0
define i32 @wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @ECHILD
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ EVP_DigestUpdate(void *, unsigned char const *, size_t);
void evpmd_update(void *aux, void *hash, const unsigned char *buf, size_t sz) {
  EVP_DigestUpdate(hash, buf, sz);
}


x86 assembly (clang, -O0):
<evpmd_update>:
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    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <EVP_DigestUpdate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evpmd_update>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <EVP_DigestUpdate@plt>

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

LLVM IR (-O2):
define void @evpmd_update(i8* nocapture readnone %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @EVP_DigestUpdate(i8* %1, i8* %2, i64 %3)
ret void
}
/* Variables and functions */
void int_pointer_set(void *const restrict data, size_t const ix,
                     void *const restrict x) {
  ((int **)data)[ix] = (int *)x;
}


x86 assembly (clang, -O0):
<int_pointer_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_pointer_set>:
mov    %rdx,(%rdi,%rsi,8)
ret

LLVM IR (-O0):
define void @int_pointer_set(i8* noalias %0, i64 %1, i8* noalias %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = bitcast i8* %7 to i32*
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32**
%11 = load i64, i64* %5
%12 = getelementptr inbounds i32*, i32** %10, i64 %11
store i32* %8, i32** %12
ret void
}

LLVM IR (-O2):
define void @int_pointer_set(i8* noalias nocapture writeonly %0, i64 %1, i8* noalias %2) {
%4 = bitcast i8* %0 to i32**
%5 = getelementptr inbounds i32*, i32** %4, i64 %1
%6 = bitcast i32** %5 to i8**
store i8* %2, i8** %6
ret void
}
/* Variables and functions */
bool is_kernel_cpu64(void) {
  bool ret = false;
  return ret;
}


x86 assembly (clang, -O0):
<is_kernel_cpu64>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_kernel_cpu64() {
ret i32 0
}