xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ emit_addimm(int, int, int);
int /*<<< orphan*/ emit_cmovne_reg(int, int);
int /*<<< orphan*/ emit_cmpimm(int, int);
int /*<<< orphan*/ emit_orimm(int, int, int);
void emit_cmpeqimm(int s, int imm, int sr, int temp) {
  assert(temp >= 0);
  emit_orimm(sr, 1, sr);
  emit_addimm(sr, -1, temp);
  emit_cmpimm(s, imm);
  emit_cmovne_reg(temp, sr);
}


x86 assembly (clang, -O0):
<emit_cmpeqimm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1070 <emit_orimm@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%edx
mov    $0xffffffff,%esi
call   1050 <emit_addimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <emit_cmpimm@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <emit_cmovne_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cmpeqimm>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%r15d
mov    %ecx,%edi
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1070 <emit_orimm@plt>
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    %ebp,%edx
call   1050 <emit_addimm@plt>
mov    %r15d,%edi
mov    %r14d,%esi
call   1030 <emit_cmpimm@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <emit_cmovne_reg@plt>

LLVM IR (-O0):
define void @emit_cmpeqimm(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp sge i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @emit_orimm(i32 %13, i32 1, i32 %14)
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @emit_addimm(i32 %16, i32 -1, i32 %17)
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = call i32 @emit_cmpimm(i32 %19, i32 %20)
%22 = load i32, i32* %8
%23 = load i32, i32* %7
%24 = call i32 @emit_cmovne_reg(i32 %22, i32 %23)
ret void
}

LLVM IR (-O2):
define void @emit_cmpeqimm(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = xor i32 %3, -1
%6 = lshr i32 %5, 31
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @emit_orimm(i32 %2, i32 1, i32 %2)
%9 = tail call i32 @emit_addimm(i32 %2, i32 -1, i32 %3)
%10 = tail call i32 @emit_cmpimm(i32 %0, i32 %1)
%11 = tail call i32 @emit_cmovne_reg(i32 %3, i32 %2)
ret void
}
int vid_to_reg(int val, int vrm) {
  switch (vrm) {
  case 91:
  case 90:
    return ((val >= 1100) && (val <= 1850) ? ((18499 - val * 10) / 25 + 5) / 10
                                           : -1);
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<vid_to_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffa6,%eax
sub    $0x1,%eax
ja     1176 <vid_to_reg+0x76>
jmp    111e <vid_to_reg+0x1e>
cmpl   $0x44c,-0x8(%rbp)
jl     115e <vid_to_reg+0x5e>
cmpl   $0x73a,-0x8(%rbp)
jg     115e <vid_to_reg+0x5e>
imul   $0xa,-0x8(%rbp),%ecx
mov    $0x4843,%eax
sub    %ecx,%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
add    $0x5,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    116b <vid_to_reg+0x6b>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    116b <vid_to_reg+0x6b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <vid_to_reg+0x7d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vid_to_reg>:
lea    -0x44c(%rdi),%ecx
mov    $0xffffffff,%eax
cmp    $0x2ee,%ecx
ja     1149 <vid_to_reg+0x49>
and    $0xfffffffe,%esi
cmp    $0x5a,%esi
jne    1149 <vid_to_reg+0x49>
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
mov    $0x4843,%ecx
sub    %eax,%ecx
movswl %cx,%eax
imul   $0x147b,%eax,%eax
mov    %eax,%ecx
sar    $0x11,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
add    $0x5,%eax
movzwl %ax,%eax
imul   $0xcccd,%eax,%eax
shr    $0x13,%eax
ret

LLVM IR (-O0):
define i32 @vid_to_reg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %23 [
i32 91, label %7
i32 90, label %7
]
7: ; preds = %2, %2
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 1100
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp sle i32 %11, 1850
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 10
%16 = sub nsw i32 18499, %15
%17 = sdiv i32 %16, 25
%18 = add nsw i32 %17, 5
%19 = sdiv i32 %18, 10
br label %21
20: ; preds = %10, %7
br label %21
21: ; preds = %20, %13
%22 = phi i32 [ %19, %13 ], [ -1, %20 ]
store i32 %22, i32* %3
br label %24
23: ; preds = %2
store i32 -1, i32* %3
br label %24
24: ; preds = %23, %21
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @vid_to_reg(i32 %0, i32 %1) {
%3 = and i32 %1, -2
%4 = icmp eq i32 %3, 90
%5 = add i32 %0, -1100
%6 = icmp ult i32 %5, 751
%7 = and i1 %6, %4
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = trunc i32 %0 to i16
%10 = mul nsw i16 %9, -10
%11 = add nsw i16 %10, 18499
%12 = sdiv i16 %11, 25
%13 = add nuw nsw i16 %12, 5
%14 = udiv i16 %13, 10
%15 = zext i16 %14 to i32
br label %16
16: ; preds = %2, %8
%17 = phi i32 [ %15, %8 ], [ -1, %2 ]
ret i32 %17
}
/* Variables and functions */
char *ch_str_cmp(char c, const char *str) {
  while ((c != *str) && (*str != '\0'))
    ++str;
  if (c == *str) {
    return (char *)str;
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<ch_str_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    %rsi,-0x18(%rbp)
movsbl -0x9(%rbp),%ecx
mov    -0x18(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
je     1136 <ch_str_cmp+0x36>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1146 <ch_str_cmp+0x46>
jmp    1157 <ch_str_cmp+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110e <ch_str_cmp+0xe>
movsbl -0x9(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1177 <ch_str_cmp+0x77>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <ch_str_cmp+0x7f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_str_cmp>:
add    $0xffffffffffffffff,%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi),%ecx
add    $0x1,%rsi
cmp    %dil,%cl
je     1121 <ch_str_cmp+0x21>
test   %cl,%cl
jne    1110 <ch_str_cmp+0x10>
xor    %eax,%eax
cmp    %dil,%cl
cmove  %rsi,%rax
ret

LLVM IR (-O0):
define i8* @ch_str_cmp(i8 signext %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
br label %6
6: ; preds = %20, %2
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %6
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %6
%19 = phi i1 [ false, %6 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %5
br label %6
23: ; preds = %18
%24 = load i8, i8* %4
%25 = sext i8 %24 to i32
%26 = load i8*, i8** %5
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %25, %28
br i1 %29, label %30, label %32
30: ; preds = %23
%31 = load i8*, i8** %5
store i8* %31, i8** %3
br label %33
32: ; preds = %23
store i8* null, i8** %3
br label %33
33: ; preds = %32, %30
%34 = load i8*, i8** %3
ret i8* %34
}

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


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

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

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

LLVM IR (-O2):
define i32 @test_imm_15int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 21
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void dmss_fiq_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @dmss_fiq_handler() {
ret void
}
/* Variables and functions */
void *__malloc(size_t);
void *malloc(size_t size) { return __malloc(size); }


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

x86 assembly (clang, -O2):
<malloc>:
jmp    1030 <__malloc@plt>

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

LLVM IR (-O2):
define i8* @malloc(i64 %0) {
%2 = tail call i8* @__malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("u up     d down   m mix\n");
  printf("f front  b back   * reset\n");
  printf("l left   r right\n");
  printf("[ load   ] save\n");
  printf("q quit\n\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"u up d down m mix\0A\00"
@.str.1 = [27 x i8] c"f front b back * reset\0A\00"
@.str.2 = [18 x i8] c"l left r right\0A\00"
@.str.3 = [17 x i8] c"[ load ] save\0A\00"
@.str.4 = [9 x i8] c"q quit\0A\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"u up d down m mix\00"
@str.5 = [26 x i8] c"f front b back * reset\00"
@str.6 = [17 x i8] c"l left r right\00"
@str.7 = [16 x i8] c"[ load ] save\00"
@str.8 = [8 x i8] c"q quit\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ serial_write(int /*<<< orphan*/ *, int);
int serial_putchar(char c, FILE *stream) {
  serial_write((uint8_t *)&c, 1);
  return 0;
}


x86 assembly (clang, -O0):
<serial_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <serial_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <serial_write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serial_putchar(i8 signext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = bitcast i8* %3 to i32*
%6 = call i32 @serial_write(i32* %5, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @serial_putchar(i8 signext %0, i32* nocapture readnone %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = bitcast i8* %3 to i32*
%5 = call i32 @serial_write(i32* %4, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int main() {
  test("C Programming Language");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"C Programming Language\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"C Programming Language\00"
define i32 @main() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int uart1_getc_nb() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uart1_getc_nb() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int8_t rfid_write(uint8_t *id, int32_t bloc, uint8_t *data) {}


x86 assembly (clang, -O0):
<rfid_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rfid_write(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 undef
}
int foo() {
  int d;
  static int e = 5;
  printf("&d=0x%x &e=0x%x\n", &d, &e);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    0x2efe(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@foo.e = internal global i32 5
@.str = [17 x i8] c"&d=0x%x &e=0x%x\0A\00"
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %2, i32* @foo.e)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@foo.e = internal global i32 5
@.str = [17 x i8] c"&d=0x%x &e=0x%x\0A\00"
define i32 @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %1, i32* @foo.e)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ terminal_initialize();
void kernel_entry_early() { terminal_initialize(); }


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

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

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

LLVM IR (-O2):
define void @kernel_entry_early() {
%1 = tail call i32 (...) @terminal_initialize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_ACI();
void do0xCE() { _I8080_ACI(); }


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

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

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

LLVM IR (-O2):
define void @do0xCE() {
%1 = tail call i32 (...) @_I8080_ACI()
ret void
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ init();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i;
  init();
  for (i = 1; i < 5000; i++) {
    if (fib(i) >= 999) {
      printf("Fibonacci number %d is the first to have 1000 digits\n", i);
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x1388,-0x14(%rbp)
jge    119b <main+0x6b>
mov    -0x14(%rbp),%edi
call   1050 <fib@plt>
cmp    $0x3e7,%eax
jl     1188 <main+0x58>
mov    -0x14(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x6b>
jmp    118d <main+0x5d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <init@plt>
mov    $0x1,%ebx
nopl   (%rax)
mov    %ebx,%edi
call   1050 <fib@plt>
cmp    $0x3e7,%eax
jge    115b <main+0x2b>
add    $0x1,%ebx
cmp    $0x1388,%ebx
jne    1140 <main+0x10>
jmp    1169 <main+0x39>
lea    0xe9e(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"Fibonacci number %d is the first to have 1000 digits\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @init()
store i32 1, i32* %6
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 5000
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %6
%13 = call i32 @fib(i32 %12)
%14 = icmp sge i32 %13, 999
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %22
18: ; preds = %11
br label %19
19: ; preds = %18
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %8
22: ; preds = %15, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [54 x i8] c"Fibonacci number %d is the first to have 1000 digits\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
br label %4
4: ; preds = %2, %10
%5 = phi i32 [ 1, %2 ], [ %11, %10 ]
%6 = tail call i32 @fib(i32 %5)
%7 = icmp sgt i32 %6, 998
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %13
10: ; preds = %4
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, 5000
br i1 %12, label %13, label %4
13: ; preds = %10, %8
ret i32 0
}
/* Type definitions */
struct tag_osn_task {
  int dummy;
};

/* Variables and functions */
struct tag_osn_task *get_task_by_event_list(void *);
int is_exist_event_list(void *event_list) {
  struct tag_osn_task *task = get_task_by_event_list(event_list);
  return task ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_exist_event_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_task_by_event_list@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tag_osn_task = type { i32 }
define i32 @is_exist_event_list(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tag_osn_task*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.tag_osn_task* @get_task_by_event_list(i8* %4)
store %struct.tag_osn_task* %5, %struct.tag_osn_task** %3
%6 = load %struct.tag_osn_task*, %struct.tag_osn_task** %3
%7 = icmp ne %struct.tag_osn_task* %6, null
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
%struct.tag_osn_task = type { i32 }
define i32 @is_exist_event_list(i8* %0) {
%2 = tail call %struct.tag_osn_task* @get_task_by_event_list(i8* %0)
%3 = icmp ne %struct.tag_osn_task* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void g_ascii_strncasecmp() {}


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

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

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

LLVM IR (-O2):
define void @g_ascii_strncasecmp() {
ret void
}
extern void outsb(unsigned short port, const void *addr, unsigned long count) {
  __asm__ __volatile__("cld ; rep ; outs"
                       "b"
                       : "=S"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
cld
rep outsb %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsb>:
mov    %rdx,%rcx
mov    %edi,%edx
cld
rep outsb %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "cld ; rep ; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void print_lines(FILE *fp, const char **lines) {
  const char **l;
  for (l = lines; *l; ++l) {
    fprintf(fp, "%s\n", *l);
  }
}


x86 assembly (clang, -O0):
<print_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     115e <print_lines+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print_lines+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_lines>:
push   %r15
push   %r14
push   %rbx
mov    (%rsi),%rdx
test   %rdx,%rdx
je     1147 <print_lines+0x37>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x8,%rbx
lea    0xed2(%rip),%r15
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%rdx
add    $0x8,%rbx
test   %rdx,%rdx
jne    1130 <print_lines+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_lines(i32* nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i8** [ %9, %5 ], [ %1, %2 ]
%8 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_TaskHandler();
int /*<<< orphan*/ select();
void apioLoop() {
  SYS_TaskHandler();
  select();
}


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

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

LLVM IR (-O0):
define void @apioLoop() {
%1 = call i32 (...) @SYS_TaskHandler()
%2 = call i32 (...) @select()
ret void
}

LLVM IR (-O2):
define void @apioLoop() {
%1 = tail call i32 (...) @SYS_TaskHandler()
%2 = tail call i32 (...) @select()
ret void
}
int fatocel(int fahr) {
  int celsius;
  celsius = 5 * (fahr - 32) / 9;
  return celsius;
}


x86 assembly (clang, -O0):
<fatocel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatocel>:
lea    (%rdi,%rdi,4),%eax
add    $0xffffff60,%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fatocel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
%6 = mul nsw i32 5, %5
%7 = sdiv i32 %6, 9
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @fatocel(i32 %0) {
%2 = mul i32 %0, 5
%3 = add i32 %2, -160
%4 = sdiv i32 %3, 9
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_ampl_comments() {
  test_parser_verify_parse(test_parser_sourcefile("ampl", " #comment"), "ampl",
                           "", "#comment", 0);
}


x86 assembly (clang, -O0):
<test_ampl_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebd(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ampl_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec6(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ampl\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_ampl_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ampl\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_ampl_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
__attribute__((always_)) int kstack_end(void *addr) {
  return !(((unsigned long)addr + sizeof(void *) - 1) &
           ((((1UL) << 12) << 1) - sizeof(void *)));
}


x86 assembly (clang, -O0):
<kstack_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
sub    $0x1,%rax
and    $0x1ff8,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kstack_end>:
add    $0x7,%edi
xor    %eax,%eax
test   $0x1ff8,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @kstack_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = add i64 %4, 8
%6 = sub i64 %5, 1
%7 = and i64 %6, 8184
%8 = icmp ne i64 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @kstack_end(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = add i64 %2, 7
%4 = and i64 %3, 8184
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SOCKET_initialization();
int /*<<< orphan*/ SOCKET_prepare();
int /*<<< orphan*/ SOCKET_run();
int /*<<< orphan*/ SOCKET_stop();
void SOCKET_main(void) {
  (void)SOCKET_initialization();
  (void)SOCKET_prepare();
  (void)SOCKET_run();
  (void)SOCKET_stop();
}


x86 assembly (clang, -O0):
<SOCKET_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SOCKET_initialization@plt>
mov    $0x0,%al
call   1040 <SOCKET_prepare@plt>
mov    $0x0,%al
call   1050 <SOCKET_run@plt>
mov    $0x0,%al
call   1060 <SOCKET_stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SOCKET_main>:
push   %rax
xor    %eax,%eax
call   1030 <SOCKET_initialization@plt>
xor    %eax,%eax
call   1040 <SOCKET_prepare@plt>
xor    %eax,%eax
call   1050 <SOCKET_run@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <SOCKET_stop@plt>

LLVM IR (-O0):
define void @SOCKET_main() {
%1 = call i32 (...) @SOCKET_initialization()
%2 = call i32 (...) @SOCKET_prepare()
%3 = call i32 (...) @SOCKET_run()
%4 = call i32 (...) @SOCKET_stop()
ret void
}

LLVM IR (-O2):
define void @SOCKET_main() {
%1 = tail call i32 (...) @SOCKET_initialization()
%2 = tail call i32 (...) @SOCKET_prepare()
%3 = tail call i32 (...) @SOCKET_run()
%4 = tail call i32 (...) @SOCKET_stop()
ret void
}
void foo309() {}


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

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

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

LLVM IR (-O2):
define void @foo309() {
ret void
}
int execute_sync_file_range() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_sync_file_range() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INET_ADDRSTRLEN;
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, struct in_addr *, char *,
                             int /*<<< orphan*/);
char *human_readable_IPV4_from_number(const uint32_t ip, char *ip_str) {
  struct in_addr addr;
  addr.s_addr = ip;
  inet_ntop(AF_INET, &addr, ip_str, INET_ADDRSTRLEN);
  return ip_str;
}


x86 assembly (clang, -O0):
<human_readable_IPV4_from_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    0x2e9f(%rip),%rax
mov    (%rax),%ecx
lea    -0x18(%rbp),%rsi
call   1030 <inet_ntop@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<human_readable_IPV4_from_number>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0x8(%rsp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdx
call   1030 <inet_ntop@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
@INET_ADDRSTRLEN = global i32 0
define i8* @human_readable_IPV4_from_number(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.in_addr
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* @AF_INET
%9 = load i8*, i8** %4
%10 = load i32, i32* @INET_ADDRSTRLEN
%11 = call i32 @inet_ntop(i32 %8, %struct.in_addr* %5, i8* %9, i32 %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
@INET_ADDRSTRLEN = global i32 0
define i8* @human_readable_IPV4_from_number(i32 %0, i8* returned %1) {
%3 = alloca %struct.in_addr
%4 = bitcast %struct.in_addr* %3 to i8*
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = load i32, i32* @AF_INET
%7 = load i32, i32* @INET_ADDRSTRLEN
%8 = call i32 @inet_ntop(i32 %6, %struct.in_addr* %3, i8* %1, i32 %7)
ret i8* %1
}
int main(void) {
  char c, *c0 = malloc(0), *c1;
  c = *c0;
  c0 = realloc(c0, 10);
  assert(c0);
  c = *c0;
  c1 = c0;
  c0 = realloc(c0, 0);
  assert(!c0);
  c = *c1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x5(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <malloc@plt>
mov    $0xa,%esi
mov    %rax,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %eax,%eax
call   1030 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <realloc@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
xor    %eax,%eax
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i8* @malloc(i64 0)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %2
%8 = load i8*, i8** %3
%9 = call i8* @realloc(i8* %8, i64 10)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %10)
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
store i8 %13, i8* %2
%14 = load i8*, i8** %3
store i8* %14, i8** %4
%15 = load i8*, i8** %3
%16 = call i8* @realloc(i8* %15, i64 0)
store i8* %16, i8** %3
%17 = load i8*, i8** %3
%18 = icmp ne i8* %17, null
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
%21 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %20)
%22 = load i8*, i8** %4
%23 = load i8, i8* %22
store i8 %23, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @malloc(i64 0)
%2 = tail call dereferenceable_or_null(10) i8* @realloc(i8* %1, i64 10)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %2)
%4 = tail call i8* @realloc(i8* %2, i64 0)
%5 = icmp eq i8* %4, null
%6 = zext i1 %5 to i32
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %6)
ret i32 0
}
void video_set_window_pos(int x0, int y0) {}


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

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

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

LLVM IR (-O2):
define void @video_set_window_pos(i32 %0, i32 %1) {
ret void
}
long long dist(long long a, long long b) {
  int count;
  while (a != b) {
    if (a > b) {
      a = a >> 1;
      count += 1;
    } else {
      b = b >> 1;
      count += 1;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     115c <dist+0x5c>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1142 <dist+0x42>
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <dist+0x57>
mov    -0x10(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110c <dist+0xc>
movslq -0x14(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
cmp    %rsi,%rdi
jne    1108 <dist+0x8>
xor    %eax,%eax
ret
nopl   0x0(%rax,%rax,1)
cmp    %rsi,%rdi
setle  %al
setg   %cl
sar    %cl,%rdi
mov    %eax,%ecx
sar    %cl,%rsi
add    $0x1,%edx
cmp    %rsi,%rdi
jne    1110 <dist+0x10>
movslq %edx,%rax
ret

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

LLVM IR (-O2):
define i64 @dist(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %18, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %14, %4 ], [ undef, %2 ]
%6 = phi i64 [ %13, %4 ], [ %1, %2 ]
%7 = phi i64 [ %10, %4 ], [ %0, %2 ]
%8 = icmp sgt i64 %7, %6
%9 = zext i1 %8 to i64
%10 = ashr i64 %7, %9
%11 = xor i1 %8, true
%12 = zext i1 %11 to i64
%13 = ashr i64 %6, %12
%14 = add nsw i32 %5, 1
%15 = icmp eq i64 %10, %13
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = sext i32 %14 to i64
br label %18
18: ; preds = %16, %2
%19 = phi i64 [ 0, %2 ], [ %17, %16 ]
ret i64 %19
}
/* Variables and functions */
int tool_main(int, char **);
int main() {
  static char *argv[4] = {"mkg3states", "-c", "const", "tif_fax3sm.c"};
  return tool_main(4, argv);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0x2f19(%rip),%rsi
mov    $0x4,%edi
jmp    1030 <tool_main@plt>

LLVM IR (-O0):
@main.argv = internal global [4 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i32 0, i32 0)]
@.str = [11 x i8] c"mkg3states\00"
@.str.1 = [3 x i8] c"-c\00"
@.str.2 = [6 x i8] c"const\00"
@.str.3 = [13 x i8] c"tif_fax3sm.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @tool_main(i32 4, i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @main.argv, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@main.argv = internal global [4 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i32 0, i32 0)]
@.str = [11 x i8] c"mkg3states\00"
@.str.1 = [3 x i8] c"-c\00"
@.str.2 = [6 x i8] c"const\00"
@.str.3 = [13 x i8] c"tif_fax3sm.c\00"
define i32 @main() {
%1 = tail call i32 @tool_main(i32 4, i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @main.argv, i64 0, i64 0))
ret i32 %1
}
void gdk_screen_get_rgb_colormap() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_get_rgb_colormap() {
ret void
}
unsigned int fmt_uint(s, u)
register char *s;
register unsigned int u;
{
  register unsigned long l;
  l = u;
  return fmt_ulong(s, l);
}


x86 assembly (clang, -O0):
<fmt_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <fmt_ulong@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_uint>:
mov    %esi,%esi
xor    %eax,%eax
jmp    1030 <fmt_ulong@plt>

LLVM IR (-O0):
define i32 @fmt_uint(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %5
%10 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @fmt_ulong to i32 (i8*, i64, ...)*)(i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fmt_uint(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @fmt_ulong to i32 (i8*, i64, ...)*)(i8* %0, i64 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SAVE_EA() {
  addbyte(0x89);
  addbyte(0x44);
  addbyte(0x24);
  addbyte(12);
}


x86 assembly (clang, -O0):
<SAVE_EA>:
push   %rbp
mov    %rsp,%rbp
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x24,%edi
call   1030 <addbyte@plt>
mov    $0xc,%edi
call   1030 <addbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SAVE_EA>:
push   %rax
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x24,%edi
call   1030 <addbyte@plt>
mov    $0xc,%edi
pop    %rax
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SAVE_EA() {
%1 = call i32 @addbyte(i32 137)
%2 = call i32 @addbyte(i32 68)
%3 = call i32 @addbyte(i32 36)
%4 = call i32 @addbyte(i32 12)
ret void
}

LLVM IR (-O2):
define void @SAVE_EA() {
%1 = tail call i32 @addbyte(i32 137)
%2 = tail call i32 @addbyte(i32 68)
%3 = tail call i32 @addbyte(i32 36)
%4 = tail call i32 @addbyte(i32 12)
ret void
}
void change_bit(int nr, volatile void *addr) {
  asm volatile("btcl %1, %0" : "=m"(*(volatile long *)addr) : "Ir"(nr));
}


x86 assembly (clang, -O0):
<change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btc    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_bit>:
btc    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @change_bit(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 = bitcast i8* %5 to i64*
%7 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @change_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
tail call void asm sideeffect "btcl $1, $0", "=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
void test_5a(int idx) {
  int a[10];
  a[idx] = 5;
  __analyzer_eval(a[idx] == 5);
}


x86 assembly (clang, -O0):
<test_5a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movl   $0x5,-0x30(%rbp,%rax,4)
movslq -0x4(%rbp),%rax
cmpl   $0x5,-0x30(%rbp,%rax,4)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_5a>:
mov    $0x1,%edi
jmp    1030 <__analyzer_eval@plt>

LLVM IR (-O0):
define void @test_5a(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %5
store i32 5, i32* %6
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 5
%12 = zext i1 %11 to i32
%13 = call i32 @__analyzer_eval(i32 %12)
ret void
}

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


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

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

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

LLVM IR (-O2):
define i32 @MUSIC_SongPlaying() {
%1 = tail call i32 (...) @MIDI_SongPlaying()
ret i32 %1
}