xunge/DecIR huggingface dataset:
int _kill(int a, int b) { return -1; }


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_kill(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void doVersion() {
  printf("%s v%s\n", "BitMeterOS Command Line Client", "0.7.6.1");
}


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

x86 assembly (clang, -O2):
<doVersion>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xf02(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s v%s\0A\00"
@.str.1 = [31 x i8] c"BitMeterOS Command Line Client\00"
@.str.2 = [8 x i8] c"0.7.6.1\00"
define void @doVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s v%s\0A\00"
@.str.1 = [31 x i8] c"BitMeterOS Command Line Client\00"
@.str.2 = [8 x i8] c"0.7.6.1\00"
define void @doVersion() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char *_ipmi_sensor_name(int, int *);
char *fru_string(uint8_t *src, uint8_t **end) {
  uint8_t tlen = *src++;
  *end = src + (tlen & 0x3F);
  return _ipmi_sensor_name(tlen, src);
}


x86 assembly (clang, -O0):
<fru_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%eax
and    $0x3f,%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <_ipmi_sensor_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fru_string>:
lea    0x4(%rdi),%rax
mov    (%rdi),%ecx
mov    %ecx,%edx
and    $0x3f,%edx
lea    (%rdi,%rdx,4),%rdx
add    $0x4,%rdx
mov    %rdx,(%rsi)
mov    %ecx,%edi
mov    %rax,%rsi
jmp    1030 <_ipmi_sensor_name@plt>

LLVM IR (-O0):
define i8* @fru_string(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
%5 = alloca i32
store i32* %0, i32** %3
store i32** %1, i32*** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %3
%8 = load i32, i32* %6
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %5
%11 = and i32 %10, 63
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32**, i32*** %4
store i32* %13, i32** %14
%15 = load i32, i32* %5
%16 = load i32*, i32** %3
%17 = call i8* @_ipmi_sensor_name(i32 %15, i32* %16)
ret i8* %17
}

LLVM IR (-O2):
define i8* @fru_string(i32* %0, i32** nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %0
%5 = and i32 %4, 63
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %3, i64 %6
store i32* %7, i32** %1
%8 = tail call i8* @_ipmi_sensor_name(i32 %4, i32* %3)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *);
int /*<<< orphan*/ mem_init();
void kmain() {
  mem_init();
  kprintf("CaOS - v 0.1 alpha");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mem_init@plt>
lea    0xece(%rip),%rdi
call   1040 <kprintf@plt>
jmp    1137 <kmain+0x17>

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1030 <mem_init@plt>
lea    0xed1(%rip),%rdi
call   1040 <kprintf@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1140 <kmain+0x20>

LLVM IR (-O0):
@.str = [19 x i8] c"CaOS - v 0.1 alpha\00"
define void @kmain() {
%1 = call i32 (...) @mem_init()
%2 = call i32 @kprintf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
br label %3
}

LLVM IR (-O2):
@.str = [19 x i8] c"CaOS - v 0.1 alpha\00"
define void @kmain() {
%1 = tail call i32 (...) @mem_init()
%2 = tail call i32 @kprintf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
br label %3
}
void dfn_av(int a, ...) {}


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

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

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

LLVM IR (-O2):
define void @dfn_av(i32 %0, ...) {
ret void
}
int delwin() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @delwin() {
ret i32 0
}
void log_boot(char *str) {}


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

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

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

LLVM IR (-O2):
define void @log_boot(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
double mxit() {
  exit(0);
  return (0.0);
}


x86 assembly (clang, -O0):
<mxit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<mxit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define double @mxit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define double @mxit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ find_nth_int32(int /*<<< orphan*/ *, int, int);
int32_t median_int32(int32_t *array, int n_elements) {
  return find_nth_int32(array, n_elements, (n_elements - 1) / 2);
}


x86 assembly (clang, -O0):
<median_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <find_nth_int32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_int32>:
lea    -0x1(%rsi),%eax
shr    $0x1f,%eax
lea    (%rsi,%rax,1),%edx
add    $0xffffffff,%edx
sar    %edx
jmp    1030 <find_nth_int32@plt>

LLVM IR (-O0):
define i32 @median_int32(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 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 2
%10 = call i32 @find_nth_int32(i32* %5, i32 %6, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @median_int32(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = tail call i32 @find_nth_int32(i32* %0, i32 %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int judgeCircle(char *);
int main(int argc, char **argv) {
  assert(judgeCircle("UD"));
  assert(!judgeCircle("LL"));
  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)
lea    0xec3(%rip),%rdi
call   1040 <judgeCircle@plt>
mov    %eax,%edi
call   1030 <assert@plt>
lea    0xeb3(%rip),%rdi
call   1040 <judgeCircle@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <judgeCircle@plt>
mov    %eax,%edi
call   1030 <assert@plt>
lea    0xec8(%rip),%rdi
call   1040 <judgeCircle@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"UD\00"
@.str.1 = [3 x i8] c"LL\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @judgeCircle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @assert(i32 %6)
%8 = call i32 @judgeCircle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"UD\00"
@.str.1 = [3 x i8] c"LL\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @judgeCircle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @judgeCircle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int getpid();
int /*<<< orphan*/ printf(char *, int);
void fork7() {
  if (fork() == 0) {
    printf("Terminating Child, PID = %d\n", getpid());
    exit(0);
  } else {
    printf("Running Parent, PID = %d\n", getpid());
    while (1)
      ;
  }
}


x86 assembly (clang, -O0):
<fork7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
jne    1171 <fork7+0x31>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
jmp    1186 <fork7+0x46>

x86 assembly (clang, -O2):
<fork7>:
push   %rbx
xor    %eax,%eax
call   1060 <fork@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
test   %rbx,%rbx
je     1172 <fork7+0x32>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1170 <fork7+0x30>
lea    0xe87(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Terminating Child, PID = %d\0A\00"
@.str.1 = [26 x i8] c"Running Parent, PID = %d\0A\00"
define void @fork7() {
%1 = call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 (...) @getpid()
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = call i32 (...) @getpid()
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %10
br label %10
}

LLVM IR (-O2):
@.str = [29 x i8] c"Terminating Child, PID = %d\0A\00"
@.str.1 = [26 x i8] c"Running Parent, PID = %d\0A\00"
define void @fork7() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
%3 = tail call i32 (...) @getpid()
br i1 %2, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %9
9: ; preds = %7, %9
br label %9
}
int bar(int x) { return x + 1; }


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

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
unsigned char *createTable(int size) {
  unsigned char *pixels;
  pixels = (unsigned char *)malloc(size);
  if (pixels == NULL) {
    printf("Not enough memory space. Leaving...");
    exit(2);
  }
  return pixels;
}


x86 assembly (clang, -O0):
<createTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <createTable+0x38>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createTable>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <createTable+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Not enough memory space. Leaving...\00"
define i8* @createTable(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [36 x i8] c"Not enough memory space. Leaving...\00"
define i8* @createTable(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to i8*
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  int z;
  if (!(x == y && x >= 0 && x + y + z == 0))
    return 0;
  while (x > 0) {
    x--;
    y--;
    z++;
    z++;
  }
  assert(z <= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1147 <main+0x37>
cmpl   $0x0,-0x8(%rbp)
jl     1147 <main+0x37>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0x0,%eax
je     1153 <main+0x43>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <main+0x93>
jmp    1158 <main+0x48>
cmpl   $0x0,-0x8(%rbp)
jle    118b <main+0x7b>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <main+0x48>
cmpl   $0x0,-0x10(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %18
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %11, %8, %0
store i32 0, i32* %1
br label %37
19: ; preds = %11
br label %20
20: ; preds = %23, %19
%21 = load i32, i32* %2
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %32
23: ; preds = %20
%24 = load i32, i32* %2
%25 = add nsw i32 %24, -1
store i32 %25, i32* %2
%26 = load i32, i32* %3
%27 = add nsw i32 %26, -1
store i32 %27, i32* %3
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %20
32: ; preds = %20
%33 = load i32, i32* %4
%34 = icmp sle i32 %33, 0
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
store i32 0, i32* %1
br label %37
37: ; preds = %32, %18
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_83uint8_mem(unsigned char *val) {
  return ((*val) & (0x83 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_83uint8_mem>:
testb  $0x83,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_83uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 131
%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_83uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -125
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int PAPI_read_counters(long long *, int);
void papif_read_counters__(long long *values, int *array_len, int *check) {
  *check = PAPI_read_counters(values, *array_len);
}


x86 assembly (clang, -O0):
<papif_read_counters__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <PAPI_read_counters@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_read_counters__>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_read_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_read_counters__(i64* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_read_counters(i64* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
double hmst2sec(unsigned char h, unsigned char m, unsigned char s,
                unsigned char t) {
  return ((((h * 60) + m) * 60) + s) + (0.1 * t);
}


x86 assembly (clang, -O0):
<hmst2sec>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0x3c,%eax,%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
imul   $0x3c,%eax,%eax
movzbl -0x3(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
movzbl -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xebb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmst2sec>:
imul   $0x3c,%edi,%eax
add    %esi,%eax
imul   $0x3c,%eax,%eax
add    %edx,%eax
cvtsi2sd %eax,%xmm1
cvtsi2sd %ecx,%xmm0
mulsd  0xee6(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @hmst2sec(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = mul nsw i32 %10, 60
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = add nsw i32 %11, %13
%15 = mul nsw i32 %14, 60
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = add nsw i32 %15, %17
%19 = sitofp i32 %18 to double
%20 = load i8, i8* %8
%21 = zext i8 %20 to i32
%22 = sitofp i32 %21 to double
%23 = call double @llvm.fmuladd.f64(double 1.000000e-01, double %22, double %19)
ret double %23
}

LLVM IR (-O2):
define double @hmst2sec(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = zext i8 %0 to i32
%6 = mul nuw nsw i32 %5, 60
%7 = zext i8 %1 to i32
%8 = add nuw nsw i32 %6, %7
%9 = mul nuw nsw i32 %8, 60
%10 = zext i8 %2 to i32
%11 = add nuw nsw i32 %9, %10
%12 = sitofp i32 %11 to double
%13 = uitofp i8 %3 to double
%14 = tail call double @llvm.fmuladd.f64(double %13, double 1.000000e-01, double %12)
ret double %14
}
int fun1246() { return 1246; }


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

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

LLVM IR (-O0):
define i32 @fun1246() {
ret i32 1246
}

LLVM IR (-O2):
define i32 @fun1246() {
ret i32 1246
}
reverse(lwrd) register unsigned int lwrd;
{
  return ((lwrd >> 24) | (lwrd >> 8 & 0xff00) | (lwrd << 8 & 0xff0000) |
          (lwrd << 24));
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @reverse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = and i32 %6, 65280
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = and i32 %10, 16711680
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = shl i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
void fork_parent() {
  if (!fork()) {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<fork_parent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%eax
jne    113b <fork_parent+0x1b>
xor    %edi,%edi
call   1030 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_parent>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     112e <fork_parent+0xe>
pop    %rax
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @fork_parent() {
%1 = call i32 (...) @fork()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @exit(i32 0)
unreachable
5: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @fork_parent() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void built_exit(void) { exit(0); }


x86 assembly (clang, -O0):
<built_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<built_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @built_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
void genupdate_count(unsigned int addr) {}


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

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

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

LLVM IR (-O2):
define void @genupdate_count(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(void const *, void const *);
int string_equals(const void *key1, const void *key2) {
  return key1 == key2 || strcmp(key1, key2) == 0;
}


x86 assembly (clang, -O0):
<string_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmp    -0x10(%rbp),%rcx
mov    %al,-0x11(%rbp)
je     114a <string_equals+0x3a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_equals>:
cmp    %rsi,%rdi
je     112b <string_equals+0x1b>
push   %rax
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @string_equals(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 = icmp eq i8* %5, %6
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i64 @strcmp(i8* %9, i8* %10)
%12 = icmp eq i64 %11, 0
br label %13
13: ; preds = %8, %2
%14 = phi i1 [ true, %2 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @string_equals(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i64 @strcmp(i8* %0, i8* %1)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 1, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int beholddb_set_param(int /*<<< orphan*/ *, char const *, char const *);
int /*<<< orphan*/ sqlite3_free(char const *);
char *sqlite3_vmprintf(char const *, int /*<<< orphan*/);
int beholddb_set_vfparam(sqlite3 *db, const char *param, const char *format,
                         va_list args) {
  const char *value = sqlite3_vmprintf(format, args);
  int rc = beholddb_set_param(db, param, value);
  sqlite3_free(value);
  return rc;
}


x86 assembly (clang, -O0):
<beholddb_set_vfparam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <sqlite3_vmprintf@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <beholddb_set_param@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <sqlite3_free@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beholddb_set_vfparam>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
mov    %ecx,%esi
call   1030 <sqlite3_vmprintf@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <beholddb_set_param@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <sqlite3_free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @beholddb_set_vfparam(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i8* @sqlite3_vmprintf(i8* %11, i32 %12)
store i8* %13, i8** %9
%14 = load i32*, i32** %5
%15 = load i8*, i8** %6
%16 = load i8*, i8** %9
%17 = call i32 @beholddb_set_param(i32* %14, i8* %15, i8* %16)
store i32 %17, i32* %10
%18 = load i8*, i8** %9
%19 = call i32 @sqlite3_free(i8* %18)
%20 = load i32, i32* %10
ret i32 %20
}

LLVM IR (-O2):
define i32 @beholddb_set_vfparam(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* @sqlite3_vmprintf(i8* %2, i32 %3)
%6 = tail call i32 @beholddb_set_param(i32* %0, i8* %1, i8* %5)
%7 = tail call i32 @sqlite3_free(i8* %5)
ret i32 %6
}
/* Variables and functions */
unsigned int GET32(int);
unsigned int uart_lcr(void) { return (GET32((0x3F000000 + 0x00215054))); }


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

x86 assembly (clang, -O2):
<uart_lcr>:
mov    $0x3f215054,%edi
jmp    1030 <GET32@plt>

LLVM IR (-O0):
define i32 @uart_lcr() {
%1 = call i32 @GET32(i32 1059147860)
ret i32 %1
}

LLVM IR (-O2):
define i32 @uart_lcr() {
%1 = tail call i32 @GET32(i32 1059147860)
ret i32 %1
}
int lingot_audio_jack_register(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lingot_audio_jack_register() {
ret i32 0
}
int iscntrl(int c) { return c < 32; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
xor    %eax,%eax
cmp    $0x20,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 32
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp slt i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *dupstr;
  if ((dupstr = strdup(str)) == NULL)
    err(1, "strdup()");
  return (dupstr);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1154 <xstrdup+0x34>
mov    $0x1,%edi
lea    0xeb1(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xstrdup+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"strdup()\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"strdup()\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void h2o__fatal(const char *msg) {
  fprintf(stderr, "fatal:%s\n", msg);
  abort();
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"fatal:%s\0A\00"
define void @h2o__fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"fatal:%s\0A\00"
define void @h2o__fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
size_t my_strlen(const char *s) {
  const char *sc;
  for (sc = s; *sc != '\0'; ++sc)
    ;
  return sc - s;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <my_strlen+0x36>
jmp    1125 <my_strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @my_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int compare_ulonglong(const void *a_ptr, const void *b_ptr) {
  const unsigned long long a = *((unsigned long long *)a_ptr);
  const unsigned long long b = *((unsigned long long *)b_ptr);
  if (a < b) {
    return -1;
  } else if (a > b) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<compare_ulonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    113c <compare_ulonglong+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <compare_ulonglong+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    1156 <compare_ulonglong+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <compare_ulonglong+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ulonglong>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_ulonglong(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
store i64 %10, i64* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i64*
%13 = load i64, i64* %12
store i64 %13, i64* %7
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load i64, i64* %6
%20 = load i64, i64* %7
%21 = icmp ugt i64 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_ulonglong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ugt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void *PulseRelayNumber(void *ptr) { return 0; }


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

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

LLVM IR (-O0):
define i8* @PulseRelayNumber(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @PulseRelayNumber(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
int func_1(void) {
  unsigned char l_2 = 0UL;
  step_hash(1);
  return l_2;
}


x86 assembly (clang, -O0):
<func_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <step_hash@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func_1() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @step_hash(i32 1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @func_1() {
%1 = tail call i32 @step_hash(i32 1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
char const *parse_addsub(char const *, scalar_t__ *);
const char *parse_expression(const char *p, ssize_t *value) {
  *value = 0;
  return parse_addsub(p, value);
}


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

x86 assembly (clang, -O2):
<parse_expression>:
movq   $0x0,(%rsi)
jmp    1030 <parse_addsub@plt>

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

LLVM IR (-O2):
define i8* @parse_expression(i8* %0, i64* %1) {
store i64 0, i64* %1
%3 = tail call i8* @parse_addsub(i8* %0, i64* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ test_average();
int main() {
  test_average();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_average()
ret i32 0
}
/* Variables and functions */
float expm1f(float);
float __ocl_expm1_float(float src) { return expm1f(src); }


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

x86 assembly (clang, -O2):
<__ocl_expm1_float>:
jmp    1030 <expm1f@plt>

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

LLVM IR (-O2):
define float @__ocl_expm1_float(float %0) {
%2 = tail call float @expm1f(float %0)
ret float %2
}
int do_418() { return 418; }


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

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

LLVM IR (-O0):
define i32 @do_418() {
ret i32 418
}

LLVM IR (-O2):
define i32 @do_418() {
ret i32 418
}
int main() {
  int x;
  x = 1;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ htonl(scalar_t__);
uint32_t GetNextIpInRange(uint32_t start, uint32_t end) {
  uint32_t pos = start;
  pos = htonl(start) + 1;
  if (pos > htonl(end)) {
    return 0;
  }
  pos = htonl(pos);
  return pos;
}


x86 assembly (clang, -O0):
<GetNextIpInRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <htonl@plt>
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <htonl@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jle    1167 <GetNextIpInRange+0x57>
movq   $0x0,-0x8(%rbp)
jmp    117c <GetNextIpInRange+0x6c>
mov    -0x20(%rbp),%rdi
call   1030 <htonl@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNextIpInRange>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <htonl@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <htonl@plt>
cmp    %rax,%rbx
jge    113f <GetNextIpInRange+0x2f>
add    $0x1,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <htonl@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @GetNextIpInRange(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
store i64 %7, i64* %6
%8 = load i64, i64* %4
%9 = call i64 @htonl(i64 %8)
%10 = add nsw i64 %9, 1
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = load i64, i64* %5
%13 = call i64 @htonl(i64 %12)
%14 = icmp sgt i64 %11, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i64 0, i64* %3
br label %20
16: ; preds = %2
%17 = load i64, i64* %6
%18 = call i64 @htonl(i64 %17)
store i64 %18, i64* %6
%19 = load i64, i64* %6
store i64 %19, i64* %3
br label %20
20: ; preds = %16, %15
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
define i64 @GetNextIpInRange(i64 %0, i64 %1) {
%3 = tail call i64 @htonl(i64 %0)
%4 = tail call i64 @htonl(i64 %1)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = add nsw i64 %3, 1
%8 = tail call i64 @htonl(i64 %7)
br label %9
9: ; preds = %2, %6
%10 = phi i64 [ %8, %6 ], [ 0, %2 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ getenv(int /*<<< orphan*/);
int /*<<< orphan*/ lua_check_string(int, char *);
int /*<<< orphan*/ lua_pushstring(int /*<<< orphan*/);
void io_getenv(void) { lua_pushstring(getenv(lua_check_string(1, "getenv"))); }


x86 assembly (clang, -O0):
<io_getenv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xec0(%rip),%rsi
call   1040 <lua_check_string@plt>
mov    %eax,%edi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <lua_pushstring@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_getenv>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1040 <lua_check_string@plt>
mov    %eax,%edi
call   1030 <getenv@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushstring@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"getenv\00"
define void @io_getenv() {
%1 = call i32 @lua_check_string(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @getenv(i32 %1)
%3 = call i32 @lua_pushstring(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"getenv\00"
define void @io_getenv() {
%1 = tail call i32 @lua_check_string(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @getenv(i32 %1)
%3 = tail call i32 @lua_pushstring(i32 %2)
ret void
}
void add(int *i, char *c) { *i = *i + *c; }


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

x86 assembly (clang, -O2):
<add>:
movsbl (%rsi),%eax
add    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @add(i32* nocapture %0, i8* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add nsw i32 %3, %5
store i32 %6, i32* %0
ret void
}
void foo188(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo188(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ open(int /*<<< orphan*/ *);
void test_main(void) { open(NULL); }


x86 assembly (clang, -O0):
<test_main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_main>:
xor    %edi,%edi
jmp    1030 <open@plt>

LLVM IR (-O0):
define void @test_main() {
%1 = call i32 @open(i32* null)
ret void
}

LLVM IR (-O2):
define void @test_main() {
%1 = tail call i32 @open(i32* null)
ret void
}
/* Type definitions */
struct ipr_ioa {
  int dummy;
};

/* Variables and functions */
int ipr_start_array(struct ipr_ioa *, char *, int /*<<< orphan*/,
                    int /*<<< orphan*/, int);
int ipr_add_hot_spare(struct ipr_ioa *ioa) {
  return ipr_start_array(ioa, "Create hot spare", 0, 0, 1);
}


x86 assembly (clang, -O0):
<ipr_add_hot_spare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%edx
call   1030 <ipr_start_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipr_add_hot_spare>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <ipr_start_array@plt>

LLVM IR (-O0):
%struct.ipr_ioa = type { i32 }
@.str = [17 x i8] c"Create hot spare\00"
define i32 @ipr_add_hot_spare(%struct.ipr_ioa* %0) {
%2 = alloca %struct.ipr_ioa*
store %struct.ipr_ioa* %0, %struct.ipr_ioa** %2
%3 = load %struct.ipr_ioa*, %struct.ipr_ioa** %2
%4 = call i32 @ipr_start_array(%struct.ipr_ioa* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.ipr_ioa = type { i32 }
@.str = [17 x i8] c"Create hot spare\00"
define i32 @ipr_add_hot_spare(%struct.ipr_ioa* %0) {
%2 = tail call i32 @ipr_start_array(%struct.ipr_ioa* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 1)
ret i32 %2
}
int mul(int x, int y) { return x * y; }


x86 assembly (clang, -O0):
<mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @mul(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}