xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handle_keypress(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
  }
}


x86 assembly (clang, -O0):
<handle_keypress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <handle_keypress+0x2b>
jmp    1134 <handle_keypress+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_keypress>:
cmp    $0x1b,%dil
je     1117 <handle_keypress+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @handle_keypress(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @handle_keypress(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Create AMD Firmware combination\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Create AMD Firmware combination\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"Create AMD Firmware combination\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
int serial_restore() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @serial_restore() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LC_NUMERIC;
double atof(char const *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
double UTILS_atof(const char *str) {
  double val;
  setlocale(LC_NUMERIC, "C");
  val = atof(str);
  setlocale(LC_NUMERIC, "");
  return val;
}


x86 assembly (clang, -O0):
<UTILS_atof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x10(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1040 <setlocale@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTILS_atof>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
call   1040 <setlocale@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
movsd  %xmm0,(%rsp)
mov    (%r14),%edi
lea    0xead(%rip),%rsi
call   1040 <setlocale@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@LC_NUMERIC = global i32 0
@.str = [2 x i8] c"C\00"
@.str.1 = [1 x i8] zeroinitializer
define double @UTILS_atof(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i32, i32* @LC_NUMERIC
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call double @atof(i8* %6)
store double %7, double* %3
%8 = load i32, i32* @LC_NUMERIC
%9 = call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
@LC_NUMERIC = global i32 0
@.str = [2 x i8] c"C\00"
@.str.1 = [1 x i8] zeroinitializer
define double @UTILS_atof(i8* nocapture %0) {
%2 = load i32, i32* @LC_NUMERIC
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call double @atof(i8* %0)
%5 = load i32, i32* @LC_NUMERIC
%6 = tail call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret double %4
}
/* Variables and functions */
int sysfsparser_cpufreq_get_hardware_limits(unsigned int, unsigned long *,
                                            unsigned long *);
int cpufreq_get_hardware_limits(unsigned int cpu, unsigned long *min,
                                unsigned long *max) {
  return sysfsparser_cpufreq_get_hardware_limits(cpu, min, max);
}


x86 assembly (clang, -O0):
<cpufreq_get_hardware_limits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sysfsparser_cpufreq_get_hardware_limits@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpufreq_get_hardware_limits>:
jmp    1030 <sysfsparser_cpufreq_get_hardware_limits@plt>

LLVM IR (-O0):
define i32 @cpufreq_get_hardware_limits(i32 %0, i64* %1, i64* %2) {
%4 = alloca i32
%5 = alloca i64*
%6 = alloca i64*
store i32 %0, i32* %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i32, i32* %4
%8 = load i64*, i64** %5
%9 = load i64*, i64** %6
%10 = call i32 @sysfsparser_cpufreq_get_hardware_limits(i32 %7, i64* %8, i64* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @cpufreq_get_hardware_limits(i32 %0, i64* %1, i64* %2) {
%4 = tail call i32 @sysfsparser_cpufreq_get_hardware_limits(i32 %0, i64* %1, i64* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x9d() {
  Assert_real((isodigit(157) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              790, ("isodigit should be 0 for 0x9d"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x9d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9d,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x316,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x9d>:
push   %rax
mov    $0x9d,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x316,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x9d\00"
define void @t_isodigit_0x9d() {
%1 = call i64 @isodigit(i32 157)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 790, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x9d\00"
define void @t_isodigit_0x9d() {
%1 = tail call i64 @isodigit(i32 157)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 790, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_RemoteIOClient_ChannelManager_ClearAllChannels(void *);
int /*<<< orphan*/ printf(char *);
void UpnpRemoteIOClient_ChannelManager_ClearAllChannels(void *upnptoken) {
  printf("Invoke: UpnpRemoteIOClient_ChannelManager_ClearAllChannels();\r\n");
  UpnpResponse_RemoteIOClient_ChannelManager_ClearAllChannels(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpRemoteIOClient_ChannelManager_ClearAllChannels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_RemoteIOClient_ChannelManager_ClearAllChannels@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_ChannelManager_ClearAllChannels>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_RemoteIOClient_ChannelManager_ClearAllChannels@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Invoke: UpnpRemoteIOClient_ChannelManager_ClearAllChannels();\0D\0A\00"
define void @UpnpRemoteIOClient_ChannelManager_ClearAllChannels(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UpnpResponse_RemoteIOClient_ChannelManager_ClearAllChannels(i8* %4)
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"Invoke: UpnpRemoteIOClient_ChannelManager_ClearAllChannels();\0D\00"
define void @UpnpRemoteIOClient_ChannelManager_ClearAllChannels(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UpnpResponse_RemoteIOClient_ChannelManager_ClearAllChannels(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *, double);
void soundb_none_volume(double volume) {
  log_f("sound: soundb_none_volume(volume:%g)\n", (double)volume);
}


x86 assembly (clang, -O0):
<soundb_none_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <log_f@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"sound: soundb_none_volume(volume:%g)\0A\00"
define void @soundb_none_volume(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @log_f(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"sound: soundb_none_volume(volume:%g)\0A\00"
define void @soundb_none_volume(double %0) {
%2 = tail call i32 @log_f(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void refcnt_traceen_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_refcnt@%p::traceen (refcnt_traceen) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<refcnt_traceen_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<refcnt_traceen_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [78 x i8] c"Method rtpp_refcnt@%p::traceen (refcnt_traceen) is invoked after destruction\0A\00"
define void @refcnt_traceen_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [78 x i8] c"Method rtpp_refcnt@%p::traceen (refcnt_traceen) is invoked after destruction\0A\00"
define void @refcnt_traceen_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
void mergesort(void *base, size_t num, size_t size,
               int (*cmp)(const void *, const void *)) {}


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

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

LLVM IR (-O0):
define void @mergesort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
ret void
}

LLVM IR (-O2):
define void @mergesort(i8* nocapture %0, i64 %1, i64 %2, i32 (i8*, i8*)* nocapture %3) {
ret void
}
void __ccaprice_atomic_decrement(volatile int *x) {
  __asm__ __volatile__("lock   \n\t"
                       "incl %0\n\t"
                       : "=m"(*x)
                       : "m"(*x)
                       : "memory");
}


x86 assembly (clang, -O0):
<__ccaprice_atomic_decrement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
lock incl (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccaprice_atomic_decrement>:
lock incl (%rdi)
ret

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

LLVM IR (-O2):
define void @__ccaprice_atomic_decrement(i32* %0) {
tail call void asm sideeffect "lock \0A\09incl $0\0A\09", "=*m,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32* elementtype(i32) %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_SYS_GetCoreClockFreq();
uint32_t CLOCK_SYS_GetSystickFreq(void) { return CLOCK_SYS_GetCoreClockFreq(); }


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

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

LLVM IR (-O0):
define i32 @CLOCK_SYS_GetSystickFreq() {
%1 = call i32 (...) @CLOCK_SYS_GetCoreClockFreq()
ret i32 %1
}

LLVM IR (-O2):
define i32 @CLOCK_SYS_GetSystickFreq() {
%1 = tail call i32 (...) @CLOCK_SYS_GetCoreClockFreq()
ret i32 %1
}
float asinf(float x) {
  float res = 0.0F;
  asm volatile("fld	%%st\n\t"
               "fmul	%%st(0)\n\t"
               "fld1\n\t"
               "fsubp\n\t"
               "fsqrt\n\t"
               "fpatan"
               : "=t"(res)
               : "0"(x)
               : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<asinf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
flds   -0xc(%rbp)
fld    %st(0)
fmul   %st(0),%st
fld1
fsubp  %st,%st(1)
fsqrt
fpatan
fstps  -0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinf>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
fld    %st(0)
fmul   %st(0),%st
fld1
fsubp  %st,%st(1)
fsqrt
fpatan
fstps  -0x8(%rsp)
movss  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @asinf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = call float asm sideeffect "fld\09%st\0A\09fmul\09%st(0)\0A\09fld1\0A\09fsubp\0A\09fsqrt\0A\09fpatan", "={st},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(float %4)
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @asinf(float %0) {
%2 = tail call float asm sideeffect "fld\09%st\0A\09fmul\09%st(0)\0A\09fld1\0A\09fsubp\0A\09fsqrt\0A\09fpatan", "={st},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ latest_prune_join(int *, int);
void call_latest_prune_join_3_Bad() {
  int a[2];
  latest_prune_join(a, 3);
}


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

x86 assembly (clang, -O2):
<call_latest_prune_join_3_Bad>:
push   %rax
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <latest_prune_join@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @call_latest_prune_join_3_Bad() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%3 = call i32 @latest_prune_join(i32* %2, i32 3)
ret void
}

LLVM IR (-O2):
define void @call_latest_prune_join_3_Bad() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @latest_prune_join(i32* %3, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ onewire_send_byte(int);
int /*<<< orphan*/ onewire_wait_until_done();
void ds1820_cmd_convert_t(void) {
  onewire_send_byte(0x44);
  onewire_wait_until_done();
}


x86 assembly (clang, -O0):
<ds1820_cmd_convert_t>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
call   1030 <onewire_send_byte@plt>
mov    $0x0,%al
call   1040 <onewire_wait_until_done@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1820_cmd_convert_t>:
push   %rax
mov    $0x44,%edi
call   1030 <onewire_send_byte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <onewire_wait_until_done@plt>

LLVM IR (-O0):
define void @ds1820_cmd_convert_t() {
%1 = call i32 @onewire_send_byte(i32 68)
%2 = call i32 (...) @onewire_wait_until_done()
ret void
}

LLVM IR (-O2):
define void @ds1820_cmd_convert_t() {
%1 = tail call i32 @onewire_send_byte(i32 68)
%2 = tail call i32 (...) @onewire_wait_until_done()
ret void
}
/* Type definitions */
struct Cyc_Absyn_RgnEffect {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
Cyc_Absyn_is_aliasable_rgneffect(struct Cyc_Absyn_RgnEffect *);
int Cyc_IOEffect_not_aliasable(struct Cyc_Absyn_RgnEffect *r) {
  return !({ Cyc_Absyn_is_aliasable_rgneffect(r); });
}


x86 assembly (clang, -O0):
<Cyc_IOEffect_not_aliasable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Cyc_Absyn_is_aliasable_rgneffect@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Cyc_Absyn_RgnEffect = type { i32 }
define i32 @Cyc_IOEffect_not_aliasable(%struct.Cyc_Absyn_RgnEffect* %0) {
%2 = alloca %struct.Cyc_Absyn_RgnEffect*
%3 = alloca i32
store %struct.Cyc_Absyn_RgnEffect* %0, %struct.Cyc_Absyn_RgnEffect** %2
%4 = load %struct.Cyc_Absyn_RgnEffect*, %struct.Cyc_Absyn_RgnEffect** %2
%5 = call i32 @Cyc_Absyn_is_aliasable_rgneffect(%struct.Cyc_Absyn_RgnEffect* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.Cyc_Absyn_RgnEffect = type { i32 }
define i32 @Cyc_IOEffect_not_aliasable(%struct.Cyc_Absyn_RgnEffect* %0) {
%2 = tail call i32 @Cyc_Absyn_is_aliasable_rgneffect(%struct.Cyc_Absyn_RgnEffect* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_tx_power_usage(void) {
  printf("\nUsage : sys_cfg_tx_power [TX_POWER]\n");
  printf("\nIf TX_POWER is provided, a 'set' is performed, else a 'get' is "
         "performed.");
  printf("\nTX_POWER is represented in dBm.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_tx_power_usage>:
push   %rax
lea    0xf23(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xf30(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\0AUsage : sys_cfg_tx_power [TX_POWER]\0A\00"
@.str.1 = [75 x i8] c"\0AIf TX_POWER is provided, a 'set' is performed, else a 'get' is performed.\00"
@.str.2 = [34 x i8] c"\0ATX_POWER is represented in dBm.\0A\00"
define void @print_sys_cfg_tx_power_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [75 x i8] c"\0AIf TX_POWER is provided, a 'set' is performed, else a 'get' is performed.\00"
@str = [37 x i8] c"\0AUsage : sys_cfg_tx_power [TX_POWER]\00"
@str.3 = [33 x i8] c"\0ATX_POWER is represented in dBm.\00"
define void @print_sys_cfg_tx_power_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test08_head() {
  do {
    printf("test08");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test08_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test08_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test08_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test08\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test08_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test08\00"
define void @test08_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main(void) {
  printf("#include <stdio.h>\n#define S(s) %s\nS(%s)\n",
         "int main(void) { printf(\"#include <stdio.h>\\n#define S(s) "
         "%s\\nS(%s)\\n\", #s, #s); }",
         "int main(void) { printf(\"#include <stdio.h>\\n#define S(s) "
         "%s\\nS(%s)\\n\", #s, #s); }");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"#include <stdio.h>\0A#define S(s) %s\0AS(%s)\0A\00"
@.str.1 = [83 x i8] c"int main(void) { printf(\22#include <stdio.h>\\n#define S(s) %s\\nS(%s)\\n\22, #s, #s); }\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"#include <stdio.h>\0A#define S(s) %s\0AS(%s)\0A\00"
@.str.1 = [83 x i8] c"int main(void) { printf(\22#include <stdio.h>\\n#define S(s) %s\\nS(%s)\\n\22, #s, #s); }\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void fsl_info_vwrite(const char *fmt, va_list vl) { vprintf(fmt, vl); }


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

x86 assembly (clang, -O2):
<fsl_info_vwrite>:
jmp    1030 <vprintf@plt>

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

LLVM IR (-O2):
define void @fsl_info_vwrite(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void SysCtlLDODeepSleepSet(uint32_t ui32Voltage) {

  ;
  (*((volatile uint32_t *)(0x400FE1BC))) = ui32Voltage;
}


x86 assembly (clang, -O0):
<SysCtlLDODeepSleepSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x400fe1bc,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlLDODeepSleepSet>:
mov    %edi,0x400fe1bc
ret

LLVM IR (-O0):
define void @SysCtlLDODeepSleepSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1074782652 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlLDODeepSleepSet(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1074782652 to i32*)
ret void
}
long SwapBits(long x, int i, int j) {
  if (((x >> i) & 1) != ((x >> j) & 1)) {
    unsigned long bit_mask = (1L << i) | (1L << j);
    x ^= bit_mask;
  }
  return x;
}


x86 assembly (clang, -O0):
<SwapBits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    %cl,%rax
and    $0x1,%rax
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%ecx
sar    %cl,%rdx
mov    %rdx,%rcx
and    $0x1,%rcx
cmp    %rcx,%rax
je     1164 <SwapBits+0x64>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapBits>:
mov    %rdi,%rax
mov    %esi,%ecx
shr    %cl,%rax
mov    %edx,%ecx
mov    %rdi,%rdx
shr    %cl,%rdx
xor    %eax,%edx
and    $0x1,%edx
mov    $0x1,%eax
shl    %cl,%rax
neg    %rdx
bts    %rsi,%rax
and    %rdx,%rax
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @SwapBits(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = ashr i64 %8, %10
%12 = and i64 %11, 1
%13 = load i64, i64* %4
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = ashr i64 %13, %15
%17 = and i64 %16, 1
%18 = icmp ne i64 %12, %17
br i1 %18, label %19, label %30
19: ; preds = %3
%20 = load i32, i32* %5
%21 = zext i32 %20 to i64
%22 = shl i64 1, %21
%23 = load i32, i32* %6
%24 = zext i32 %23 to i64
%25 = shl i64 1, %24
%26 = or i64 %22, %25
store i64 %26, i64* %7
%27 = load i64, i64* %7
%28 = load i64, i64* %4
%29 = xor i64 %28, %27
store i64 %29, i64* %4
br label %30
30: ; preds = %19, %3
%31 = load i64, i64* %4
ret i64 %31
}

LLVM IR (-O2):
define i64 @SwapBits(i64 %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = lshr i64 %0, %4
%6 = zext i32 %2 to i64
%7 = lshr i64 %0, %6
%8 = xor i64 %7, %5
%9 = and i64 %8, 1
%10 = icmp eq i64 %9, 0
%11 = shl nuw i64 1, %4
%12 = shl nuw i64 1, %6
%13 = or i64 %12, %11
%14 = select i1 %10, i64 0, i64 %13
%15 = xor i64 %14, %0
ret i64 %15
}
/* Variables and functions */
char *mdb_strerror(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, int, char *);
int _chk(const char *where, int err) {
  if (err) {
    char s[4096];
    sprintf(s, "(%s, %d): %s", where, err, mdb_strerror(err));
    perror(s);
  }
  return err;
}


x86 assembly (clang, -O0):
<_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1030,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11a5 <_chk+0x75>
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1028(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x1020(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1014(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <mdb_strerror@plt>
mov    -0x1028(%rbp),%rdi
mov    -0x1020(%rbp),%rdx
mov    -0x1014(%rbp),%ecx
mov    %rax,%r8
lea    0xe6c(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x1010(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x1030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_chk>:
push   %r15
push   %r14
push   %rbx
sub    $0x1000,%rsp
mov    %esi,%ebx
test   %esi,%esi
jne    1151 <_chk+0x21>
mov    %ebx,%eax
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rdi,%r14
mov    %ebx,%edi
call   1030 <mdb_strerror@plt>
lea    0xe9e(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %rax,%r8
call   1050 <sprintf@plt>
mov    %r15,%rdi
call   1040 <perror@plt>
jmp    1142 <_chk+0x12>

LLVM IR (-O0):
@.str = [13 x i8] c"(%s, %d): %s\00"
define i32 @_chk(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [4096 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = call i8* @mdb_strerror(i32 %12)
%14 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %13)
%15 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%16 = call i32 @perror(i8* %15)
br label %17
17: ; preds = %8, %2
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [13 x i8] c"(%s, %d): %s\00"
define i32 @_chk(i8* %0, i32 returned %1) {
%3 = alloca [4096 x i8]
%4 = icmp eq i32 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%7 = tail call i8* @mdb_strerror(i32 %1)
%8 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %7)
%9 = call i32 @perror(i8* %6)
br label %10
10: ; preds = %5, %2
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_recursive_option() { fprintf(stderr, " -r - do it recursively\n"); }


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

x86 assembly (clang, -O2):
<print_recursive_option>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c" -r - do it recursively\0A\00"
define void @print_recursive_option() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c" -r - do it recursively\0A\00"
define void @print_recursive_option() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void color_reset() { fprintf(stdout, "%s", "\033[0m"); }


x86 assembly (clang, -O0):
<color_reset>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xed8(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_reset>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xedc(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @color_reset() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @color_reset() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void RFCClockEnable(void) {
  (*((volatile unsigned long *)(0x60040000 + 0x00000000))) =
      0x00000004 | 0x00000002 | 0x00000001;
}


x86 assembly (clang, -O0):
<RFCClockEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x60040000,%eax
movq   $0x7,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RFCClockEnable>:
movq   $0x7,0x60040000
ret

LLVM IR (-O0):
define void @RFCClockEnable() {
store volatile i64 7, i64* inttoptr (i64 1610874880 to i64*)
ret void
}

LLVM IR (-O2):
define void @RFCClockEnable() {
store volatile i64 7, i64* inttoptr (i64 1610874880 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage\n");
  printf("\txway-admin [-l]    	 : listing current xway IP\n");
  printf("\txway-admin [-a] \"IP\" : adding IP address to xway enable list\n");
  printf(
      "\txway-admin [-d] \"IP\" : deleting IP address from xway enable list\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xf38(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Usage\0A\00"
@.str.1 = [49 x i8] c"\09xway-admin [-l] \09 : listing current xway IP\0A\00"
@.str.2 = [63 x i8] c"\09xway-admin [-a] \22IP\22 : adding IP address to xway enable list\0A\00"
@.str.3 = [67 x i8] c"\09xway-admin [-d] \22IP\22 : deleting IP address from xway enable list\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"Usage\00"
@str.4 = [48 x i8] c"\09xway-admin [-l] \09 : listing current xway IP\00"
@str.5 = [62 x i8] c"\09xway-admin [-a] \22IP\22 : adding IP address to xway enable list\00"
@str.6 = [66 x i8] c"\09xway-admin [-d] \22IP\22 : deleting IP address from xway enable list\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
double GetTimeR49();
double gettimer() { return GetTimeR49(); }


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

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

LLVM IR (-O0):
define double @gettimer() {
%1 = call double (...) @GetTimeR49()
ret double %1
}

LLVM IR (-O2):
define double @gettimer() {
%1 = tail call double (...) @GetTimeR49()
ret double %1
}
/* Variables and functions */
char *strdup(char *);
int /*<<< orphan*/ strlcpy(char *, char *, int);
char *left(char *input, int length) {
  char result[length + 1];
  strlcpy(result, input, length + 1);
  return strdup(result);
}


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <strlcpy@plt>
mov    -0x28(%rbp),%rdi
call   1040 <strdup@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rax
lea    0x1(%rsi),%edx
mov    %rsp,%rbx
lea    0xf(%rdx),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strlcpy@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @left(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %5
%11 = alloca i8, i64 %9
store i64 %9, i64* %6
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = call i32 @strlcpy(i8* %11, i8* %12, i32 %14)
%16 = call i8* @strdup(i8* %11)
%17 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @left(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @strlcpy(i8* %5, i8* %0, i32 %3)
%7 = call i8* @strdup(i8* %5)
ret i8* %7
}
int get_buffer_size(int *sbuff) {
  int i = 0;
  int counter = 0;
  for (i = 0; i < 5; ++i) {
    if (sbuff[i] != 0x00) {
      counter++;
    }
  }
  return counter;
}


x86 assembly (clang, -O0):
<get_buffer_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1155 <get_buffer_size+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1142 <get_buffer_size+0x42>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <get_buffer_size+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <get_buffer_size+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_buffer_size>:
movdqu (%rdi),%xmm0
pxor   %xmm1,%xmm1
pcmpeqd %xmm0,%xmm1
movmskps %xmm1,%eax
xor    $0xf,%eax
mov    %eax,%ecx
shr    %cl
and    $0x5,%cl
sub    %cl,%al
mov    %eax,%ecx
and    $0x33,%cl
shr    $0x2,%al
and    $0x33,%al
add    %cl,%al
mov    %eax,%ecx
shr    $0x4,%cl
add    %al,%cl
and    $0xf,%cl
movzbl %cl,%eax
cmpl   $0x1,0x10(%rdi)
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @get_buffer_size(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = icmp ne <4 x i32> %3, zeroinitializer
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = bitcast <4 x i1> %4 to i4
%10 = call i4 @llvm.ctpop.i4(i4 %9)
%11 = zext i4 %10 to i32
%12 = add nuw nsw i32 %11, %8
ret i32 %12
}
void RTSemEventMultiWaitEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventMultiWaitEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%p\n", "this %is maomachong!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [21 x i8] c"this %is maomachong!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [21 x i8] c"this %is maomachong!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void DisplayUsage(char *prog) {
  printf("Usage: %s <PGM image file> <sigma> <variance threshold>\n", prog);
}


x86 assembly (clang, -O0):
<DisplayUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplayUsage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"Usage: %s <PGM image file> <sigma> <variance threshold>\0A\00"
define void @DisplayUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"Usage: %s <PGM image file> <sigma> <variance threshold>\0A\00"
define void @DisplayUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
float bmp180_pressure(void *);
int pow(float, int);
float bmp180_altitude(void *_bmp) {
  float p, alt;
  p = bmp180_pressure(_bmp);
  alt = 44330 * (1 - pow(((p / 100) / 1013.25), 1 / 5.255));
  return alt;
}


x86 assembly (clang, -O0):
<bmp180_altitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bmp180_pressure@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xec1(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
imul   $0xad2a,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmp180_altitude>:
push   %rax
call   1040 <bmp180_pressure@plt>
divss  0xed2(%rip),%xmm0
divss  0xece(%rip),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
imul   $0xad2a,%ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @bmp180_altitude(i8* %0) {
%2 = alloca i8*
%3 = alloca float
%4 = alloca float
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call float @bmp180_pressure(i8* %5)
store float %6, float* %3
%7 = load float, float* %3
%8 = fdiv float %7, 1.000000e+02
%9 = fpext float %8 to double
%10 = fdiv double %9, 1.013250e+03
%11 = fptrunc double %10 to float
%12 = call i32 @pow(float %11, i32 0)
%13 = sub nsw i32 1, %12
%14 = mul nsw i32 44330, %13
%15 = sitofp i32 %14 to float
store float %15, float* %4
%16 = load float, float* %4
ret float %16
}

LLVM IR (-O2):
define float @bmp180_altitude(i8* %0) {
%2 = tail call float @bmp180_pressure(i8* %0)
%3 = fdiv float %2, 1.000000e+02
%4 = fdiv float %3, 1.013250e+03
%5 = tail call i32 @pow(float %4, i32 0)
%6 = sub nsw i32 1, %5
%7 = mul nsw i32 %6, 44330
%8 = sitofp i32 %7 to float
ret float %8
}
/* Variables and functions */
int Compare_Float(double, double, int);
int test_zscale(double z_scale) { return Compare_Float(z_scale, 1.0, 1e-5); }


x86 assembly (clang, -O0):
<test_zscale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
xor    %edi,%edi
call   1030 <Compare_Float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_zscale>:
movsd  0xee8(%rip),%xmm1
xor    %edi,%edi
jmp    1030 <Compare_Float@plt>

LLVM IR (-O0):
define i32 @test_zscale(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @Compare_Float(double %3, double 1.000000e+00, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_zscale(double %0) {
%2 = tail call i32 @Compare_Float(double %0, double 1.000000e+00, i32 0)
ret i32 %2
}
void pathcon_nm8_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm8_decref() {
ret void
}
/* Variables and functions */
void *sqr_init() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @sqr_init() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sqr_init() {
ret i8* null
}