xunge/DecIR huggingface dataset:
void gtk_statusbar_get_has_resize_grip() {}


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

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

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

LLVM IR (-O2):
define void @gtk_statusbar_get_has_resize_grip() {
ret void
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double gettime(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec + ts.tv_nsec * 1e-9;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @gettime() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-09, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timespec = type { double, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @gettime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e-09, double %6)
ret double %10
}
int heap_leftIndex(int index) { return (2 * index) + 1; }


x86 assembly (clang, -O0):
<heap_leftIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_leftIndex>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @heap_leftIndex(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_port(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<close_port>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_port(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ end_startup(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int);
void logexit(int status, void *ptr) {
  end_startup(0);
  syslog(LOG_NOTICE, "exiting status %d", status);
}


x86 assembly (clang, -O0):
<logexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <end_startup@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1040 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logexit>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <end_startup@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <syslog@plt>

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [18 x i8] c"exiting status %d\00"
define void @logexit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @end_startup(i32 0)
%6 = load i32, i32* @LOG_NOTICE
%7 = load i32, i32* %3
%8 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [18 x i8] c"exiting status %d\00"
define void @logexit(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @end_startup(i32 0)
%4 = load i32, i32* @LOG_NOTICE
%5 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int f(int);
int main(void) {
  int a;
  return f(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 undef)
ret i32 %1
}
unsigned int bit_revert(unsigned int v) {
  int i;
  unsigned int lsb, n = 0;
  for (i = 0; i < sizeof(unsigned int) * 8; i++) {
    lsb = v & 1;
    v >>= 1;
    n <<= 1;
    n |= lsb;
  }
  return n;
}


x86 assembly (clang, -O0):
<bit_revert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x20,%rax
jae    1155 <bit_revert+0x55>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <bit_revert+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_revert>:
xor    %eax,%eax
mov    $0x20,%r8d
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x2,%edx
mov    %edi,%esi
shr    $0x2,%esi
mov    %edi,%ecx
and    $0x1,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rax,8),%eax
or     %edx,%eax
and    $0x1,%esi
or     %eax,%esi
mov    %edi,%eax
shr    $0x3,%eax
and    $0x1,%eax
shr    $0x4,%edi
lea    (%rax,%rsi,2),%eax
add    $0xfffffffc,%r8d
jne    1110 <bit_revert+0x10>
ret

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

LLVM IR (-O2):
define i32 @bit_revert(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %19, %2 ]
%4 = phi i32 [ %0, %1 ], [ %17, %2 ]
%5 = phi i32 [ 0, %1 ], [ %20, %2 ]
%6 = and i32 %4, 2
%7 = lshr i32 %4, 2
%8 = shl i32 %3, 3
%9 = shl i32 %4, 2
%10 = and i32 %9, 4
%11 = or i32 %8, %10
%12 = or i32 %11, %6
%13 = and i32 %7, 1
%14 = lshr i32 %4, 3
%15 = or i32 %12, %13
%16 = and i32 %14, 1
%17 = lshr i32 %4, 4
%18 = shl i32 %15, 1
%19 = or i32 %18, %16
%20 = add nuw nsw i32 %5, 4
%21 = icmp eq i32 %20, 32
br i1 %21, label %22, label %2
22: ; preds = %2
ret i32 %19
}
void HplCC2430InterruptsC__InterruptCCA__default__fired(void) {}


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

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

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

LLVM IR (-O2):
define void @HplCC2430InterruptsC__InterruptCCA__default__fired() {
ret void
}
int ff() { return 3; }


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

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

LLVM IR (-O0):
define i32 @ff() {
ret i32 3
}

LLVM IR (-O2):
define i32 @ff() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ giterr_set_oom();
char *strdup(char const *);
char *git__strdup(const char *str) {
  char *ptr = strdup(str);
  if (!ptr)
    giterr_set_oom();
  return ptr;
}


x86 assembly (clang, -O0):
<git__strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <git__strdup+0x2b>
mov    $0x0,%al
call   1030 <giterr_set_oom@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<git__strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <git__strdup+0x15>
xor    %eax,%eax
call   1030 <giterr_set_oom@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @git__strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @giterr_set_oom()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @git__strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @giterr_set_oom()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void ADCChannelEnable(unsigned long ulBase, unsigned long ulChannel) {
  unsigned long ulCh;
  ulCh = (ulChannel == 0x00000000)   ? 0x02
         : (ulChannel == 0x00000008) ? 0x04
         : (ulChannel == 0x00000010) ? 0x08
                                     : 0x10;
  (*((volatile unsigned long *)(ulBase + 0x000000B8))) |= ulCh;
}


x86 assembly (clang, -O0):
<ADCChannelEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <ADCChannelEnable+0x24>
mov    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    115a <ADCChannelEnable+0x5a>
cmpq   $0x8,-0x10(%rbp)
jne    113c <ADCChannelEnable+0x3c>
mov    $0x4,%eax
mov    %eax,-0x20(%rbp)
jmp    1154 <ADCChannelEnable+0x54>
mov    -0x10(%rbp),%rdx
mov    $0x10,%eax
mov    $0x8,%ecx
cmp    $0x10,%rdx
cmove  %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0xb8(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0xb8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCChannelEnable>:
test   %rsi,%rsi
je     1118 <ADCChannelEnable+0x18>
cmp    $0x8,%rsi
jne    1125 <ADCChannelEnable+0x25>
mov    $0x4,%eax
or     %rax,0xb8(%rdi)
ret
mov    $0x2,%eax
or     %rax,0xb8(%rdi)
ret
xor    %eax,%eax
cmp    $0x10,%rsi
setne  %al
lea    0x8(,%rax,8),%rax
or     %rax,0xb8(%rdi)
ret

LLVM IR (-O0):
define void @ADCChannelEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %20
9: ; preds = %2
%10 = load i64, i64* %4
%11 = icmp eq i64 %10, 8
br i1 %11, label %12, label %13
12: ; preds = %9
br label %18
13: ; preds = %9
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, 16
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 8, i32 16
br label %18
18: ; preds = %13, %12
%19 = phi i32 [ 4, %12 ], [ %17, %13 ]
br label %20
20: ; preds = %18, %8
%21 = phi i32 [ 2, %8 ], [ %19, %18 ]
%22 = sext i32 %21 to i64
store i64 %22, i64* %5
%23 = load i64, i64* %5
%24 = load i64, i64* %3
%25 = add i64 %24, 184
%26 = inttoptr i64 %25 to i64*
%27 = load volatile i64, i64* %26
%28 = or i64 %27, %23
store volatile i64 %28, i64* %26
ret void
}

LLVM IR (-O2):
define void @ADCChannelEnable(i64 %0, i64 %1) {
switch i64 %1, label %3 [
i64 0, label %7
i64 8, label %6
]
3: ; preds = %2
%4 = icmp eq i64 %1, 16
%5 = select i1 %4, i64 8, i64 16
br label %7
6: ; preds = %2
br label %7
7: ; preds = %2, %6, %3
%8 = phi i64 [ 2, %2 ], [ %5, %3 ], [ 4, %6 ]
%9 = add i64 %0, 184
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, %8
store volatile i64 %12, i64* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RB_AUTOBOOT;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ reboot(int /*<<< orphan*/);
int /*<<< orphan*/ sync();
int main(int argc, const char *argv[]) {
  sync();
  reboot(RB_AUTOBOOT);
  _exit(errno);
}


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    $0x0,%al
call   1040 <sync@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <reboot@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <sync@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <reboot@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@RB_AUTOBOOT = global i32 0
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @sync()
%7 = load i32, i32* @RB_AUTOBOOT
%8 = call i32 @reboot(i32 %7)
%9 = load i32, i32* @errno
%10 = call i32 @_exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@RB_AUTOBOOT = global i32 0
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sync()
%4 = load i32, i32* @RB_AUTOBOOT
%5 = tail call i32 @reboot(i32 %4)
%6 = load i32, i32* @errno
%7 = tail call i32 @_exit(i32 %6)
unreachable
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int g = gcd(12, 2);
  printf("Gcd : %d\n", g);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
mov    $0x2,%esi
call   1040 <gcd@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Gcd : %d\0A\00"
define i32 @main() {
%1 = tail call i32 @gcd(i32 12, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
char *util_strsav(char const *);
char *util_tilde_expand(char const *fname) { return util_strsav(fname); }


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

x86 assembly (clang, -O2):
<util_tilde_expand>:
jmp    1030 <util_strsav@plt>

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

LLVM IR (-O2):
define i8* @util_tilde_expand(i8* %0) {
%2 = tail call i8* @util_strsav(i8* %0)
ret i8* %2
}
void shift_keyset(struct heavyhit *h) {}


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

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

LLVM IR (-O0):
%struct.heavyhit = type opaque
define void @shift_keyset(%struct.heavyhit* %0) {
%2 = alloca %struct.heavyhit*
store %struct.heavyhit* %0, %struct.heavyhit** %2
ret void
}

LLVM IR (-O2):
%struct.heavyhit = type opaque
define void @shift_keyset(%struct.heavyhit* nocapture %0) {
ret void
}
/* Type definitions */
struct msg_queue {
  int dummy;
};

/* Variables and functions */
int itc_wr_msgqueue(int, struct msg_queue *, int, int);
int itc_writeto(int dst, struct msg_queue *q, int prio) {
  return itc_wr_msgqueue(dst, q, prio, 1);
}


x86 assembly (clang, -O0):
<itc_writeto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <itc_wr_msgqueue@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itc_writeto>:
mov    $0x1,%ecx
jmp    1030 <itc_wr_msgqueue@plt>

LLVM IR (-O0):
%struct.msg_queue = type { i32 }
define i32 @itc_writeto(i32 %0, %struct.msg_queue* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msg_queue*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.msg_queue* %1, %struct.msg_queue** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.msg_queue*, %struct.msg_queue** %5
%9 = load i32, i32* %6
%10 = call i32 @itc_wr_msgqueue(i32 %7, %struct.msg_queue* %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.msg_queue = type { i32 }
define i32 @itc_writeto(i32 %0, %struct.msg_queue* %1, i32 %2) {
%4 = tail call i32 @itc_wr_msgqueue(i32 %0, %struct.msg_queue* %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int dev_init_device(char *);
int dev_init_mouse(char *dev_name, int x, int y) {
  return dev_init_device(dev_name);
}


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

x86 assembly (clang, -O2):
<dev_init_mouse>:
jmp    1030 <dev_init_device@plt>

LLVM IR (-O0):
define i32 @dev_init_mouse(i8* %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 = call i32 @dev_init_device(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @dev_init_mouse(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @dev_init_device(i8* %0)
ret i32 %4
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t rotl64(const uint64_t w, const unsigned c) {
  return (w << c) | (w >> (64 - c));
}


x86 assembly (clang, -O0):
<rotl64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl64>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 64, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl64(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 64, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
int stat(char *, struct stat *);
int check_initialized(void) {
  struct stat s;
  int ret_code = stat(".beargit", &s);
  return !(ret_code == -1 || !(S_ISDIR(s.st_mode)));
}


x86 assembly (clang, -O0):
<check_initialized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0xffffffff,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     115d <check_initialized+0x3d>
mov    -0x8(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_initialized>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1148 <check_initialized+0x28>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [9 x i8] c".beargit\00"
define i32 @check_initialized() {
%1 = alloca %struct.stat
%2 = alloca i32
%3 = call i32 @stat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %0
%7 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %6, %0
%13 = phi i1 [ true, %0 ], [ %11, %6 ]
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [9 x i8] c".beargit\00"
define i32 @check_initialized() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %11, label %5
5: ; preds = %0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @S_ISDIR(i32 %7)
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %0
%12 = phi i32 [ 0, %0 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
void *cs2qkcb();
void *cs2qkcb_(void) { return cs2qkcb(); }


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

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

LLVM IR (-O0):
define i8* @cs2qkcb_() {
%1 = call i8* (...) @cs2qkcb()
ret i8* %1
}

LLVM IR (-O2):
define i8* @cs2qkcb_() {
%1 = tail call i8* (...) @cs2qkcb()
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ thrd_t;

/* Variables and functions */
int /*<<< orphan*/ thd_get_current();
thrd_t thrd_current(void) { return thd_get_current(); }


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

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

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

LLVM IR (-O2):
define i32 @thrd_current() {
%1 = tail call i32 (...) @thd_get_current()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ GetKey(int *);
int /*<<< orphan*/ puts(char *);
void WaitKey(void) {
  puts("Press any key to continue");
  int key;
  GetKey(&key);
}


x86 assembly (clang, -O0):
<WaitKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    -0x4(%rbp),%rdi
call   1040 <GetKey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitKey>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rdi
call   1040 <GetKey@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Press any key to continue\00"
define void @WaitKey() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @GetKey(i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Press any key to continue\00"
define void @WaitKey() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @GetKey(i32* %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ send_ec_command(int);
int send_ec_data(int);
int ec_ext_write(uint16_t addr, uint8_t data) {
  send_ec_command(0x81);
  send_ec_data(0x02);
  send_ec_data(addr & 0xff);
  send_ec_command(0xf1);
  send_ec_data(addr >> 8);
  return send_ec_data(data);
}


x86 assembly (clang, -O0):
<ec_ext_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x81,%edi
call   1030 <send_ec_command@plt>
mov    $0x2,%edi
call   1040 <send_ec_data@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1040 <send_ec_data@plt>
mov    $0xf1,%edi
call   1030 <send_ec_command@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
call   1040 <send_ec_data@plt>
mov    -0x8(%rbp),%edi
call   1040 <send_ec_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_ext_write>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x81,%edi
call   1030 <send_ec_command@plt>
mov    $0x2,%edi
call   1040 <send_ec_data@plt>
movzbl %bpl,%edi
call   1040 <send_ec_data@plt>
mov    $0xf1,%edi
call   1030 <send_ec_command@plt>
sar    $0x8,%ebp
mov    %ebp,%edi
call   1040 <send_ec_data@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send_ec_data@plt>

LLVM IR (-O0):
define i32 @ec_ext_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @send_ec_command(i32 129)
%6 = call i32 @send_ec_data(i32 2)
%7 = load i32, i32* %3
%8 = and i32 %7, 255
%9 = call i32 @send_ec_data(i32 %8)
%10 = call i32 @send_ec_command(i32 241)
%11 = load i32, i32* %3
%12 = ashr i32 %11, 8
%13 = call i32 @send_ec_data(i32 %12)
%14 = load i32, i32* %4
%15 = call i32 @send_ec_data(i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @ec_ext_write(i32 %0, i32 %1) {
%3 = tail call i32 @send_ec_command(i32 129)
%4 = tail call i32 @send_ec_data(i32 2)
%5 = and i32 %0, 255
%6 = tail call i32 @send_ec_data(i32 %5)
%7 = tail call i32 @send_ec_command(i32 241)
%8 = ashr i32 %0, 8
%9 = tail call i32 @send_ec_data(i32 %8)
%10 = tail call i32 @send_ec_data(i32 %1)
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ szbuf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char);
char *strdup(char *);
char *toy_chrdup(char c) {
  char szbuf[16] = {0};
  snprintf(szbuf, sizeof(szbuf) - 1, "%c", c);
  char *p = strdup(szbuf);
  return p;
}


x86 assembly (clang, -O0):
<toy_chrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
mov    $0xf,%esi
lea    0xea2(%rip),%rdx
movsbl -0x1(%rbp),%ecx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toy_chrdup>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ecx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0xecb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i8* @toy_chrdup(i8 signext %0) {
%2 = alloca i8
%3 = alloca [16 x i8]
%4 = alloca i8*
store i8 %0, i8* %2
%5 = bitcast [16 x i8]* %3 to i8*
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%7 = load i8, i8* %2
%8 = call i32 @snprintf(i8* %6, i32 15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define noalias i8* @toy_chrdup(i8 signext %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  fprintf(stderr, "timelimit exceeded\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"timelimit exceeded\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"timelimit exceeded\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long double log10(double);
long double log10l(long double x) { return log10((double)x); }


x86 assembly (clang, -O0):
<log10l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <log10@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10l>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <log10@plt>

LLVM IR (-O0):
define x86_fp80 @log10l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @log10(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @log10l(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @log10(double %2)
ret x86_fp80 %3
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ calc_tree(struct tree *);
double fmod(int /*<<< orphan*/, int /*<<< orphan*/);
double op_mod(struct tree *left, struct tree *right) {
  return fmod(calc_tree(left), calc_tree(right));
}


x86 assembly (clang, -O0):
<op_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <calc_tree@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <calc_tree@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <fmod@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_mod>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <calc_tree@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <calc_tree@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fmod@plt>

LLVM IR (-O0):
%struct.tree = type { i32 }
define double @op_mod(%struct.tree* %0, %struct.tree* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.tree*
store %struct.tree* %0, %struct.tree** %3
store %struct.tree* %1, %struct.tree** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = call i32 @calc_tree(%struct.tree* %5)
%7 = load %struct.tree*, %struct.tree** %4
%8 = call i32 @calc_tree(%struct.tree* %7)
%9 = call double @fmod(i32 %6, i32 %8)
ret double %9
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define double @op_mod(%struct.tree* %0, %struct.tree* %1) {
%3 = tail call i32 @calc_tree(%struct.tree* %0)
%4 = tail call i32 @calc_tree(%struct.tree* %1)
%5 = tail call double @fmod(i32 %3, i32 %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printLetters(char *);
void printArgs(int argc, char *argv[]) {
  int i = 0;
  for (i = 0; i < argc; i++) {
    printLetters(argv[i]);
  }
}


x86 assembly (clang, -O0):
<printArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <printArgs+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <printLetters@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <printArgs+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @printArgs(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %4
%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 = call i32 @printLetters(i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @printArgs(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printLetters(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void evil(int *x, int *y, int *z) {
  (*x)++;
  *z = *y;
}


x86 assembly (clang, -O0):
<evil>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<evil>:
addl   $0x1,(%rdi)
mov    (%rsi),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @evil(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @evil(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 1
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %2
ret void
}
int function_a(void) { int x; }


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

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

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

LLVM IR (-O2):
define i32 @function_a() {
ret i32 undef
}
/* Variables and functions */
char *malloc(size_t);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strdup(const char *s) {
  char *ns = NULL;
  size_t len = strlen(s) + 1;
  ns = malloc(len);
  if (ns)
    strncpy(ns, s, len);
  return ns;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117f <strdup+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
scalar_t__ __system_properties_init2();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int init_resetprop() {
  if (__system_properties_init2()) {
    {
      ;
      fprintf(stderr, "resetprop: Initialize error\n");
    };
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<init_resetprop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__system_properties_init2@plt>
cmp    $0x0,%rax
je     115a <init_resetprop+0x3a>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <init_resetprop+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_resetprop>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <__system_properties_init2@plt>
test   %rax,%rax
je     1149 <init_resetprop+0x29>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"resetprop: Initialize error\0A\00"
define i32 @init_resetprop() {
%1 = alloca i32
%2 = call i64 (...) @__system_properties_init2()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"resetprop: Initialize error\0A\00"
define i32 @init_resetprop() {
%1 = tail call i64 (...) @__system_properties_init2()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %7
}
unsigned int f(unsigned char byte) { return byte << 25; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x19,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
shl    $0x19,%eax
ret

LLVM IR (-O0):
define i32 @f(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 25
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl i32 %2, 25
ret i32 %3
}
void d2i_GENERAL_NAME(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_GENERAL_NAME() {
ret void
}
short int check_limits(int num, int left, int right) {
  if (num < left || num > right)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_limits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1125 <check_limits+0x25>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1130 <check_limits+0x30>
movw   $0x0,-0x2(%rbp)
jmp    1136 <check_limits+0x36>
movw   $0x1,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_limits>:
cmp    %esi,%edi
setge  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define signext i16 @check_limits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i16
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %15, label %11
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11, %3
store i16 0, i16* %4
br label %17
16: ; preds = %11
store i16 1, i16* %4
br label %17
17: ; preds = %16, %15
%18 = load i16, i16* %4
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @check_limits(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %1
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i16
ret i16 %7
}
/* Variables and functions */
int Lambert3DCubeToBall(double *, double *);
int cu2ho(double *cu, double *ho, int p) {
  int trash;
  double epsijk;
  epsijk = (double)p;
  trash = Lambert3DCubeToBall(cu, ho);
  return 1;
}


x86 assembly (clang, -O0):
<cu2ho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Lambert3DCubeToBall@plt>
mov    %eax,-0x18(%rbp)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cu2ho(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = sitofp i32 %9 to double
store double %10, double* %8
%11 = load double*, double** %4
%12 = load double*, double** %5
%13 = call i32 @Lambert3DCubeToBall(double* %11, double* %12)
store i32 %13, i32* %7
ret i32 1
}

LLVM IR (-O2):
define i32 @cu2ho(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @Lambert3DCubeToBall(double* %0, double* %1)
ret i32 1
}
/* Variables and functions */
int __builtin_mips_cabs_nge_d(double, double);
int test13(double a, double b) { return __builtin_mips_cabs_nge_d(a, b); }


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

x86 assembly (clang, -O2):
<test13>:
jmp    1030 <__builtin_mips_cabs_nge_d@plt>

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

LLVM IR (-O2):
define i32 @test13(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_nge_d(double %0, double %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ADCComparatorReset(uint32_t ui32Base, uint32_t ui32Comp, bool bTrigger,
                        bool bInterrupt) {
  uint32_t ui32Temp;
  ;
  ;
  ui32Temp = 0;
  if (bTrigger) {
    ui32Temp |= (1 << (16 + ui32Comp));
  }
  if (bInterrupt) {
    ui32Temp |= (1 << ui32Comp);
  }
  (*((volatile uint32_t *)(ui32Base + 0x00000D00))) = ui32Temp;
}


x86 assembly (clang, -O0):
<ADCComparatorReset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1134 <ADCComparatorReset+0x34>
mov    -0x8(%rbp),%ecx
add    $0x10,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     114e <ADCComparatorReset+0x4e>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xd00,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCComparatorReset>:
mov    %ecx,%r8d
lea    0x10(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
test   %edx,%edx
cmove  %edx,%eax
mov    $0x1,%edx
mov    %esi,%ecx
shl    %cl,%edx
test   %r8d,%r8d
cmove  %r8d,%edx
or     %eax,%edx
movslq %edi,%rax
mov    %edx,0xd00(%rax)
ret

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

LLVM IR (-O2):
define void @ADCComparatorReset(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, 0
%6 = add nsw i32 %1, 16
%7 = shl nuw i32 1, %6
%8 = select i1 %5, i32 0, i32 %7
%9 = icmp eq i32 %3, 0
%10 = shl nuw i32 1, %1
%11 = select i1 %9, i32 0, i32 %10
%12 = or i32 %11, %8
%13 = add nsw i32 %0, 3328
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %12, i32* %15
ret void
}