xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ FAIL(char *);
int /*<<< orphan*/ PASS(char *);
scalar_t__ foo();
int main() {
  if (foo() != 0) {
    FAIL("lazy-dylib-missing-dylib: foo found");
    return 0;
  }
  PASS("lazy-dylib-missing-dylib");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
cmp    $0x0,%rax
je     1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1050 <FAIL@plt>
movl   $0x0,-0x4(%rbp)
jmp    117b <main+0x4b>
lea    0xeb5(%rip),%rdi
call   1040 <PASS@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
test   %rax,%rax
je     114b <main+0x1b>
lea    0xebc(%rip),%rdi
call   1050 <FAIL@plt>
jmp    1157 <main+0x27>
lea    0xed2(%rip),%rdi
call   1040 <PASS@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"lazy-dylib-missing-dylib: foo found\00"
@.str.1 = [25 x i8] c"lazy-dylib-missing-dylib\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @FAIL(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 @PASS(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [36 x i8] c"lazy-dylib-missing-dylib: foo found\00"
@.str.1 = [25 x i8] c"lazy-dylib-missing-dylib\00"
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @FAIL(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 @PASS(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgetc(int /*<<< orphan*/ *);
void skipb(FILE *fp, long start) {
  long x = 0;
  while (x < start) {
    fgetc(fp);
    x++;
  }
  return;
}


x86 assembly (clang, -O0):
<skipb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1150 <skipb+0x40>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <skipb+0x18>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @skipb(i32* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fgetc(i32* %0)
%7 = add nuw nsw i64 %5, 1
%8 = icmp eq i64 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) { printf("Hello World!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int sub2() { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @sub2() {
ret i32 2
}
void os_trace_isr_enter(void) {}


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

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

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

LLVM IR (-O2):
define void @os_trace_isr_enter() {
ret void
}
int numLength(int n) {
  int result = 1;
  while (n != 1) {
    result++;
    if (n % 2) {
      n *= 3;
      n++;
    } else {
      n = n / 2;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<numLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     115d <numLength+0x5d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114a <numLength+0x4a>
imul   $0x3,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <numLength+0x58>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <numLength+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numLength>:
mov    $0x1,%eax
cmp    $0x1,%edi
jne    110b <numLength+0xb>
ret
mov    $0x1,%eax
jmp    1133 <numLength+0x33>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    %ecx,%edi
add    $0x1,%eax
cmp    $0x1,%edi
je     110a <numLength+0xa>
test   $0x1,%dil
je     1120 <numLength+0x20>
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
jmp    112b <numLength+0x2b>

LLVM IR (-O0):
define i32 @numLength(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %21, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = srem i32 %10, 2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %7
%14 = load i32, i32* %2
%15 = mul nsw i32 %14, 3
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %21
18: ; preds = %7
%19 = load i32, i32* %2
%20 = sdiv i32 %19, 2
store i32 %20, i32* %2
br label %21
21: ; preds = %18, %13
br label %4
22: ; preds = %4
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @numLength(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %14
%4 = phi i32 [ %6, %14 ], [ 1, %1 ]
%5 = phi i32 [ %15, %14 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = mul nsw i32 %5, 3
%11 = add nsw i32 %10, 1
br label %14
12: ; preds = %3
%13 = sdiv i32 %5, 2
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ %11, %9 ], [ %13, %12 ]
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %3
17: ; preds = %14, %1
%18 = phi i32 [ 1, %1 ], [ %6, %14 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x01() {
  Assert_real((ispunct(1) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              10, ("ispunct should be 0 for 0x01"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x01>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xa,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x01>:
push   %rax
mov    $0x1,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xa,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x01\00"
define void @t_ispunct_0x01() {
%1 = call i64 @ispunct(i32 1)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x01\00"
define void @t_ispunct_0x01() {
%1 = tail call i64 @ispunct(i32 1)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ task1();
int main(int argc, char *argv[]) {
  task1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @task1()
ret i32 0
}
void write_msr(unsigned int msr, unsigned long val) {
  asm volatile("wrmsr" : : "c"(msr), "a"(val), "d"(val >> 32) : "memory");
}


x86 assembly (clang, -O0):
<write_msr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rdx
shr    $0x20,%rdx
wrmsr
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_msr>:
mov    %rsi,%rax
mov    %edi,%ecx
mov    %rsi,%rdx
shr    $0x20,%rdx
wrmsr
ret

LLVM IR (-O0):
define void @write_msr(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = load i64, i64* %4
%8 = lshr i64 %7, 32
ret void
}

LLVM IR (-O2):
define void @write_msr(i32 %0, i64 %1) {
%3 = lshr i64 %1, 32
tail call void asm sideeffect "wrmsr", "{cx},{ax},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0, i64 %1, i64 %3)
ret void
}
/* Variables and functions */
int UTF8_putc(int /*<<< orphan*/ *, int, unsigned long);
int out_utf8(unsigned long value, void *arg) {
  int *outlen;
  int ret;
  outlen = arg;
  ret = UTF8_putc(NULL, -1, value);
  if (ret < 0)
    return ret;
  *outlen += ret;
  return 1;
}


x86 assembly (clang, -O0):
<out_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1030 <UTF8_putc@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1152 <out_utf8+0x42>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <out_utf8+0x54>
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_utf8>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <UTF8_putc@plt>
test   %eax,%eax
js     112e <out_utf8+0x1e>
add    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @out_utf8(i64 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @UTF8_putc(i32* null, i32 -1, i64 %0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* %3
%8 = add nsw i32 %7, %4
store i32 %8, i32* %3
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ 1, %6 ], [ %4, %2 ]
ret i32 %10
}
void smb349_test_limit_up(int on) {}


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

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

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

LLVM IR (-O2):
define void @smb349_test_limit_up(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int html_comment(char *);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int html_datetime(char *fmt) {
  time_t tp;
  char buf[64];
  tp = time(&tp);
  strftime(buf, sizeof(buf), fmt, localtime(&tp));
  return html_comment(buf);
}


x86 assembly (clang, -O0):
<html_datetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <localtime@plt>
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rdx
mov    %eax,%ecx
mov    $0x40,%esi
call   1060 <strftime@plt>
lea    -0x50(%rbp),%rdi
call   1030 <html_comment@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_datetime>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%r14
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
mov    %rbx,%rdi
call   1040 <localtime@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r14,%rdx
mov    %eax,%ecx
call   1060 <strftime@plt>
mov    %rbx,%rdi
call   1030 <html_comment@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @html_datetime(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [64 x i8]
store i8* %0, i8** %2
%5 = call i32 @time(i32* %3)
store i32 %5, i32* %3
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @localtime(i32* %3)
%9 = call i32 @strftime(i8* %6, i32 64, i8* %7, i32 %8)
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%11 = call i32 @html_comment(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @html_datetime(i8* %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%6 = call i32 @time(i32* %2)
store i32 %6, i32* %2
%7 = call i32 @localtime(i32* %2)
%8 = call i32 @strftime(i8* %5, i32 64, i8* %0, i32 %7)
%9 = call i32 @html_comment(i8* %5)
ret i32 %9
}
outhexw(number) int number;
{
  leaderx();
  hex(number);
}


x86 assembly (clang, -O0):
<outhexw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <leaderx@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <hex@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outhexw>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <leaderx@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <hex@plt>

LLVM IR (-O0):
define i32 @outhexw(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @leaderx()
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @hex to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @outhexw(i32 %0) {
%2 = tail call i32 (...) @leaderx()
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @hex to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
ssize_t netio_null_send(void *null_ptr, void *pkt, size_t pkt_len) {
  return (pkt_len);
}


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

x86 assembly (clang, -O2):
<netio_null_send>:
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @netio_null_send(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 returned %2) {
ret i64 %2
}
/* Type definitions */
struct fb_var_screeninfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FBIOGET_VSCREENINFO;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct fb_var_screeninfo *);
int /*<<< orphan*/ print_strerror_and_exit(char *);
void tfbm_get_var_screen_info(int fh, struct fb_var_screeninfo *var) {
  if (ioctl(fh, FBIOGET_VSCREENINFO, var)) {
    print_strerror_and_exit("ioctl FBIOGET_VSCREENINFO");
  }
}


x86 assembly (clang, -O0):
<tfbm_get_var_screen_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
je     115a <tfbm_get_var_screen_info+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <print_strerror_and_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfbm_get_var_screen_info>:
push   %rax
mov    %rsi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1040 <ioctl@plt>
test   %rax,%rax
je     1144 <tfbm_get_var_screen_info+0x24>
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1030 <print_strerror_and_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.fb_var_screeninfo = type { i32 }
@FBIOGET_VSCREENINFO = global i32 0
@.str = [26 x i8] c"ioctl FBIOGET_VSCREENINFO\00"
define void @tfbm_get_var_screen_info(i32 %0, %struct.fb_var_screeninfo* %1) {
%3 = alloca i32
%4 = alloca %struct.fb_var_screeninfo*
store i32 %0, i32* %3
store %struct.fb_var_screeninfo* %1, %struct.fb_var_screeninfo** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @FBIOGET_VSCREENINFO
%7 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %4
%8 = call i64 @ioctl(i32 %5, i32 %6, %struct.fb_var_screeninfo* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @print_strerror_and_exit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.fb_var_screeninfo = type { i32 }
@FBIOGET_VSCREENINFO = global i32 0
@.str = [26 x i8] c"ioctl FBIOGET_VSCREENINFO\00"
define void @tfbm_get_var_screen_info(i32 %0, %struct.fb_var_screeninfo* %1) {
%3 = load i32, i32* @FBIOGET_VSCREENINFO
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.fb_var_screeninfo* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @print_strerror_and_exit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
bool nrf52_errata_66(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_66() {
ret i32 0
}
int main() {
  int x;
  x = 2;
  if (!(x == 2))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1128 <main+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <main+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%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 2, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
const char *nfs_server_fscache_state(struct nfs_server *server) {
  return "no ";
}


x86 assembly (clang, -O0):
<nfs_server_fscache_state>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.nfs_server = type opaque
@.str = [4 x i8] c"no \00"
define i8* @nfs_server_fscache_state(%struct.nfs_server* %0) {
%2 = alloca %struct.nfs_server*
store %struct.nfs_server* %0, %struct.nfs_server** %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.nfs_server = type opaque
@.str = [4 x i8] c"no \00"
define i8* @nfs_server_fscache_state(%struct.nfs_server* nocapture readnone %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
void foo(float f_gain1, int n_tail, float *__restrict__ f_in_hptr,
         float *__restrict__ f_out_hptr) {
  int i;
  __attribute__((__spu_vector__)) float *v_f_in_hptr, *v_f_out_hptr;
  f_in_hptr = (float *)v_f_in_hptr;
  f_out_hptr = (float *)v_f_out_hptr;
  for (i = 0; i < n_tail; i++) {
    f_out_hptr[0] = f_in_hptr[0] * f_gain1;
    f_in_hptr++;
    f_out_hptr++;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <foo+0x72>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mulss  -0x4(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <foo+0x2b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(float %0, i32 %1, float* noalias %2, float* noalias %3) {
%5 = alloca float
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca i32
%10 = alloca float*
%11 = alloca float*
store float %0, float* %5
store i32 %1, i32* %6
store float* %2, float** %7
store float* %3, float** %8
%12 = load float*, float** %10
store float* %12, float** %7
%13 = load float*, float** %11
store float* %13, float** %8
store i32 0, i32* %9
br label %14
14: ; preds = %30, %4
%15 = load i32, i32* %9
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %33
18: ; preds = %14
%19 = load float*, float** %7
%20 = getelementptr inbounds float, float* %19, i64 0
%21 = load float, float* %20
%22 = load float, float* %5
%23 = fmul float %21, %22
%24 = load float*, float** %8
%25 = getelementptr inbounds float, float* %24, i64 0
store float %23, float* %25
%26 = load float*, float** %7
%27 = getelementptr inbounds float, float* %26, i32 1
store float* %27, float** %7
%28 = load float*, float** %8
%29 = getelementptr inbounds float, float* %28, i32 1
store float* %29, float** %8
br label %30
30: ; preds = %18
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %14
33: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @foo(float %0, i32 %1, float* noalias nocapture readnone %2, float* noalias nocapture readnone %3) {
%5 = icmp slt i32 %1, 1
ret void
}
char fooc(char x) { return -(x == 0); }


x86 assembly (clang, -O0):
<fooc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooc>:
cmp    $0x1,%dil
sbb    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @fooc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = sub nsw i32 0, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @fooc(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = sext i1 %2 to i8
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_swap_stack(void) { output_line("swap (sp) r1"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"swap (sp) r1\00"
define void @gen_swap_stack() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"swap (sp) r1\00"
define void @gen_swap_stack() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_52int8_reg(signed char val) {
  return ((val) & (-0x52 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_52int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffae,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_52int8_reg(i8 signext %0) {
%2 = and i8 %0, -82
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void exit_error(const char *what) {
  printf("ERROR: %s\n", what);
  exit(1);
}


x86 assembly (clang, -O0):
<exit_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @exit_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @exit_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int getchar();
int get16(void) {
  int b1 = getchar();
  int b2 = getchar();
  return ((b1 << 8) & 0xff00) | (b2 & 0xff);
}


x86 assembly (clang, -O0):
<get16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
shl    $0x8,%ebx
movzwl %bx,%ecx
movzbl %al,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get16() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = shl i32 %5, 8
%7 = and i32 %6, 65280
%8 = load i32, i32* %2
%9 = and i32 %8, 255
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @get16() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 (...) @getchar()
%3 = shl i32 %1, 8
%4 = and i32 %3, 65280
%5 = and i32 %2, 255
%6 = or i32 %4, %5
ret i32 %6
}
int Factor(int number) {
  int i, count = 0;
  for (i = 1; i <= number; i++) {
    if (number % i == 0)
      count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<Factor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114d <Factor+0x4d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    113a <Factor+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <Factor+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <Factor+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Factor>:
test   %edi,%edi
jle    1115 <Factor+0x15>
mov    %edi,%r9d
cmp    $0x1,%edi
jne    1118 <Factor+0x18>
mov    $0x1,%esi
xor    %ecx,%ecx
jmp    1153 <Factor+0x53>
xor    %eax,%eax
ret
mov    %r9d,%r8d
and    $0xfffffffe,%r8d
mov    $0x1,%esi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %r9d,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
adc    $0x0,%ecx
lea    0x1(%rsi),%edi
mov    %r9d,%eax
cltd
idiv   %edi
cmp    $0x1,%edx
adc    $0x0,%ecx
add    $0x2,%esi
cmp    %r8d,%edi
jne    1130 <Factor+0x30>
test   $0x1,%r9b
je     1165 <Factor+0x65>
mov    %r9d,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
adc    $0x0,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Factor(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %34, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %0, 1
br i1 %5, label %24, label %6
6: ; preds = %3
%7 = and i32 %0, -2
br label %8
8: ; preds = %8, %6
%9 = phi i32 [ 0, %6 ], [ %20, %8 ]
%10 = phi i32 [ 1, %6 ], [ %21, %8 ]
%11 = phi i32 [ 0, %6 ], [ %22, %8 ]
%12 = srem i32 %0, %10
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %9, %14
%16 = add nuw i32 %10, 1
%17 = srem i32 %0, %16
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = add nuw nsw i32 %15, %19
%21 = add nuw i32 %10, 2
%22 = add i32 %11, 2
%23 = icmp eq i32 %22, %7
br i1 %23, label %24, label %8
24: ; preds = %8, %3
%25 = phi i32 [ undef, %3 ], [ %20, %8 ]
%26 = phi i32 [ 0, %3 ], [ %20, %8 ]
%27 = phi i32 [ 1, %3 ], [ %21, %8 ]
%28 = icmp eq i32 %4, 0
br i1 %28, label %34, label %29
29: ; preds = %24
%30 = srem i32 %0, %27
%31 = icmp eq i32 %30, 0
%32 = zext i1 %31 to i32
%33 = add nuw nsw i32 %26, %32
br label %34
34: ; preds = %29, %24, %1
%35 = phi i32 [ 0, %1 ], [ %25, %24 ], [ %33, %29 ]
ret i32 %35
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *get_simple_uid(char *);
int /*<<< orphan*/ write(char *, char *, char *);
void function_auname(char *auname) {
  char *uid = get_simple_uid(auname);
  write("msproject.xml", "\t<ResourceUID>%s</ResourceUID>\n", uid);
  free(uid);
}


x86 assembly (clang, -O0):
<function_auname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <get_simple_uid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <write@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_auname>:
push   %rbx
call   1050 <get_simple_uid@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    %rax,%rdx
call   1040 <write@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [32 x i8] c"\09<ResourceUID>%s</ResourceUID>\0A\00"
define void @function_auname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @get_simple_uid(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [32 x i8] c"\09<ResourceUID>%s</ResourceUID>\0A\00"
define void @function_auname(i8* %0) {
%2 = tail call i8* @get_simple_uid(i8* %0)
%3 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
void board_init(void) {}


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

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

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

LLVM IR (-O2):
define void @board_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void init_pic(void) {
  outb(0x20, 0x11);
  outb(0x21, 0x20);
  outb(0x21, 0x04);
  outb(0x21, 0x01);
  outb(0xa0, 0x11);
  outb(0xa1, 0x28);
  outb(0xa1, 0x02);
  outb(0xa1, 0x01);
  outb(0x20, 0x0);
  outb(0xa0, 0x0);
}


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

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

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

LLVM IR (-O2):
define void @init_pic() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 33, i32 32)
%3 = tail call i32 @outb(i32 33, i32 4)
%4 = tail call i32 @outb(i32 33, i32 1)
%5 = tail call i32 @outb(i32 160, i32 17)
%6 = tail call i32 @outb(i32 161, i32 40)
%7 = tail call i32 @outb(i32 161, i32 2)
%8 = tail call i32 @outb(i32 161, i32 1)
%9 = tail call i32 @outb(i32 32, i32 0)
%10 = tail call i32 @outb(i32 160, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_newtag();
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void luaB_newtag(void) { lua_pushnumber(lua_newtag()); }


x86 assembly (clang, -O0):
<luaB_newtag>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <lua_newtag@plt>
mov    %eax,%edi
call   1030 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaB_newtag>:
push   %rax
xor    %eax,%eax
call   1040 <lua_newtag@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @luaB_newtag() {
%1 = call i32 (...) @lua_newtag()
%2 = call i32 @lua_pushnumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @luaB_newtag() {
%1 = tail call i32 (...) @lua_newtag()
%2 = tail call i32 @lua_pushnumber(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *strdup_chk(char *, char *);
int main() {
  char *dst, *src = "abcdefghijklmnopqrstuvwxyz";
  dst = strdup_chk(src, "strdup_chk unit test");
  printf("%s\n", dst);
  {
    free(dst);
    dst = NULL;
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1050 <strdup_chk@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1050 <strdup_chk@plt>
mov    %rax,%rbx
lea    0xee2(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [21 x i8] c"strdup_chk unit test\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = call i8* @strdup_chk(i8* %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
store i8* null, i8** %2
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [21 x i8] c"strdup_chk unit test\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @strdup_chk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
int foo(int bar) {
  if (bar)
    return (1);
  if (bar % 2)
    return (1 + bar);
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <foo+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1146 <foo+0x46>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113f <foo+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <foo+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int ft_base_length(char *base) {
  int length;
  length = 0;
  while (*base != '\0') {
    length++;
    base++;
  }
  return (length);
}


x86 assembly (clang, -O0):
<ft_base_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <ft_base_length+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <ft_base_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_base_length>:
cmpb   $0x0,(%rdi)
je     111c <ft_base_length+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ft_base_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_base_length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cmd_usage_add(void) {
  printf("usage: mdp a[dd] [-h] [-p profile] [-n count] [-l length]\n");
  printf("                 [-k key_id] [keywords ...]\n");
}


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

x86 assembly (clang, -O2):
<cmd_usage_add>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf16(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"usage: mdp a[dd] [-h] [-p profile] [-n count] [-l length]\0A\00"
@.str.1 = [45 x i8] c" [-k key_id] [keywords ...]\0A\00"
define void @cmd_usage_add() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [58 x i8] c"usage: mdp a[dd] [-h] [-p profile] [-n count] [-l length]\00"
@str.2 = [44 x i8] c" [-k key_id] [keywords ...]\00"
define void @cmd_usage_add() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr,
          "Usage: generic_buffer [options]...\n"
          "Capture, convert and output data from IIO device buffer\n"
          "  -a         Auto-activate all available channels\n"
          "  -c <n>     Do n conversions\n"
          "  -e         Disable wait for event (new data)\n"
          "  -g         Use trigger-less mode\n"
          "  -l <n>     Set buffer length to n samples\n"
          "  --device-name -n <name>\n"
          "  --device-num -N <num>\n"
          "        Set device by name or number (mandatory)\n"
          "  --trigger-name -t <name>\n"
          "  --trigger-num -T <num>\n"
          "        Set trigger by name or number\n"
          "  -w <n>     Set delay between reads in us (event-less mode)\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [548 x i8] c"Usage: generic_buffer [options]...\0ACapture, convert and output data from IIO device buffer\0A -a Auto-activate all available channels\0A -c <n> Do n conversions\0A -e Disable wait for event (new data)\0A -g Use trigger-less mode\0A -l <n> Set buffer length to n samples\0A --device-name -n <name>\0A --device-num -N <num>\0A Set device by name or number (mandatory)\0A --trigger-name -t <name>\0A --trigger-num -T <num>\0A Set trigger by name or number\0A -w <n> Set delay between reads in us (event-less mode)\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([548 x i8], [548 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [548 x i8] c"Usage: generic_buffer [options]...\0ACapture, convert and output data from IIO device buffer\0A -a Auto-activate all available channels\0A -c <n> Do n conversions\0A -e Disable wait for event (new data)\0A -g Use trigger-less mode\0A -l <n> Set buffer length to n samples\0A --device-name -n <name>\0A --device-num -N <num>\0A Set device by name or number (mandatory)\0A --trigger-name -t <name>\0A --trigger-num -T <num>\0A Set trigger by name or number\0A -w <n> Set delay between reads in us (event-less mode)\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([548 x i8], [548 x i8]* @.str, i64 0, i64 0))
ret void
}