xunge/DecIR huggingface dataset:
/* Variables and functions */
int getLine(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int c, len;
  char line[1000];
  while ((len = getLine(line, 1000)) > 0) {
    if (len > 80) {
      printf("%s", line);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getLine@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x50,-0xc(%rbp)
jle    116c <main+0x4c>
lea    -0x400(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getLine@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getLine@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1000 x i8]
store i32 0, i32* %1
br label %5
5: ; preds = %15, %0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%7 = call i32 @getLine(i8* %6, i32 1000)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 80
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %9
br label %5
16: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getLine(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getLine(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
char *strerror(const int errno) {
  static const char *msg = "strerror not implemented";
  return (char *)msg;
}


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

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@strerror.msg = internal global i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0)
@.str = [25 x i8] c"strerror not implemented\00"
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i8*, i8** @strerror.msg
ret i8* %3
}

LLVM IR (-O2):
@.str = [25 x i8] c"strerror not implemented\00"
define i8* @strerror(i32 %0) {
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void capsule_show_stats(FILE *f __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @capsule_show_stats(i32* nocapture %0) {
ret void
}
int check(char *name) { return !(*name == '.'); }


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @check(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 46
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @check(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 46
%4 = zext i1 %3 to i32
ret i32 %4
}
char *__aeabi_memclr(char *s, unsigned int n) {
  for (unsigned int i = 0; i < n; i++) {
    *(s + i) = 0;
  }
}


x86 assembly (clang, -O0):
<__aeabi_memclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1137 <__aeabi_memclr+0x37>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <__aeabi_memclr+0x12>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memclr>:
test   %esi,%esi
je     1122 <__aeabi_memclr+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define noalias i8* @__aeabi_memclr(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int Vsnprintf(char *s, size_t n, const char *fmt, va_list ap) {
  int ret;
  ret = vsnprintf(s, n, fmt, ap);
  if (ret < 0 || (unsigned)ret >= n)
    s[n - 1] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<Vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <vsnprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     1155 <Vsnprintf+0x45>
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     1165 <Vsnprintf+0x55>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vsnprintf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <vsnprintf@plt>
test   %eax,%eax
js     112a <Vsnprintf+0x1a>
mov    %eax,%ecx
cmp    %rbx,%rcx
jb     1130 <Vsnprintf+0x20>
movb   $0x0,-0x1(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @Vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @vsnprintf(i8* %10, i64 %11, i8* %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %4
%18 = load i32, i32* %9
%19 = zext i32 %18 to i64
%20 = load i64, i64* %6
%21 = icmp uge i64 %19, %20
br i1 %21, label %22, label %27
22: ; preds = %17, %4
%23 = load i8*, i8** %5
%24 = load i64, i64* %6
%25 = sub i64 %24, 1
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 0, i8* %26
br label %27
27: ; preds = %22, %17
%28 = load i32, i32* %9
ret i32 %28
}

LLVM IR (-O2):
define i32 @Vsnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = icmp sgt i32 %5, -1
%7 = zext i32 %5 to i64
%8 = icmp ult i64 %7, %1
%9 = and i1 %6, %8
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = add i64 %1, -1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %4, %10
ret i32 %5
}
void set_scl_line(unsigned long pci_base, int state) {
  if (state == 1)
    (*(unsigned char *)(pci_base + 0x0e) |= (1 << 0));
  else if (state == 0)
    (*(unsigned char *)(pci_base + 0x0e) &= ~(1 << 0));
}


x86 assembly (clang, -O0):
<set_scl_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1128 <set_scl_line+0x28>
mov    -0x8(%rbp),%rax
movzbl 0xe(%rax),%ecx
or     $0x1,%ecx
mov    %cl,0xe(%rax)
jmp    1145 <set_scl_line+0x45>
cmpl   $0x0,-0xc(%rbp)
jne    1140 <set_scl_line+0x40>
mov    -0x8(%rbp),%rax
movzbl 0xe(%rax),%ecx
and    $0xfffffffe,%ecx
mov    %cl,0xe(%rax)
jmp    1145 <set_scl_line+0x45>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_scl_line>:
test   %esi,%esi
je     110e <set_scl_line+0xe>
cmp    $0x1,%esi
jne    1112 <set_scl_line+0x12>
orb    $0x1,0xe(%rdi)
ret
andb   $0xfe,0xe(%rdi)
ret

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

LLVM IR (-O2):
define void @set_scl_line(i64 %0, i32 %1) {
switch i32 %1, label %13 [
i32 1, label %3
i32 0, label %8
]
3: ; preds = %2
%4 = add i64 %0, 14
%5 = inttoptr i64 %4 to i8*
%6 = load i8, i8* %5
%7 = or i8 %6, 1
store i8 %7, i8* %5
br label %13
8: ; preds = %2
%9 = add i64 %0, 14
%10 = inttoptr i64 %9 to i8*
%11 = load i8, i8* %10
%12 = and i8 %11, -2
store i8 %12, i8* %10
br label %13
13: ; preds = %2, %8, %3
ret void
}
void RTHandleGetStandard(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHandleGetStandard() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clistate_request_exit();
void sigint_handler(int sig) { clistate_request_exit(); }


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

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

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

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
%2 = tail call i32 (...) @clistate_request_exit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TestIfBadThingHitsGoodThing(int, int, int /*<<< orphan*/);
void TestIfBadThingTouchesPlayer(int x, int y) {
  TestIfBadThingHitsGoodThing(x, y, 0);
}


x86 assembly (clang, -O0):
<TestIfBadThingTouchesPlayer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <TestIfBadThingHitsGoodThing@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestIfBadThingTouchesPlayer>:
xor    %edx,%edx
jmp    1030 <TestIfBadThingHitsGoodThing@plt>

LLVM IR (-O0):
define void @TestIfBadThingTouchesPlayer(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 = call i32 @TestIfBadThingHitsGoodThing(i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @TestIfBadThingTouchesPlayer(i32 %0, i32 %1) {
%3 = tail call i32 @TestIfBadThingHitsGoodThing(i32 %0, i32 %1, i32 0)
ret void
}
int my_isnan(double d) { return (d != d); }


x86 assembly (clang, -O0):
<my_isnan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isnan>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @my_isnan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp une double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @my_isnan(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
__attribute__((weak)) void dynamic_init(void) {}


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

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

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

LLVM IR (-O2):
define weak void @dynamic_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__26__IO__set();
void Msp430GpioC__1__HplGeneralIO__set(void) {
  HplMsp430GeneralIOP__26__IO__set();
}


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

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

LLVM IR (-O0):
define void @Msp430GpioC__1__HplGeneralIO__set() {
%1 = call i32 (...) @HplMsp430GeneralIOP__26__IO__set()
ret void
}

LLVM IR (-O2):
define void @Msp430GpioC__1__HplGeneralIO__set() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__26__IO__set()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void remove_int(void *data) {
  int *x = (int *)data;
  free(x);
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *const,
                            int /*<<< orphan*/);
void zc_err_stderr(int priority __attribute__((unused)),
                   const char *const format, va_list ap) {
  vfprintf(stderr, format, ap);
}


x86 assembly (clang, -O0):
<zc_err_stderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zc_err_stderr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @zc_err_stderr(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @vfprintf(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @zc_err_stderr(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @vfprintf(i32 %4, i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ copro_f100_read_mem(int /*<<< orphan*/);
uint32_t dbg_memread(uint32_t addr) { return copro_f100_read_mem(addr); }


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

x86 assembly (clang, -O2):
<dbg_memread>:
jmp    1030 <copro_f100_read_mem@plt>

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

LLVM IR (-O2):
define i32 @dbg_memread(i32 %0) {
%2 = tail call i32 @copro_f100_read_mem(i32 %0)
ret i32 %2
}
/* Variables and functions */
int OSDSoftUseBuffer(void) { return 1; }


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

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

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

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

/* Variables and functions */
uint32_t ror32(uint32_t word, unsigned int shift) {
  return ((word >> shift) | (word << (32 - shift)));
}


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

x86 assembly (clang, -O2):
<ror32>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ror32(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror32(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ AbEnd(char *, unsigned long);
void *realloc(void *, size_t);
void *xrealloc(void *P, size_t Size) {
  void *N = realloc(P, Size);
  if (N == 0 && Size != 0) {
    AbEnd("Out of memory in realloc - requested block size = %lu",
          (unsigned long)Size);
  }
  return N;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1167 <xrealloc+0x47>
cmpq   $0x0,-0x10(%rbp)
je     1167 <xrealloc+0x47>
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <AbEnd@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1148 <xrealloc+0x28>
test   %r14,%r14
jne    1148 <xrealloc+0x28>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <AbEnd@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [54 x i8] c"Out of memory in realloc - requested block size = %lu\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i64, i64* %4
%16 = call i32 @AbEnd(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i64 %15)
br label %17
17: ; preds = %14, %11, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [54 x i8] c"Out of memory in realloc - requested block size = %lu\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @AbEnd(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %9
9: ; preds = %7, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ highvideo();
void highlight() { highvideo(); }


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

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

LLVM IR (-O0):
define void @highlight() {
%1 = call i32 (...) @highvideo()
ret void
}

LLVM IR (-O2):
define void @highlight() {
%1 = tail call i32 (...) @highvideo()
ret void
}
extern unsigned int ReturnUint32() { return 0xFFFFFFFE; }


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

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

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

LLVM IR (-O2):
define i32 @ReturnUint32() {
ret i32 -2
}
int test_imm_04int16_mem(short *val) {
  return ((*val) & (-0x04 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_04int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xfffffffc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_04int16_mem>:
cmpw   $0x4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_04int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp ult i16 %2, 4
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void init_callbacks(void) {}


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

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

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

LLVM IR (-O2):
define void @init_callbacks() {
ret void
}
int ifc_reset_connections(const char *ifname, const int reset_mask) {
  return 0;
}


x86 assembly (clang, -O0):
<ifc_reset_connections>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ifc_reset_connections(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @ifc_reset_connections(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int done, i, x = 6;
  done = i = 0;
  while (i < 100 && !done) {
    if ((x /= 2) > 1) {
      i++;
      continue;
    }
    done++;
  }
  printf("%d %d\n", i, done);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x64,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jge    114f <main+0x3f>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115f <main+0x4f>
jmp    1192 <main+0x82>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmp    $0x1,%eax
jle    1184 <main+0x74>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %4
store i32 0, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %21, %18, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %24
14: ; preds = %12
%15 = load i32, i32* %4
%16 = sdiv i32 %15, 2
store i32 %16, i32* %4
%17 = icmp sgt i32 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %14
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %5
24: ; preds = %12
%25 = load i32, i32* %3
%26 = load i32, i32* %2
%27 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26)
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
ret i32 0
}
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char getHighestVoltageLimit(unsigned char id) {
  return dxl_read_byte(id, (13));
}


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

x86 assembly (clang, -O2):
<getHighestVoltageLimit>:
mov    $0xd,%esi
jmp    1030 <dxl_read_byte@plt>

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

LLVM IR (-O2):
define zeroext i8 @getHighestVoltageLimit(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 13)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ rd(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ wr(char *, int);
void copy(FILE *ibuf, char *lbuf, int n) {
  do {
    wr(lbuf, n);
  } while (rd(ibuf, lbuf) >= 0);
  exit(0);
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <wr@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rd@plt>
cmp    $0x0,%rax
jge    1143 <copy+0x13>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<copy>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
nopl   (%rax)
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <wr@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <rd@plt>
test   %rax,%rax
jns    1140 <copy+0x10>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @copy(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %11, %3
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @wr(i8* %8, i32 %9)
br label %11
11: ; preds = %7
%12 = load i32*, i32** %4
%13 = load i8*, i8** %5
%14 = call i64 @rd(i32* %12, i8* %13)
%15 = icmp sge i64 %14, 0
br i1 %15, label %7, label %16
16: ; preds = %11
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @copy(i32* %0, i8* %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @wr(i8* %1, i32 %2)
%6 = tail call i64 @rd(i32* %0, i8* %1)
%7 = icmp sgt i64 %6, -1
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: ppgap4 groupname.\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: ppgap4 groupname.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: ppgap4 groupname.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int mul8bit(int, int);
unsigned short pack_r5g6b5(int r, int g, int b) {
  return ((mul8bit(r, 31) << 11) | (mul8bit(g, 63) << 5) | (mul8bit(b, 31)));
}


x86 assembly (clang, -O0):
<pack_r5g6b5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1f,%esi
call   1030 <mul8bit@plt>
shl    $0xb,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x3f,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
shl    $0x5,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x1f,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
movzwl %ax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_r5g6b5>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    $0x1f,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ebx
shl    $0xb,%ebx
mov    %ebp,%edi
mov    $0x3f,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ebp
shl    $0x5,%ebp
or     %ebx,%ebp
mov    %r14d,%edi
mov    $0x1f,%esi
call   1030 <mul8bit@plt>
or     %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @pack_r5g6b5(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 = call i32 @mul8bit(i32 %7, i32 31)
%9 = shl i32 %8, 11
%10 = load i32, i32* %5
%11 = call i32 @mul8bit(i32 %10, i32 63)
%12 = shl i32 %11, 5
%13 = or i32 %9, %12
%14 = load i32, i32* %6
%15 = call i32 @mul8bit(i32 %14, i32 31)
%16 = or i32 %13, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @pack_r5g6b5(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mul8bit(i32 %0, i32 31)
%5 = shl i32 %4, 11
%6 = tail call i32 @mul8bit(i32 %1, i32 63)
%7 = shl i32 %6, 5
%8 = or i32 %7, %5
%9 = tail call i32 @mul8bit(i32 %2, i32 31)
%10 = or i32 %8, %9
%11 = trunc i32 %10 to i16
ret i16 %11
}
int test_imm_54int32_reg(int val) { return ((val) & (0x54 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_54int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x54,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_54int32_reg(i32 %0) {
%2 = and i32 %0, 84
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void irq_init(void) {
  outb(0x20, 0x11);
  outb(0xA0, 0x11);
  outb(0x21, 0x20);
  outb(0xA1, 0x28);
  outb(0x21, 0x04);
  outb(0xA1, 0x02);
  outb(0x21, 0x01);
  outb(0xA1, 0x01);
  return;
}


x86 assembly (clang, -O0):
<irq_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_init>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @irq_init() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 160, i32 17)
%3 = call i32 @outb(i32 33, i32 32)
%4 = call i32 @outb(i32 161, i32 40)
%5 = call i32 @outb(i32 33, i32 4)
%6 = call i32 @outb(i32 161, i32 2)
%7 = call i32 @outb(i32 33, i32 1)
%8 = call i32 @outb(i32 161, i32 1)
ret void
}

LLVM IR (-O2):
define void @irq_init() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 160, i32 17)
%3 = tail call i32 @outb(i32 33, i32 32)
%4 = tail call i32 @outb(i32 161, i32 40)
%5 = tail call i32 @outb(i32 33, i32 4)
%6 = tail call i32 @outb(i32 161, i32 2)
%7 = tail call i32 @outb(i32 33, i32 1)
%8 = tail call i32 @outb(i32 161, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tc_buffree(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @tc_buffree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void g_param_spec_pointer() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_pointer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char str[256];
  scanf("%255s", str);
  printf("%s\n", str);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%255s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
float tanHDeriv(float tanhInput) { return 1 - (tanhInput * tanhInput); }


x86 assembly (clang, -O0):
<tanHDeriv>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xed4(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanHDeriv>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @tanHDeriv(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fneg float %3
%6 = call float @llvm.fmuladd.f32(float %5, float %4, float 1.000000e+00)
ret float %6
}

LLVM IR (-O2):
define float @tanHDeriv(float %0) {
%2 = fneg float %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float %0, float 1.000000e+00)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ RESHLm(int);
void RES3HLm() { RESHLm(0x08); }


x86 assembly (clang, -O0):
<RES3HLm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <RESHLm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RES3HLm>:
mov    $0x8,%edi
jmp    1030 <RESHLm@plt>

LLVM IR (-O0):
define void @RES3HLm() {
%1 = call i32 @RESHLm(i32 8)
ret void
}

LLVM IR (-O2):
define void @RES3HLm() {
%1 = tail call i32 @RESHLm(i32 8)
ret void
}
/* Type definitions */
struct timex {
  scalar_t__ modes;
};

/* Variables and functions */
int adjtimex(struct timex *);
int main(void) {
  struct timex buf;
  buf.modes = 0;
  return adjtimex(&buf);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <adjtimex@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timex = type { i64 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timex
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.timex, %struct.timex* %2, i32 0, i32 0
store i64 0, i64* %3
%4 = call i32 @adjtimex(%struct.timex* %2)
ret i32 %4
}

LLVM IR (-O2):
%struct.timex = type { i64 }
define i32 @main() {
%1 = alloca %struct.timex
%2 = bitcast %struct.timex* %1 to i8*
%3 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 0
store i64 0, i64* %3
%4 = call i32 @adjtimex(%struct.timex* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long long lllerp(long long v0, long long v1, long long t) {
  printf("Call function "
         "lllerp"
         ": ");
  return (1 - t) * v0 + t * v1;
}


x86 assembly (clang, -O0):
<lllerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
sub    -0x18(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   -0x10(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lllerp>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
sub    %r14,%rax
imul   %r15,%rax
imul   %r14,%rbx
add    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Call function lllerp: \00"
define i64 @lllerp(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = load i64, i64* %6
%9 = sub nsw i64 1, %8
%10 = load i64, i64* %4
%11 = mul nsw i64 %9, %10
%12 = load i64, i64* %6
%13 = load i64, i64* %5
%14 = mul nsw i64 %12, %13
%15 = add nsw i64 %11, %14
ret i64 %15
}

LLVM IR (-O2):
@.str = [23 x i8] c"Call function lllerp: \00"
define i64 @lllerp(i64 %0, i64 %1, i64 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = sub nsw i64 1, %2
%6 = mul nsw i64 %5, %0
%7 = mul nsw i64 %2, %1
%8 = add nsw i64 %6, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ time(long *);
int bench_time(long count) {
  long l;
  long tt;
  for (l = 0; l < count; l++) {
    time(&tt);
  }
  return 0;
}


x86 assembly (clang, -O0):
<bench_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    114c <bench_time+0x3c>
lea    -0x18(%rbp),%rdi
call   1030 <time@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <bench_time+0x14>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_time>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
jle    112e <bench_time+0x1e>
mov    %rdi,%rbx
mov    %rsp,%r14
nop
mov    %r14,%rdi
call   1030 <time@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <bench_time+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @bench_time(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = icmp sgt i64 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i64 [ %8, %5 ], [ 0, %1 ]
%7 = call i32 @time(i64* %2)
%8 = add nuw nsw i64 %6, 1
%9 = icmp eq i64 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int iprule_list(int, char **);
scalar_t__ strcmp(char *, char *);
int do_iprule(int argc, char **argv) {
  if (strcmp(argv[0], "list") == 0)
    return iprule_list(argc - 1, argv + 1);
  exit(0);
}


x86 assembly (clang, -O0):
<do_iprule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1175 <do_iprule+0x45>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1040 <iprule_list@plt>
add    $0x10,%rsp
pop    %rbp
ret
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<do_iprule>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1163 <do_iprule+0x33>
add    $0xffffffff,%ebp
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <iprule_list@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"list\00"
define i32 @do_iprule(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = call i32 @iprule_list(i32 %12, i8** %14)
ret i32 %15
16: ; preds = %2
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"list\00"
define i32 @do_iprule(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = tail call i32 @iprule_list(i32 %7, i8** %8)
ret i32 %9
10: ; preds = %2
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
void *Cyc_Absyn_thin_bounds_type(void *);
void *Cyc_Absyn_valueof_type(struct Cyc_Absyn_Exp *);
void *Cyc_Absyn_thin_bounds_exp(struct Cyc_Absyn_Exp *e) {
  void *_T0;
  void *_T1;
  _T0 = Cyc_Absyn_valueof_type(e);
  _T1 = Cyc_Absyn_thin_bounds_type(_T0);
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_Absyn_thin_bounds_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Cyc_Absyn_valueof_type@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <Cyc_Absyn_thin_bounds_type@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_thin_bounds_exp>:
push   %rax
call   1030 <Cyc_Absyn_valueof_type@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <Cyc_Absyn_thin_bounds_type@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define i8* @Cyc_Absyn_thin_bounds_exp(%struct.Cyc_Absyn_Exp* %0) {
%2 = alloca %struct.Cyc_Absyn_Exp*
%3 = alloca i8*
%4 = alloca i8*
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %2
%5 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %2
%6 = call i8* @Cyc_Absyn_valueof_type(%struct.Cyc_Absyn_Exp* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @Cyc_Absyn_thin_bounds_type(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
ret i8* %9
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define i8* @Cyc_Absyn_thin_bounds_exp(%struct.Cyc_Absyn_Exp* %0) {
%2 = tail call i8* @Cyc_Absyn_valueof_type(%struct.Cyc_Absyn_Exp* %0)
%3 = tail call i8* @Cyc_Absyn_thin_bounds_type(i8* %2)
ret i8* %3
}
void taskstats_init_early(void) {}


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

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

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

LLVM IR (-O2):
define void @taskstats_init_early() {
ret void
}
void show_close_icon() {}


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

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

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

LLVM IR (-O2):
define void @show_close_icon() {
ret void
}