xunge/DecIR huggingface dataset:
int add(int x, int y) {
  __asm__ volatile("nop\n\t"
                   "nop\n\t"
                   "addl %0, %1\n\t"
                   "movl %1, %%eax\n\t"
                   "nop\n\t"
                   "nop\n\t"
                   :
                   : "r"(x), "r"(y)
                   : "%eax");
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
nop
nop
add    %ecx,%edx
mov    %edx,%eax
nop
nop
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @add(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* %4
%7 = load i32, i32* %5
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
tail call void asm sideeffect "nop\0A\09nop\0A\09addl $0, $1\0A\09movl $1, %eax\0A\09nop\0A\09nop\0A\09", "r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ezbc_initialize_sc_cxts();
int /*<<< orphan*/ ezbc_initialize_zc_cxts();
void ezbc_init() {
  ezbc_initialize_zc_cxts();
  ezbc_initialize_sc_cxts();
}


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

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

LLVM IR (-O0):
define void @ezbc_init() {
%1 = call i32 (...) @ezbc_initialize_zc_cxts()
%2 = call i32 (...) @ezbc_initialize_sc_cxts()
ret void
}

LLVM IR (-O2):
define void @ezbc_init() {
%1 = tail call i32 (...) @ezbc_initialize_zc_cxts()
%2 = tail call i32 (...) @ezbc_initialize_sc_cxts()
ret void
}
void RTR3InitExe(void) {}


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

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

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

LLVM IR (-O2):
define void @RTR3InitExe() {
ret void
}
RCU_DEF_TEST_FUNC(user_f3, param) { RCU_FAIL_FATAL("user_f3"); }


x86 assembly (clang, -O0):
<RCU_DEF_TEST_FUNC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <RCU_FAIL_FATAL@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RCU_DEF_TEST_FUNC>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <RCU_FAIL_FATAL@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"user_f3\00"
define i32 @RCU_DEF_TEST_FUNC(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @RCU_FAIL_FATAL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"user_f3\00"
define i32 @RCU_DEF_TEST_FUNC(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @RCU_FAIL_FATAL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("USAGE : fmc -f .fmc [ -c ]\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"USAGE : fmc -f .fmc [ -c ]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"USAGE : fmc -f .fmc [ -c ]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ close_device();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void myerr(int level, char *s) {
  extern int errlev;
  if (level <= errlev)
    fprintf(stderr, "%s\n", s);
  if (!level) {
    close_device();
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<myerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%eax
jg     116a <myerr+0x3a>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1189 <myerr+0x59>
mov    $0x0,%al
call   1040 <close_device@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myerr>:
push   %rbx
mov    %edi,%ebx
mov    0x2e9e(%rip),%rax
cmp    %edi,(%rax)
jl     1156 <myerr+0x26>
mov    %rsi,%rdx
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
test   %ebx,%ebx
je     115c <myerr+0x2c>
pop    %rbx
ret
xor    %eax,%eax
call   1040 <close_device@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@errlev = external global i32
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @myerr(i32 %0, i8* %1) {
%3 = load i32, i32* @errlev
%4 = icmp slt i32 %3, %0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %5, %2
%9 = icmp eq i32 %0, 0
br i1 %9, label %10, label %14
10: ; preds = %8
%11 = tail call i32 (...) @close_device()
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ho_memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ write(int, int /*<<< orphan*/, int);
int main() {
  char buf[] = "12345";
  printf("%s\n", buf);
  write(1, ho_memset(buf, 0, 5), 5);
  printf("::\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <ho_memset@plt>
mov    %eax,%esi
mov    $0x1,%edi
mov    $0x5,%edx
call   1030 <write@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x35,0xc(%rsp)
movl   $0x34333231,0x8(%rsp)
34
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <ho_memset@plt>
mov    $0x1,%edi
mov    %eax,%esi
mov    $0x5,%edx
call   1040 <write@plt>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.buf = [6 x i8] c"12345\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"::\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 @ho_memset(i8* %6, i32 0, i32 5)
%8 = call i32 @write(i32 1, i32 %7, i32 5)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.buf = [6 x i8] c"12345\00"
@str = [3 x i8] c"::\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
%4 = call i32 @ho_memset(i8* %2, i32 0, i32 5)
%5 = call i32 @write(i32 1, i32 %4, i32 5)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
__attribute__((no, noclone)) signed __int128 t100_2add(signed __int128 y) {
  signed __int128 x = (2);
  signed __int128 r;
  if (__builtin_add_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x2,-0x40(%rbp)
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
add    %rsi,%rdx
adc    %rax,%rcx
seto   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t100_2add+0x5e>
jmp    1175 <t100_2add+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x2,%rbx
adc    $0x0,%r14
jno    112b <t100_2add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t100_2add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 2, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t100_2add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %6, i128 2)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
void customEvent(int id) {}


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

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

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

LLVM IR (-O2):
define void @customEvent(i32 %0) {
ret void
}
/* Variables and functions */
long nvmem_write(int, int, int /*<<< orphan*/, unsigned char *);
signed long aes_write_key(unsigned char *key) {
  signed long returnValue;
  returnValue = nvmem_write((12), 16, 0, key);
  return returnValue;
}


x86 assembly (clang, -O0):
<aes_write_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xc,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1030 <nvmem_write@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_write_key>:
mov    %rdi,%rcx
mov    $0xc,%edi
mov    $0x10,%esi
xor    %edx,%edx
jmp    1030 <nvmem_write@plt>

LLVM IR (-O0):
define i64 @aes_write_key(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @nvmem_write(i32 12, i32 16, i32 0, i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @aes_write_key(i8* %0) {
%2 = tail call i64 @nvmem_write(i32 12, i32 16, i32 0, i8* %0)
ret i64 %2
}
/* Type definitions */
struct timespec {
  int tv_sec;
  double tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
long long get_milliseconds() {
  struct timespec spec;
  clock_gettime(CLOCK_REALTIME, &spec);
  return (spec.tv_sec * 1000) + (spec.tv_nsec / 1.0e6);
}


x86 assembly (clang, -O0):
<get_milliseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xebe(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_milliseconds>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,0x8(%rsp),%eax
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
divsd  0xebf(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, double }
@CLOCK_REALTIME = global i32 0
define i64 @get_milliseconds() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %7, %10
%12 = fptosi double %11 to i64
ret i64 %12
}

LLVM IR (-O2):
%struct.timespec = type { i32, double }
@CLOCK_REALTIME = global i32 0
define i64 @get_milliseconds() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = sitofp i32 %7 to double
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load double, double* %9
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %11, %8
%13 = fptosi double %12 to i64
ret i64 %13
}
float calc_cpu_usage(float cpu, float tm) { return (cpu / tm) * 100.0; }


x86 assembly (clang, -O0):
<calc_cpu_usage>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_cpu_usage>:
divss  %xmm1,%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @calc_cpu_usage(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fdiv float %5, %6
%8 = fpext float %7 to double
%9 = fmul double %8, 1.000000e+02
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @calc_cpu_usage(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = fmul float %3, 1.000000e+02
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("list_version -s filename\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"list_version -s filename\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [25 x i8] c"list_version -s filename\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void ARGBToYRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToYRow_SSSE3() {
ret void
}
/* Variables and functions */
int b(int);
int g(int);
int f(int i) { return g(i) + b(i); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <g@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <b@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <g@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <b@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @g(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @b(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @g(i32 %0)
%3 = tail call i32 @b(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
void MSP430ClockM$MSP430ClockInit$initTimerB(void) {
  MSP430ClockM$MSP430ClockInit$default$initTimerB();
}


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

x86 assembly (clang, -O2):
<MSP430ClockM$MSP430ClockInit$initTimerB>:
xor    %eax,%eax
jmp    1030 <MSP430ClockM$MSP430ClockInit$default$initTimerB@plt>

LLVM IR (-O0):
define void @"MSP430ClockM$MSP430ClockInit$initTimerB"() {
%1 = call i32 (...) @"MSP430ClockM$MSP430ClockInit$default$initTimerB"()
ret void
}

LLVM IR (-O2):
define void @"MSP430ClockM$MSP430ClockInit$initTimerB"() {
%1 = tail call i32 (...) @"MSP430ClockM$MSP430ClockInit$default$initTimerB"()
ret void
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ config_change_save_config_layout_on_exit();
void config_change_save_layout_on_exit(const void *pointer, void *data,
                                       struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  config_change_save_config_layout_on_exit();
}


x86 assembly (clang, -O0):
<config_change_save_layout_on_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <config_change_save_config_layout_on_exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @config_change_save_layout_on_exit(i8* %0, i8* %1, %struct.t_config_option* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.t_config_option*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.t_config_option* %2, %struct.t_config_option** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.t_config_option*, %struct.t_config_option** %6
%10 = call i32 (...) @config_change_save_config_layout_on_exit()
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_change_save_layout_on_exit(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 (...) @config_change_save_config_layout_on_exit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ _debug(char *, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ iptables_fw_clear_authservers();
void fw_clear_authservers(void) {
  _debug("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/ForgotFun/wifidog/refs/heads/master/src/"
         "firewall.c",
         191, LOG_INFO, "Clearing the authservers list");
  iptables_fw_clear_authservers();
}


x86 assembly (clang, -O0):
<fw_clear_authservers>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
lea    0xecc(%rip),%rdi
mov    $0xbf,%esi
lea    0xf4d(%rip),%rcx
call   1040 <_debug@plt>
mov    $0x0,%al
call   1030 <iptables_fw_clear_authservers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_clear_authservers>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xf55(%rip),%rcx
mov    $0xbf,%esi
call   1040 <_debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <iptables_fw_clear_authservers@plt>

LLVM IR (-O0):
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ForgotFun/wifidog/refs/heads/master/src/firewall.c\00"
@LOG_INFO = global i32 0
@.str.1 = [30 x i8] c"Clearing the authservers list\00"
define void @fw_clear_authservers() {
%1 = load i32, i32* @LOG_INFO
%2 = call i32 @_debug(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 191, i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @iptables_fw_clear_authservers()
ret void
}

LLVM IR (-O2):
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ForgotFun/wifidog/refs/heads/master/src/firewall.c\00"
@LOG_INFO = global i32 0
@.str.1 = [30 x i8] c"Clearing the authservers list\00"
define void @fw_clear_authservers() {
%1 = load i32, i32* @LOG_INFO
%2 = tail call i32 @_debug(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 191, i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @iptables_fw_clear_authservers()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ wait(int *);
int close_pipe(FILE *fp) {
  fclose(fp);
  int status;
  wait(&status);
  return status;
}


x86 assembly (clang, -O0):
<close_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0xc(%rbp),%rdi
call   1040 <wait@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_pipe>:
push   %rax
call   1030 <fclose@plt>
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @close_pipe(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fclose(i32* %4)
%6 = call i32 @wait(i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @close_pipe(i32* nocapture %0) {
%2 = alloca i32
%3 = tail call i32 @fclose(i32* %0)
%4 = bitcast i32* %2 to i8*
%5 = call i32 @wait(i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
int check(int a) { return (a == 402); }


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

x86 assembly (clang, -O2):
<check>:
xor    %eax,%eax
cmp    $0x192,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check(i32 %0) {
%2 = icmp eq i32 %0, 402
%3 = zext i1 %2 to i32
ret i32 %3
}
main(t) {
  unsigned int u;
  for (t = u = 85;; t += u >> 2, u -= t >> 2)
    ;
  putchar(t + 128);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movl   $0x55,-0xc(%rbp)
movl   $0x55,-0x8(%rbp)
jmp    1121 <main+0x21>
mov    -0xc(%rbp),%eax
shr    $0x2,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sar    $0x2,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <main+0x1c>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
store i32 85, i32* %4
store i32 85, i32* %3
br label %5
5: ; preds = %6, %1
br label %6
6: ; preds = %5
%7 = load i32, i32* %4
%8 = lshr i32 %7, 2
%9 = load i32, i32* %3
%10 = add i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = ashr i32 %11, 2
%13 = load i32, i32* %4
%14 = sub i32 %13, %12
store i32 %14, i32* %4
br label %5
}

LLVM IR (-O2):
define i32 @main(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct portal_cred {
  int dummy;
};

/* Variables and functions */
int ENOEXEC;
int portal_exec(struct portal_cred *pcr, char *key, char **v, int *fdp) {
  return (ENOEXEC);
}


x86 assembly (clang, -O0):
<portal_exec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<portal_exec>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.portal_cred = type { i32 }
@ENOEXEC = global i32 0
define i32 @portal_exec(%struct.portal_cred* %0, i8* %1, i8** %2, i32* %3) {
%5 = alloca %struct.portal_cred*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32*
store %struct.portal_cred* %0, %struct.portal_cred** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32* %3, i32** %8
%9 = load i32, i32* @ENOEXEC
ret i32 %9
}

LLVM IR (-O2):
%struct.portal_cred = type { i32 }
@ENOEXEC = global i32 0
define i32 @portal_exec(%struct.portal_cred* nocapture readnone %0, i8* nocapture readnone %1, i8** nocapture readnone %2, i32* nocapture readnone %3) {
%5 = load i32, i32* @ENOEXEC
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
void callingFunction(const char *function, void *addr) {
  printf("Function %s at %p\n", function, addr);
  int (*f)(int n) = (int (*)(int n))addr;
  int r = f(5);
  printf("\t\t%s(5) = %d\n", function, r);
}


x86 assembly (clang, -O0):
<callingFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x5,%edi
call   *-0x18(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callingFunction>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    $0x5,%edi
call   *%rbx
lea    0xeda(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Function %s at %p\0A\00"
@.str.1 = [14 x i8] c"\09\09%s(5) = %d\0A\00"
define void @callingFunction(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32 (i32)*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9)
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32 (i32)*
store i32 (i32)* %12, i32 (i32)** %5
%13 = load i32 (i32)*, i32 (i32)** %5
%14 = call i32 %13(i32 5)
store i32 %14, i32* %6
%15 = load i8*, i8** %3
%16 = load i32, i32* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Function %s at %p\0A\00"
@.str.1 = [14 x i8] c"\09\09%s(5) = %d\0A\00"
define void @callingFunction(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
%6 = bitcast i8* %1 to i32 (i32)*
%7 = tail call i32 %6(i32 5)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ toupper(int);
void UpperCaseCopy(FILE *infile, FILE *outfile) {
  int ch;
  while ((ch = getc(infile)) != EOF) {
    putc(toupper(ch), outfile);
  }
}


x86 assembly (clang, -O0):
<UpperCaseCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
je     1173 <UpperCaseCopy+0x43>
mov    -0x14(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <putc@plt>
jmp    1140 <UpperCaseCopy+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpperCaseCopy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <getc@plt>
mov    0x2ea1(%rip),%r15
cmp    (%r15),%eax
je     116e <UpperCaseCopy+0x3e>
nopl   0x0(%rax)
mov    %eax,%edi
call   1030 <toupper@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <putc@plt>
mov    %rbx,%rdi
call   1050 <getc@plt>
cmp    (%r15),%eax
jne    1150 <UpperCaseCopy+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @UpperCaseCopy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %11, %2
%7 = load i32*, i32** %3
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i32, i32* %5
%13 = call i32 @toupper(i32 %12)
%14 = load i32*, i32** %4
%15 = call i32 @putc(i32 %13, i32* %14)
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @UpperCaseCopy(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ %3, %2 ]
%8 = tail call i32 @toupper(i32 %7)
%9 = tail call i32 @putc(i32 %8, i32* %1)
%10 = tail call i32 @getc(i32* %0)
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHA384Pad(int /*<<< orphan*/);
void PR10878() { SHA384Pad(0); }


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

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

LLVM IR (-O0):
define void @PR10878() {
%1 = call i32 @SHA384Pad(i32 0)
ret void
}

LLVM IR (-O2):
define void @PR10878() {
%1 = tail call i32 @SHA384Pad(i32 0)
ret void
}
void netcdf_WriteHeaderTS(int num_pts) {}


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

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

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

LLVM IR (-O2):
define void @netcdf_WriteHeaderTS(i32 %0) {
ret void
}
double svg_it_z(double x) { return x / 4096.0; }


x86 assembly (clang, -O0):
<svg_it_z>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<svg_it_z>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @svg_it_z(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 4.096000e+03
ret double %4
}

LLVM IR (-O2):
define double @svg_it_z(double %0) {
%2 = fmul double %0, 0x3F30000000000000
ret double %2
}
void pause() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @instruc_27() {
ret void
}
/* Variables and functions */
int ext_cmp(char const *, char const *);
int ast_extension_cmp(const char *a, const char *b) {
  int cmp;
  cmp = ext_cmp(a, b);
  if (cmp < 0) {
    return -1;
  }
  if (cmp > 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ast_extension_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ext_cmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1146 <ast_extension_cmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <ast_extension_cmp+0x53>
cmpl   $0x0,-0x1c(%rbp)
jle    115c <ast_extension_cmp+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <ast_extension_cmp+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ast_extension_cmp>:
push   %rax
call   1030 <ext_cmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ast_extension_cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @ext_cmp(i8* %7, i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %18
13: ; preds = %2
%14 = load i32, i32* %6
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %3
br label %18
17: ; preds = %13
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @ast_extension_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @ext_cmp(i8* %0, i8* %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp sgt i32 %3, -1
%7 = select i1 %6, i32 %5, i32 -1
ret i32 %7
}
/* Variables and functions */
int jpeg_get_bits(int);
int huffman_get_value(int size) {
  int val = 0;
  if (size == 0)
    val = 0;
  else {
    val = jpeg_get_bits(size);
    if (!(val & (1 << (size - 1))))
      val = val - (1 << size) + 1;
  }
  return val;
}


x86 assembly (clang, -O0):
<huffman_get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1138 <huffman_get_value+0x28>
movl   $0x0,-0x8(%rbp)
jmp    117c <huffman_get_value+0x6c>
mov    -0x4(%rbp),%edi
call   1030 <jpeg_get_bits@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1177 <huffman_get_value+0x67>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <huffman_get_value+0x6c>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<huffman_get_value>:
push   %rbx
test   %edi,%edi
je     1129 <huffman_get_value+0x19>
mov    %edi,%ebx
call   1030 <jpeg_get_bits@plt>
lea    -0x1(%rbx),%ecx
movzbl %cl,%ecx
bt     %ecx,%eax
jae    112d <huffman_get_value+0x1d>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%edx
mov    %ebx,%ecx
shl    %cl,%edx
add    %edx,%eax
add    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @huffman_get_value(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call i32 @jpeg_get_bits(i32 %0)
%5 = add nsw i32 %0, -1
%6 = shl nuw i32 1, %5
%7 = and i32 %4, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = shl nsw i32 -1, %0
%11 = add nsw i32 %10, 1
%12 = add i32 %11, %4
br label %13
13: ; preds = %1, %3, %9
%14 = phi i32 [ %4, %3 ], [ %12, %9 ], [ 0, %1 ]
ret i32 %14
}
void max1363_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @max1363_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char const *, int, char const *);
__attribute__((weak, noreturn)) void
__aeabi_assert(const char *expr, const char *file, int line) {
  printf("\nassert error at %s:%d:%s\n", file, line, expr);
  abort();
}


x86 assembly (clang, -O0):
<__aeabi_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__aeabi_assert>:
push   %rax
mov    %rdi,%rcx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\0Aassert error at %s:%d:%s\0A\00"
define weak void @__aeabi_assert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0Aassert error at %s:%d:%s\0A\00"
define weak void @__aeabi_assert(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%5 = tail call i32 (...) @abort()
unreachable
}
void outports(unsigned short port, unsigned short data) {
  asm volatile("outw %1, %0" : : "dN"(port), "a"(data));
}


x86 assembly (clang, -O0):
<outports>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%ax
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outports>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outports(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outports(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
float frand() { return (float)(rand() + 1.0) / (RAND_MAX + 1.0); }


x86 assembly (clang, -O0):
<frand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec4(%rip),%xmm1
mov    0x2ea5(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<frand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xedb(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    0x2eb4(%rip),%rax
addsd  (%rax),%xmm1
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define float @frand() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 1.000000e+00
%4 = fptrunc double %3 to float
%5 = fpext float %4 to double
%6 = load double, double* @RAND_MAX
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %5, %7
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define float @frand() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 1.000000e+00
%4 = fptrunc double %3 to float
%5 = fpext float %4 to double
%6 = load double, double* @RAND_MAX
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %5, %7
%9 = fptrunc double %8 to float
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: wrap_write_gpio GPIO_PIN VAL\n"
                  "\tGPIO_PIN = 32 to 37,and 39\n"
                  "\tVAL = 0 or 1\n"
                  "\nThese ports are present on the LPC connector.\n"
                  "Read the WRAP board manual for details.\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [166 x i8] c"usage: wrap_write_gpio GPIO_PIN VAL\0A\09GPIO_PIN = 32 to 37,and 39\0A\09VAL = 0 or 1\0A\0AThese ports are present on the LPC connector.\0ARead the WRAP board manual for details.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [166 x i8] c"usage: wrap_write_gpio GPIO_PIN VAL\0A\09GPIO_PIN = 32 to 37,and 39\0A\09VAL = 0 or 1\0A\0AThese ports are present on the LPC connector.\0ARead the WRAP board manual for details.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
void touch_double(double *x) {}


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

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

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

LLVM IR (-O2):
define void @touch_double(double* nocapture %0) {
ret void
}
void wlc_xwayland_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @wlc_xwayland_terminate() {
ret void
}
/* Variables and functions */
char *find_next_token(char const **, unsigned int *);
char *variable_buffer_output(char *, char const *, unsigned int);
char *func_firstword(char *o, char **argv,
                     const char *funcname __attribute__((unused))) {
  unsigned int i;
  const char *words = argv[0];
  const char *p = find_next_token(&words, &i);
  if (p != 0)
    o = variable_buffer_output(o, p, i);
  return o;
}


x86 assembly (clang, -O0):
<func_firstword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <find_next_token@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     116f <func_firstword+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <variable_buffer_output@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_firstword>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rsi),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1040 <find_next_token@plt>
test   %rax,%rax
je     1156 <func_firstword+0x36>
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <variable_buffer_output@plt>
mov    %rax,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @func_firstword(i8* %0, i8** nocapture %1, i8* nocapture readnone %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = bitcast i32* %4 to i8*
%7 = bitcast i8** %5 to i8*
%8 = load i8*, i8** %1
store i8* %8, i8** %5
%9 = call i8* @find_next_token(i8** %5, i32* %4)
%10 = icmp eq i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i32, i32* %4
%13 = call i8* @variable_buffer_output(i8* %0, i8* %9, i32 %12)
br label %14
14: ; preds = %11, %3
%15 = phi i8* [ %13, %11 ], [ %0, %3 ]
ret i8* %15
}