xunge/DecIR huggingface dataset:
unsigned short back_to_cylsec(unsigned short sec, unsigned short cyl) {
  return ((sec & 0x3F) || ((cyl & 0x300) >> 2) || ((cyl & 0xFF) << 8));
}


x86 assembly (clang, -O0):
<back_to_cylsec>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%ecx
and    $0x3f,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1157 <back_to_cylsec+0x57>
movzwl -0x4(%rbp),%ecx
and    $0x300,%ecx
sar    $0x2,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1157 <back_to_cylsec+0x57>
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_to_cylsec>:
mov    $0x1,%ax
test   $0x3f,%dil
je     110b <back_to_cylsec+0xb>
ret
movzwl %si,%ecx
test   $0x300,%ecx
jne    110a <back_to_cylsec+0xa>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

LLVM IR (-O0):
define zeroext i16 @back_to_cylsec(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = and i32 %6, 63
%8 = icmp ne i32 %7, 0
br i1 %8, label %21, label %9
9: ; preds = %2
%10 = load i16, i16* %4
%11 = zext i16 %10 to i32
%12 = and i32 %11, 768
%13 = ashr i32 %12, 2
%14 = icmp ne i32 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %9
%16 = load i16, i16* %4
%17 = zext i16 %16 to i32
%18 = and i32 %17, 255
%19 = shl i32 %18, 8
%20 = icmp ne i32 %19, 0
br label %21
21: ; preds = %15, %9, %2
%22 = phi i1 [ true, %9 ], [ true, %2 ], [ %20, %15 ]
%23 = zext i1 %22 to i32
%24 = trunc i32 %23 to i16
ret i16 %24
}

LLVM IR (-O2):
define zeroext i16 @back_to_cylsec(i16 zeroext %0, i16 zeroext %1) {
%3 = and i16 %0, 63
%4 = icmp eq i16 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = zext i16 %1 to i32
%7 = and i32 %6, 768
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = and i32 %6, 255
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i16
br label %13
13: ; preds = %9, %5, %2
%14 = phi i16 [ 1, %5 ], [ 1, %2 ], [ %12, %9 ]
ret i16 %14
}
void spram_config(void) {}


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

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

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

LLVM IR (-O2):
define void @spram_config() {
ret void
}
long _fast_ftol(double x) { return (long)x; }


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

x86 assembly (clang, -O2):
<_fast_ftol>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @_fast_ftol(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @_fast_ftol(double %0) {
%2 = fptosi double %0 to i64
ret i64 %2
}
void separa_data(int dt, int *d, int *m, int *a) {
  *d = dt / 1000000;
  *m = (dt / 10000) % 100;
  *a = dt % 10000;
}


x86 assembly (clang, -O0):
<separa_data>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<separa_data>:
movslq %edi,%r8
imul   $0x431bde83,%r8,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x32,%rdi
add    %eax,%edi
mov    %edi,(%rsi)
imul   $0x68db8bad,%r8,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x2c,%rax
add    %esi,%eax
cltq
imul   $0x51eb851f,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x25,%rsi
add    %edi,%esi
imul   $0x64,%esi,%esi
imul   $0x2710,%eax,%edi
sub    %esi,%eax
mov    %eax,(%rdx)
sub    %edi,%r8d
mov    %r8d,(%rcx)
ret

LLVM IR (-O0):
define void @separa_data(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = sdiv i32 %9, 1000000
%11 = load i32*, i32** %6
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = sdiv i32 %12, 10000
%14 = srem i32 %13, 100
%15 = load i32*, i32** %7
store i32 %14, i32* %15
%16 = load i32, i32* %5
%17 = srem i32 %16, 10000
%18 = load i32*, i32** %8
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @separa_data(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = sdiv i32 %0, 1000000
store i32 %5, i32* %1
%6 = sdiv i32 %0, 10000
%7 = srem i32 %6, 100
store i32 %7, i32* %2
%8 = srem i32 %0, 10000
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ stderr;
void xfree(void *p) {
  if (!p)
    fprintf(stderr, "trying to free a null pointer");
  free(p);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <xfree+0x2c>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    113e <xfree+0x1e>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"trying to free a null pointer\00"
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"trying to free a null pointer\00"
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int ejtag_switch(int, int /*<<< orphan*/);
int mips_ejtag_checkstatus() { return ejtag_switch(0x3000, 0); }


x86 assembly (clang, -O0):
<mips_ejtag_checkstatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3000,%edi
xor    %esi,%esi
call   1030 <ejtag_switch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mips_ejtag_checkstatus>:
mov    $0x3000,%edi
xor    %esi,%esi
jmp    1030 <ejtag_switch@plt>

LLVM IR (-O0):
define i32 @mips_ejtag_checkstatus() {
%1 = call i32 @ejtag_switch(i32 12288, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mips_ejtag_checkstatus() {
%1 = tail call i32 @ejtag_switch(i32 12288, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void avl_free(void *block, void *param) {
  (void)param;
  free(block);
}


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

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

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

LLVM IR (-O2):
define void @avl_free(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_interfacekit();
int main(int argc, char *argv[]) {
  test_interfacekit();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_interfacekit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_interfacekit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void frw_sleepMs(int ms) { usleep(1000 * ms); }


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

x86 assembly (clang, -O2):
<frw_sleepMs>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @frw_sleepMs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1000, %3
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @frw_sleepMs(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
void _swift_slowDealloc(void) {}


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

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

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

LLVM IR (-O2):
define void @_swift_slowDealloc() {
ret void
}
/* Variables and functions */
int wait();
int sys_wait(void) { return wait(); }


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

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

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

LLVM IR (-O2):
define i32 @sys_wait() {
%1 = tail call i32 (...) @wait()
ret i32 %1
}
int qcd_select_list(int a, int b, int c) {
  if (a > b) {
    if (a > c)
      return (a);
    else
      return (c);
  }
  if (b > c)
    return (b);
  else
    return (c);
}


x86 assembly (clang, -O0):
<qcd_select_list>:
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
jle    113b <qcd_select_list+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1130 <qcd_select_list+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <qcd_select_list+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <qcd_select_list+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1152 <qcd_select_list+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <qcd_select_list+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qcd_select_list>:
mov    %edx,%eax
cmp    %edx,%edi
cmovg  %edi,%eax
cmp    %esi,%eax
cmovle %esi,%eax
ret

LLVM IR (-O0):
define i32 @qcd_select_list(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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 sgt i32 %8, %9
br i1 %10, label %11, label %19
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 %17
15: ; preds = %11
%16 = load i32, i32* %5
store i32 %16, i32* %4
br label %27
17: ; preds = %11
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %27
19: ; preds = %3
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i32, i32* %6
store i32 %24, i32* %4
br label %27
25: ; preds = %19
%26 = load i32, i32* %7
store i32 %26, i32* %4
br label %27
27: ; preds = %25, %23, %17, %15
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @qcd_select_list(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
void ssusb_sysfs_exit(struct musb *musb) {}


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

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

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

LLVM IR (-O2):
%struct.musb = type opaque
define void @ssusb_sysfs_exit(%struct.musb* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func2();
void func3(int i) {
  func2();
  return;
}


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

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

LLVM IR (-O0):
define void @func3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @func2()
ret void
}

LLVM IR (-O2):
define void @func3(i32 %0) {
%2 = tail call i32 (...) @func2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncasecmp(char *, char const *, int /*<<< orphan*/);
int line_starts_with(char *line, const char *prefix) {
  return strncasecmp(line, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<line_starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @line_starts_with(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncasecmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @line_starts_with(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncasecmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(int /*<<< orphan*/, unsigned char);
void print_emerg_char(unsigned char byte) { __console_tx_char(0, byte); }


x86 assembly (clang, -O0):
<print_emerg_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_emerg_char>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_emerg_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i32 0, i8 zeroext %0)
ret void
}
/* Variables and functions */
char *getenv(char *);
char *zhome() { return (getenv("HOME")); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
define i8* @zhome() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
define i8* @zhome() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
float max(double, double);
float appr_pow(float t) { return max(0.0, 8.0 * t - 7.0); }


x86 assembly (clang, -O0):
<appr_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
call   1030 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appr_pow>:
cvtss2sd %xmm0,%xmm1
mulsd  0xee4(%rip),%xmm1
addsd  0xee4(%rip),%xmm1
xorps  %xmm0,%xmm0
jmp    1030 <max@plt>

LLVM IR (-O0):
define float @appr_pow(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double 8.000000e+00, double %4, double -7.000000e+00)
%6 = call float @max(double 0.000000e+00, double %5)
ret float %6
}

LLVM IR (-O2):
define float @appr_pow(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 8.000000e+00, double -7.000000e+00)
%4 = tail call float @max(double 0.000000e+00, double %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ io_hlt();
int /*<<< orphan*/ write_mem8(int, int);
void HariMain(void) {
  int i;
  for (i = 0xa0000; i <= 0xaffff; i++) {
    write_mem8(i, 15);
  }
  for (;;) {
    io_hlt();
  }
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa0000,-0x4(%rbp)
cmpl   $0xaffff,-0x4(%rbp)
jg     1157 <HariMain+0x37>
mov    -0x4(%rbp),%edi
mov    $0xf,%esi
call   1040 <write_mem8@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <HariMain+0xf>
jmp    115c <HariMain+0x3c>
mov    $0x0,%al
call   1030 <io_hlt@plt>
jmp    115c <HariMain+0x3c>

x86 assembly (clang, -O2):
<HariMain>:
push   %rbx
mov    $0xa0000,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0xf,%esi
call   1040 <write_mem8@plt>
add    $0x1,%ebx
cmp    $0xb0000,%ebx
jne    1130 <HariMain+0x10>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <io_hlt@plt>
jmp    1150 <HariMain+0x30>

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

LLVM IR (-O2):
define void @HariMain() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 655360, %0 ], [ %4, %1 ]
%3 = tail call i32 @write_mem8(i32 %2, i32 15)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 720896
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = tail call i32 (...) @io_hlt()
br label %6
}
/* Variables and functions */
int read_mosaic_ntiles(char const *);
int read_mosaic_ntiles_(const char *mosaic_file) {
  return read_mosaic_ntiles(mosaic_file);
}


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

x86 assembly (clang, -O2):
<read_mosaic_ntiles_>:
jmp    1030 <read_mosaic_ntiles@plt>

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

LLVM IR (-O2):
define i32 @read_mosaic_ntiles_(i8* %0) {
%2 = tail call i32 @read_mosaic_ntiles(i8* %0)
ret i32 %2
}
/* Variables and functions */
int __gtsf2(float, float);
int _COM_CMPGTf(float a, float b) { return __gtsf2(a, b) == 1; }


x86 assembly (clang, -O0):
<_COM_CMPGTf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__gtsf2@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_COM_CMPGTf>:
push   %rax
call   1030 <__gtsf2@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_COM_CMPGTf(float %0, float %1) {
%3 = tail call i32 @__gtsf2(float %0, float %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ output_string(char *);
gen_def_storage() { output_string("\t.space\t"); }


x86 assembly (clang, -O0):
<gen_def_storage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <output_string@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"\09.space\09\00"
define i32 @gen_def_storage() {
%1 = alloca i32
%2 = call i32 @output_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [9 x i8] c"\09.space\09\00"
define i32 @gen_def_storage() {
%1 = tail call i32 @output_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_solve_dobldobl_start_system(int k, int *mv) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(466, &k, mv, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_solve_dobldobl_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1d2,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_solve_dobldobl_start_system>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1d2,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_solve_dobldobl_start_system(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 466, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @celcon_solve_dobldobl_start_system(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 466, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
/* Variables and functions */
unsigned long long carried_add_jnc(unsigned long long, unsigned long long *,
                                   unsigned long long *, unsigned long long *);
int /*<<< orphan*/ printf(char *, unsigned long long, unsigned long long);
int main() {
  unsigned long long carry = 0;
  unsigned long long res = 0;
  unsigned long long a1 = 0xFFFFFFFFFFFFFFFF;
  unsigned long long a2 = 0x1;
  carry = carried_add_jnc(carry, &res, &a1, &a2);
  printf("%llX : %llX\n", carry, res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
movq   $0x1,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <carried_add_jnc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,(%rsp)
movq   $0xffffffffffffffff,0x10(%rsp)
ff ff
movq   $0x1,0x8(%rsp)
mov    %rsp,%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %edi,%edi
call   1040 <carried_add_jnc@plt>
mov    (%rsp),%rdx
lea    0xea3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%llX : %llX\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%5 = bitcast i64* %2 to i8*
store i64 -1, i64* %2
%6 = bitcast i64* %3 to i8*
store i64 1, i64* %3
%7 = call i64 @carried_add_jnc(i64 0, i64* %1, i64* %2, i64* %3)
%8 = load i64, i64* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %8)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
wchar_t *(wcschr)(const wchar_t *string, wchar_t c) {
  for (;;)
    if (*string == c)
      return string;
    else if (!*string++)
      return NULL;
}


x86 assembly (clang, -O0):
<wcschr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    112a <wcschr+0x2a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <wcschr+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,(%rax)
jne    1150 <wcschr+0x50>
movq   $0x0,-0x8(%rbp)
jmp    115a <wcschr+0x5a>
jmp    1155 <wcschr+0x55>
jmp    110c <wcschr+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcschr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rax),%rcx
cmp    %rsi,%rcx
je     1123 <wcschr+0x23>
add    $0x8,%rax
test   %rcx,%rcx
jne    1110 <wcschr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @wcschr(i64* %0, i64 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i64* [ %0, %2 ], [ %8, %7 ]
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, %1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i64, i64* %4, i64 1
%9 = icmp eq i64 %5, 0
br i1 %9, label %10, label %3
10: ; preds = %7, %3
%11 = phi i64* [ %4, %3 ], [ null, %7 ]
ret i64* %11
}
int test_imm_58int16_reg(short val) {
  return ((val) & (0x58 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_58int16_reg>:
test   $0x58,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_58int16_reg(i16 signext %0) {
%2 = and i16 %0, 88
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int goodq(unsigned char ch) {
  int q = ch - 128 - 32;
  if (q >= 16 && q <= 87)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<goodq>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
sub    $0x80,%eax
sub    $0x20,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jl     1139 <goodq+0x39>
cmpl   $0x57,-0xc(%rbp)
jg     1139 <goodq+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1140 <goodq+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<goodq>:
add    $0x50,%dil
xor    %eax,%eax
cmp    $0x48,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @goodq(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = sub nsw i32 %6, 128
%8 = sub nsw i32 %7, 32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 16
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp sle i32 %12, 87
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 1, i32* %2
br label %16
15: ; preds = %11, %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @goodq(i8 zeroext %0) {
%2 = add i8 %0, 80
%3 = icmp ult i8 %2, 72
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void instructions(void) {
  printf("Enter choice:\n"
         "1 to push a value on the stack\n"
         "2 to pop a value off the stack\n"
         "3 to end the program \n");
}


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

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

LLVM IR (-O0):
@.str = [99 x i8] c"Enter choice:\0A1 to push a value on the stack\0A2 to pop a value off the stack\0A3 to end the program \0A\00"
define void @instructions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [98 x i8] c"Enter choice:\0A1 to push a value on the stack\0A2 to pop a value off the stack\0A3 to end the program \00"
define void @instructions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int main(void) { foo(5, 6); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i32 5, i32 6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5, i32 6)
ret i32 0
}
/* Variables and functions */
unsigned char *hmac_sha256(unsigned char *, unsigned char const *, size_t,
                           unsigned char const *, size_t);
unsigned char *mac_hmac_sha256(unsigned char *out, const unsigned char *key,
                               size_t key_len, const unsigned char *msg,
                               size_t msg_len) {
  return hmac_sha256(out, key, key_len, msg, msg_len);
}


x86 assembly (clang, -O0):
<mac_hmac_sha256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <hmac_sha256@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_hmac_sha256>:
jmp    1030 <hmac_sha256@plt>

LLVM IR (-O0):
define i8* @mac_hmac_sha256(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i8* @hmac_sha256(i8* %11, i8* %12, i64 %13, i8* %14, i64 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @mac_hmac_sha256(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_sha256(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
void pd_tx_init(void) {}


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

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

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

LLVM IR (-O2):
define void @pd_tx_init() {
ret void
}
/* Variables and functions */
int tuner_get_rssi(void *, int *);
int bbm_com_tuner_get_rssi(void *handle, int *rssi) {
  int res = 0;
  res = tuner_get_rssi(handle, rssi);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_tuner_get_rssi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <tuner_get_rssi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_tuner_get_rssi>:
jmp    1030 <tuner_get_rssi@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_tuner_get_rssi(i8* %0, i32* %1) {
%3 = tail call i32 @tuner_get_rssi(i8* %0, i32* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;

/* Variables and functions */
void configurenotify(XEvent *e) {}


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

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

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

LLVM IR (-O2):
define void @configurenotify(i32* nocapture %0) {
ret void
}
unsigned addval_485(unsigned x) { return x + 3677929867U; }


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

x86 assembly (clang, -O2):
<addval_485>:
lea    -0x24c73e75(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_485(i32 %0) {
%2 = add i32 %0, -617037429
ret i32 %2
}
int FLOOR_LOG2(int x) {
  int result = 0;
  while (x > 1) {
    result++;
    x >>= 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<FLOOR_LOG2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    112f <FLOOR_LOG2+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <FLOOR_LOG2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLOOR_LOG2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <FLOOR_LOG2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <FLOOR_LOG2+0x10>
ret

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

LLVM IR (-O2):
define i32 @FLOOR_LOG2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
char const *_default_auth_timestamp() { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @_default_auth_timestamp() {
ret i8* null
}
/* Variables and functions */
float sqrtf(float);
float __ocl_sqrt_float(float src) { return sqrtf(src); }


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

x86 assembly (clang, -O2):
<__ocl_sqrt_float>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <__ocl_sqrt_float+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @__ocl_sqrt_float(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ log_fatal_err(char *);
void log_enomem() { log_fatal_err("malloc failed\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"malloc failed\0A\00"
define void @log_enomem() {
%1 = call i32 @log_fatal_err(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"malloc failed\0A\00"
define void @log_enomem() {
%1 = tail call i32 @log_fatal_err(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int /*<<< orphan*/ switchStdout();
void handler1(int signo) {
  printf("switching stdout\n");
  switchStdout();
  signal(SIGUSR1, handler1);
}


x86 assembly (clang, -O0):
<handler1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <switchStdout@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    0x2e82(%rip),%rsi
call   1050 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler1>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <switchStdout@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2e8c(%rip),%rsi
pop    %rax
jmp    1050 <signal@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"switching stdout\0A\00"
@SIGUSR1 = global i32 0
define void @handler1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @switchStdout()
%5 = load i32, i32* @SIGUSR1
%6 = call i32 @signal(i32 %5, void (i32)* @handler1)
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@str = [17 x i8] c"switching stdout\00"
define void @handler1(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @switchStdout()
%4 = load i32, i32* @SIGUSR1
%5 = tail call i32 @signal(i32 %4, void (i32)* @handler1)
ret void
}
/* Type definitions */
struct gc_arena {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gc_free(struct gc_arena *);
void gc_reset(struct gc_arena *a) { gc_free(a); }


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

x86 assembly (clang, -O2):
<gc_reset>:
jmp    1030 <gc_free@plt>

LLVM IR (-O0):
%struct.gc_arena = type { i32 }
define void @gc_reset(%struct.gc_arena* %0) {
%2 = alloca %struct.gc_arena*
store %struct.gc_arena* %0, %struct.gc_arena** %2
%3 = load %struct.gc_arena*, %struct.gc_arena** %2
%4 = call i32 @gc_free(%struct.gc_arena* %3)
ret void
}

LLVM IR (-O2):
%struct.gc_arena = type { i32 }
define void @gc_reset(%struct.gc_arena* %0) {
%2 = tail call i32 @gc_free(%struct.gc_arena* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bdp_sub_check();
int /*<<< orphan*/ sub_interrupt();
void sub_idle_vsync() {
  sub_interrupt();
  bdp_sub_check();
}


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

x86 assembly (clang, -O2):
<sub_idle_vsync>:
push   %rax
xor    %eax,%eax
call   1040 <sub_interrupt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bdp_sub_check@plt>

LLVM IR (-O0):
define void @sub_idle_vsync() {
%1 = call i32 (...) @sub_interrupt()
%2 = call i32 (...) @bdp_sub_check()
ret void
}

LLVM IR (-O2):
define void @sub_idle_vsync() {
%1 = tail call i32 (...) @sub_interrupt()
%2 = tail call i32 (...) @bdp_sub_check()
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
void error(char *msg) {
  printf("errno=%d\n", errno);
  perror(msg);
  exit(0);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"errno=%d\0A\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @errno
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8*, i8** %2
%6 = call i32 @perror(i8* %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"errno=%d\0A\00"
@errno = global i32 0
define void @error(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @perror(i8* %0)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ isalpha(unsigned char);
int whatch(unsigned char ch) {
  if (isalpha(ch))
    return 1;
  if (ch > 128 + 32 && ch <= 128 + 32 + 94)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<whatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     113d <whatch+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    116e <whatch+0x5e>
movzbl -0x5(%rbp),%eax
cmp    $0xa0,%eax
jle    1167 <whatch+0x57>
movzbl -0x5(%rbp),%eax
cmp    $0xfe,%eax
jg     1167 <whatch+0x57>
movl   $0x2,-0x4(%rbp)
jmp    116e <whatch+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whatch>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
lea    0x5f(%rbx),%ecx
xor    %edx,%edx
cmp    $0x5e,%cl
setb   %dl
add    %edx,%edx
test   %rax,%rax
mov    $0x1,%eax
cmove  %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @whatch(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalpha(i8 zeroext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %18
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp sgt i32 %10, 160
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp sle i32 %14, 254
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 2, i32* %2
br label %18
17: ; preds = %12, %8
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @whatch(i8 zeroext %0) {
%2 = tail call i64 @isalpha(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, 95
%5 = icmp ult i8 %4, 94
%6 = select i1 %5, i32 2, i32 0
%7 = select i1 %3, i32 %6, i32 1
ret i32 %7
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sqrt(double);
double genacosh(double num) { return (log(num + sqrt(num * num - 1.0))); }


x86 assembly (clang, -O0):
<genacosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genacosh>:
push   %rax
movsd  %xmm0,(%rsp)
mulsd  %xmm0,%xmm0
addsd  0xece(%rip),%xmm0
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @genacosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double -1.000000e+00)
%7 = call i64 @sqrt(double %6)
%8 = sitofp i64 %7 to double
%9 = fadd double %3, %8
%10 = fptosi double %9 to i64
%11 = call double @log(i64 %10)
ret double %11
}

LLVM IR (-O2):
define double @genacosh(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -1.000000e+00)
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to double
%5 = fadd double %4, %0
%6 = fptosi double %5 to i64
%7 = tail call double @log(i64 %6)
ret double %7
}
void foo604(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo604(i32 %0) {
ret void
}