xunge/DecIR huggingface dataset:
/* Variables and functions */
double luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
int /*<<< orphan*/ tan(double);
void math_tan(void) {
  lua_pushnumber(
      tan(((luaL_check_number(1)) * ((3.14159265358979323846) / 180.0))));
}


x86 assembly (clang, -O0):
<math_tan>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <tan@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_tan>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mulsd  0xebd(%rip),%xmm0
call   1050 <tan@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_tan() {
%1 = call double @luaL_check_number(i32 1)
%2 = fmul double %1, 0x3F91DF46A2529D39
%3 = call i32 @tan(double %2)
%4 = call i32 @lua_pushnumber(i32 %3)
ret void
}

LLVM IR (-O2):
define void @math_tan() {
%1 = tail call double @luaL_check_number(i32 1)
%2 = fmul double %1, 0x3F91DF46A2529D39
%3 = tail call i32 @tan(double %2)
%4 = tail call i32 @lua_pushnumber(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
unsigned char CheckId_OV7660(void) {
  unsigned char temp1;
  unsigned char temp2;
  VIM_SIF_I2cReadByte(0x0a, &temp1);
  VIM_SIF_I2cReadByte(0x0b, &temp2);
  if ((temp1 == 0x76) && (temp2 == 0x60))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CheckId_OV7660>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    $0xb,%edi
lea    -0x3(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0x76,%eax
jne    1157 <CheckId_OV7660+0x47>
movzbl -0x3(%rbp),%eax
cmp    $0x60,%eax
jne    1157 <CheckId_OV7660+0x47>
movb   $0x1,-0x1(%rbp)
jmp    115b <CheckId_OV7660+0x4b>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckId_OV7660>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0xa,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
lea    0x6(%rsp),%rsi
mov    $0xb,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0x7(%rsp),%al
xor    $0x76,%al
mov    0x6(%rsp),%cl
xor    $0x60,%cl
or     %al,%cl
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @CheckId_OV7660() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @VIM_SIF_I2cReadByte(i32 10, i8* %2)
%5 = call i32 @VIM_SIF_I2cReadByte(i32 11, i8* %3)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 118
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 96
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 1, i8* %1
br label %15
14: ; preds = %9, %0
store i8 0, i8* %1
br label %15
15: ; preds = %14, %13
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @CheckId_OV7660() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 10, i8* %1)
%4 = call i32 @VIM_SIF_I2cReadByte(i32 11, i8* %2)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 118
%7 = load i8, i8* %2
%8 = icmp eq i8 %7, 96
%9 = select i1 %6, i1 %8, i1 false
%10 = zext i1 %9 to i8
ret i8 %10
}
int DeviceSynchronize(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DeviceSynchronize() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_block_tests();
int /*<<< orphan*/ do_children_tests();
int /*<<< orphan*/ do_frozen_tests();
int /*<<< orphan*/ do_locals_tests();
int /*<<< orphan*/ do_special_tests();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  do_locals_tests();
  do_block_tests();
  do_children_tests();
  do_special_tests();
  do_frozen_tests();
  exit(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   1060 <do_locals_tests@plt>
mov    $0x0,%al
call   1040 <do_block_tests@plt>
mov    $0x0,%al
call   1050 <do_children_tests@plt>
mov    $0x0,%al
call   1030 <do_special_tests@plt>
mov    $0x0,%al
call   1070 <do_frozen_tests@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <do_locals_tests@plt>
xor    %eax,%eax
call   1040 <do_block_tests@plt>
xor    %eax,%eax
call   1050 <do_children_tests@plt>
xor    %eax,%eax
call   1030 <do_special_tests@plt>
xor    %eax,%eax
call   1070 <do_frozen_tests@plt>
xor    %edi,%edi
call   1080 <exit@plt>

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 (...) @do_locals_tests()
%7 = call i32 (...) @do_block_tests()
%8 = call i32 (...) @do_children_tests()
%9 = call i32 (...) @do_special_tests()
%10 = call i32 (...) @do_frozen_tests()
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_locals_tests()
%4 = tail call i32 (...) @do_block_tests()
%5 = tail call i32 (...) @do_children_tests()
%6 = tail call i32 (...) @do_special_tests()
%7 = tail call i32 (...) @do_frozen_tests()
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void nr_free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<nr_free_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nr_free_dmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @nr_free_dmatrix(double** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca double**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store double** %0, double*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load double**, double*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds double*, double** %11, i64 %12
%14 = load double*, double** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds double, double* %14, i64 %15
%17 = getelementptr inbounds double, double* %16, i64 -1
%18 = bitcast double* %17 to i8*
%19 = call i32 @free(i8* %18)
%20 = load double**, double*** %6
%21 = load i64, i64* %7
%22 = getelementptr inbounds double*, double** %20, i64 %21
%23 = getelementptr inbounds double*, double** %22, i64 -1
%24 = bitcast double** %23 to i8*
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
define void @nr_free_dmatrix(double** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds double*, double** %0, i64 %1
%7 = load double*, double** %6
%8 = getelementptr inbounds double, double* %7, i64 %3
%9 = getelementptr inbounds double, double* %8, i64 -1
%10 = bitcast double* %9 to i8*
%11 = tail call i32 @free(i8* %10)
%12 = getelementptr inbounds double*, double** %6, i64 -1
%13 = bitcast double** %12 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_connect();
int /*<<< orphan*/ free_edgelists();
int /*<<< orphan*/ free_nodelists();
int /*<<< orphan*/ free_tmpedges();
int /*<<< orphan*/ free_tmpnodes();
void free_all_lists(void) {
  free_tmpnodes();
  free_tmpedges();
  free_nodelists();
  free_edgelists();
  free_connect();
}


x86 assembly (clang, -O0):
<free_all_lists>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <free_tmpnodes@plt>
mov    $0x0,%al
call   1050 <free_tmpedges@plt>
mov    $0x0,%al
call   1070 <free_nodelists@plt>
mov    $0x0,%al
call   1060 <free_edgelists@plt>
mov    $0x0,%al
call   1030 <free_connect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_all_lists>:
push   %rax
xor    %eax,%eax
call   1040 <free_tmpnodes@plt>
xor    %eax,%eax
call   1050 <free_tmpedges@plt>
xor    %eax,%eax
call   1070 <free_nodelists@plt>
xor    %eax,%eax
call   1060 <free_edgelists@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <free_connect@plt>

LLVM IR (-O0):
define void @free_all_lists() {
%1 = call i32 (...) @free_tmpnodes()
%2 = call i32 (...) @free_tmpedges()
%3 = call i32 (...) @free_nodelists()
%4 = call i32 (...) @free_edgelists()
%5 = call i32 (...) @free_connect()
ret void
}

LLVM IR (-O2):
define void @free_all_lists() {
%1 = tail call i32 (...) @free_tmpnodes()
%2 = tail call i32 (...) @free_tmpedges()
%3 = tail call i32 (...) @free_nodelists()
%4 = tail call i32 (...) @free_edgelists()
%5 = tail call i32 (...) @free_connect()
ret void
}
/* Variables and functions */
void abort(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <abort+0x9>
jmp    1109 <abort+0x9>

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

LLVM IR (-O0):
define void @abort() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @abort() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
scalar_t__ fossil_isupper(char);
int fossil_tolower(char c) { return fossil_isupper(c) ? c - 'A' + 'a' : c; }


x86 assembly (clang, -O0):
<fossil_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <fossil_isupper@plt>
cmp    $0x0,%rax
je     1143 <fossil_tolower+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <fossil_tolower+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fossil_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <fossil_isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fossil_tolower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @fossil_isupper(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 65
%10 = add nsw i32 %9, 97
br label %14
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
br label %14
14: ; preds = %11, %6
%15 = phi i32 [ %10, %6 ], [ %13, %11 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @fossil_tolower(i8 signext %0) {
%2 = tail call i64 @fossil_isupper(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, 32
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t div_u32_by_44488(uint32_t val) {
  return ((uint64_t)val * 0xBC8F1391UL) >> (15 + 32);
}


x86 assembly (clang, -O0):
<div_u32_by_44488>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xbc8f1391,%rcx
imul   %rcx,%rax
shr    $0x2f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_u32_by_44488>:
movslq %edi,%rcx
mov    $0xbc8f1391,%eax
imul   %rcx,%rax
shr    $0x2f,%rax
ret

LLVM IR (-O0):
define i32 @div_u32_by_44488(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 3163493265
%6 = lshr i64 %5, 47
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @div_u32_by_44488(i32 %0) {
%2 = sext i32 %0 to i64
%3 = mul nsw i64 %2, 3163493265
%4 = lshr i64 %3, 47
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int m_create(int, int);
int v_init(void) { return m_create(100, sizeof(int)); }


x86 assembly (clang, -O0):
<v_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
mov    $0x4,%esi
call   1030 <m_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_init>:
mov    $0x64,%edi
mov    $0x4,%esi
jmp    1030 <m_create@plt>

LLVM IR (-O0):
define i32 @v_init() {
%1 = call i32 @m_create(i32 100, i32 4)
ret i32 %1
}

LLVM IR (-O2):
define i32 @v_init() {
%1 = tail call i32 @m_create(i32 100, i32 4)
ret i32 %1
}
int busca(char *nome) {}


x86 assembly (clang, -O0):
<busca>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @busca(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ foo;

/* Variables and functions */
int /*<<< orphan*/ __mf_unwatch(int *, int);
int /*<<< orphan*/ __mf_watch(int *, int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *foo = malloc(10 * sizeof(int));
  int *bar = &foo[3];
  __mf_watch(&foo[1], sizeof(foo[1]));
  __mf_unwatch(&foo[6], sizeof(foo[6]));
  *bar = 10;
  free(foo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    $0x4,%esi
call   1050 <__mf_watch@plt>
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
mov    $0x4,%esi
call   1040 <__mf_unwatch@plt>
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0x4(%rax),%rdi
mov    $0x4,%esi
call   1050 <__mf_watch@plt>
lea    0x18(%rbx),%rdi
mov    $0x4,%esi
call   1040 <__mf_unwatch@plt>
movl   $0xa,0xc(%rbx)
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @malloc(i32 40)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 3
store i32* %6, i32** %3
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = call i32 @__mf_watch(i32* %8, i32 4)
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 6
%12 = call i32 @__mf_unwatch(i32* %11, i32 4)
%13 = load i32*, i32** %3
store i32 10, i32* %13
%14 = load i32*, i32** %2
%15 = call i32 @free(i32* %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
%2 = getelementptr inbounds i32, i32* %1, i64 3
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = tail call i32 @__mf_watch(i32* %3, i32 4)
%5 = getelementptr inbounds i32, i32* %1, i64 6
%6 = tail call i32 @__mf_unwatch(i32* %5, i32 4)
store i32 10, i32* %2
%7 = tail call i32 @free(i32* %1)
ret i32 0
}
void WideTimer1B_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<WideTimer1B_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <WideTimer1B_Handler+0x9>
jmp    1109 <WideTimer1B_Handler+0x9>

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

LLVM IR (-O0):
define void @WideTimer1B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @WideTimer1B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
reg0imm1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ r0 = 33; }


x86 assembly (clang, -O0):
<reg0imm1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movw   $0x21,-0x6(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reg0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
store i16 33, i16* %8
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @reg0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
ret i32 undef
}
void foo197(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo197(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
double fabs(double);
void fabd_d(double x, double y, double d) {
  if ((fabs(x - y) - d) > 0.00001)
    abort();
}


x86 assembly (clang, -O0):
<fabd_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xed8(%rip),%xmm1
pand   %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115a <fabd_d+0x4a>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabd_d>:
push   %rax
subsd  %xmm1,%xmm0
andpd  0xee3(%rip),%xmm0
subsd  %xmm2,%xmm0
ucomisd 0xee7(%rip),%xmm0
ja     112d <fabd_d+0x1d>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @fabd_d(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = call double @llvm.fabs.f64(double %9)
%11 = load double, double* %6
%12 = fsub double %10, %11
%13 = fcmp ogt double %12, 1.000000e-05
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @fabd_d(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fsub double %5, %2
%7 = fcmp ogt double %6, 1.000000e-05
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ another_one(int);
int /*<<< orphan*/ one(int);
int /*<<< orphan*/ one_more(int);
int /*<<< orphan*/ three(int, int, int);
int /*<<< orphan*/ two(int, int);
int /*<<< orphan*/ two_more(int, int);
int main() {
  one(12);
  one_more(15);
  another_one(20);
  two(1, 2);
  two_more(3, 4);
  three(1, 2, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1070 <one@plt>
mov    $0xf,%edi
call   1050 <one_more@plt>
mov    $0x14,%edi
call   1040 <another_one@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <two@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1060 <two_more@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1080 <three@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1070 <one@plt>
mov    $0xf,%edi
call   1050 <one_more@plt>
mov    $0x14,%edi
call   1040 <another_one@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <two@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1060 <two_more@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1080 <three@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @one(i32 12)
%2 = call i32 @one_more(i32 15)
%3 = call i32 @another_one(i32 20)
%4 = call i32 @two(i32 1, i32 2)
%5 = call i32 @two_more(i32 3, i32 4)
%6 = call i32 @three(i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @one(i32 12)
%2 = tail call i32 @one_more(i32 15)
%3 = tail call i32 @another_one(i32 20)
%4 = tail call i32 @two(i32 1, i32 2)
%5 = tail call i32 @two_more(i32 3, i32 4)
%6 = tail call i32 @three(i32 1, i32 2, i32 3)
ret i32 0
}
int cmp(const void *v1, const void *v2) { return *((int *)v1) - *((int *)v2); }


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

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ parse_string(int /*<<< orphan*/ *, void *);
int8_t parse_netport(uint8_t *text, void *buf) {
  return parse_string(text, buf);
}


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

x86 assembly (clang, -O2):
<parse_netport>:
jmp    1030 <parse_string@plt>

LLVM IR (-O0):
define i32 @parse_netport(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 i8*, i8** %4
%7 = call i32 @parse_string(i32* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @parse_netport(i32* %0, i8* %1) {
%3 = tail call i32 @parse_string(i32* %0, i8* %1)
ret i32 %3
}
unsigned getval_234() { return 3286272072U; }


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

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

LLVM IR (-O0):
define i32 @getval_234() {
ret i32 -1008695224
}

LLVM IR (-O2):
define i32 @getval_234() {
ret i32 -1008695224
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void put_str(char str[]) {
  FILE *tmp_file;
  tmp_file = fopen("tmp_file", "a");
  fputs(str, tmp_file);
  fclose(tmp_file);
}


x86 assembly (clang, -O0):
<put_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"tmp_file\00"
@.str.1 = [2 x i8] c"a\00"
define void @put_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i8*, i8** %2
%6 = load i32*, i32** %3
%7 = call i32 @fputs(i8* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"tmp_file\00"
@.str.1 = [2 x i8] c"a\00"
define void @put_str(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fputs(i8* %0, i32* %2)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
char oldland_serial_getc();
int _read(int fd, char *buf, int len) {
  if (len == 0)
    return 0;
  buf[0] = oldland_serial_getc();
  return 1;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1138 <_read+0x28>
movl   $0x0,-0x4(%rbp)
jmp    114e <_read+0x3e>
mov    $0x0,%al
call   1030 <oldland_serial_getc@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
test   %edx,%edx
je     1128 <_read+0x18>
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <oldland_serial_getc@plt>
mov    %al,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 0, i32* %4
br label %15
11: ; preds = %3
%12 = call signext i8 (...) @oldland_serial_getc()
%13 = load i8*, i8** %6
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
store i32 1, i32* %4
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call signext i8 (...) @oldland_serial_getc()
store i8 %6, i8* %1
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ 1, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *sum = (int *)malloc(sizeof(int));
  for (int i = 1; i <= 100; i++)
    *sum += i;
  printf("sum of 1...100: %d", *sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1167 <main+0x47>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    $0x13ba,%esi
add    (%rax),%esi
mov    %esi,(%rax)
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"sum of 1...100: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
store i32 1, i32* %3
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 100
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = add nsw i32 %12, %10
store i32 %13, i32* %11
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
%18 = load i32*, i32** %2
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"sum of 1...100: %d\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = load i32, i32* %2
%4 = add i32 %3, 5050
store i32 %4, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void wpas_wps_deinit(struct wpa_supplicant *wpa_s) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_wps_deinit(%struct.wpa_supplicant* nocapture %0) {
ret void
}
int traceRotMx(const int *RotMx) { return RotMx[0] + RotMx[4] + RotMx[8]; }


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

x86 assembly (clang, -O2):
<traceRotMx>:
mov    0x10(%rdi),%eax
add    (%rdi),%eax
add    0x20(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @traceRotMx(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 4
%8 = load i32, i32* %7
%9 = add nsw i32 %5, %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 8
%12 = load i32, i32* %11
%13 = add nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @traceRotMx(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %2
%6 = getelementptr inbounds i32, i32* %0, i64 8
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}
int iop_init_iocp(void *iop_base, int maxev) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @iop_init_iocp(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ encrypt();
int main() {
  encrypt();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @encrypt()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_CRIT;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *,
                          int /*<<< orphan*/, int /*<<< orphan*/);
void fatal(const char *msg) {
  syslog(LOG_CRIT, "%s Error: %d. %s", msg, errno, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    %eax,%r8d
lea    0xe82(%rip),%rsi
call   1030 <syslog@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2eaa(%rip),%rax
mov    (%rax),%ebp
mov    0x2e91(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1050 <strerror@plt>
lea    0xea9(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1030 <syslog@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@LOG_CRIT = global i32 0
@.str = [17 x i8] c"%s Error: %d. %s\00"
@errno = global i32 0
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_CRIT
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = load i32, i32* @errno
%7 = call i32 @strerror(i32 %6)
%8 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5, i32 %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@LOG_CRIT = global i32 0
@.str = [17 x i8] c"%s Error: %d. %s\00"
@errno = global i32 0
define void @fatal(i8* %0) {
%2 = load i32, i32* @LOG_CRIT
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3, i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
int helper_1(int num) {
  int ans = 0;
  for (; num;) {
    if (num & 1)
      ans++;
    num >>= 1;
  }
  return ans;
}


x86 assembly (clang, -O0):
<helper_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <helper_1+0x3e>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <helper_1+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <helper_1+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper_1>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <helper_1+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <helper_1+0x10>
ret

LLVM IR (-O0):
define i32 @helper_1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%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 %12, 1
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %7
%15 = load i32, i32* %2
%16 = ashr i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @helper_1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = ashr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
double exp(double);
double pow(int, int);
double fn(int grado, double x) { return (pow(1 / 2., grado) * exp(x / 2.)); }


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %edi,%esi
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xeb9(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fn(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = call double @pow(i32 0, i32 %5)
%7 = load double, double* %4
%8 = fdiv double %7, 2.000000e+00
%9 = call double @exp(double %8)
%10 = fmul double %6, %9
ret double %10
}

LLVM IR (-O2):
define double @fn(i32 %0, double %1) {
%3 = tail call double @pow(i32 0, i32 %0)
%4 = fmul double %1, 5.000000e-01
%5 = tail call double @exp(double %4)
%6 = fmul double %3, %5
ret double %6
}
int history_search_prefix(string, direction) const char *string;
int direction;
{ return (history_search_internal(string, direction, 1)); }


x86 assembly (clang, -O0):
<history_search_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <history_search_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<history_search_prefix>:
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <history_search_internal@plt>

LLVM IR (-O0):
define i32 @history_search_prefix(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @history_search_internal to i32 (i8*, i32, i32, ...)*)(i8* %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @history_search_prefix(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @history_search_internal to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, n = 0, result, suma = 0;
  for (i = 1; i <= 1000; i++) {
    result = (2 * n) + 1;
    suma = suma + result;
    n++;
    printf("%d\t", result);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jg     117c <main+0x6c>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x2,%ebx
cmp    $0x7d1,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %5
store i32 1, i32* %2
br label %6
6: ; preds = %20, %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 1000
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %3
%11 = mul nsw i32 2, %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
%18 = load i32, i32* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %9
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %6
23: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = shl nuw nsw i32 %2, 1
%4 = or i32 %3, 1
%5 = add nuw nsw i32 %2, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%7 = icmp eq i32 %5, 1000
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
f(n, a, b, c) int n;
int a;
int b;
int c;
{
  if (n == 0)
    return 0;
  f(n - 1, a, c, b);
  movedisk(a, b);
  f(n - 1, c, b, a);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114a <f+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    117f <f+0x5f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <f@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1040 <movedisk@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <f@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1167 <f+0x47>
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
add    $0xffffffff,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%r15d
mov    %ebp,%edi
mov    %ebx,%esi
mov    %ecx,%edx
mov    %r14d,%ecx
call   1030 <f@plt>
mov    %ebx,%edi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <movedisk@plt>
mov    %ebx,%ecx
mov    %r15d,%ebx
add    $0xffffffff,%ebp
jb     1140 <f+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %4
store i32 0, i32* %5
br label %29
13: ; preds = %4
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %7
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = call i32 @f(i32 %15, i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = call i32 (i32, i32, ...) bitcast (i32 (...)* @movedisk to i32 (i32, i32, ...)*)(i32 %20, i32 %21)
%23 = load i32, i32* %6
%24 = sub nsw i32 %23, 1
%25 = load i32, i32* %9
%26 = load i32, i32* %8
%27 = load i32, i32* %7
%28 = call i32 @f(i32 %24, i32 %25, i32 %26, i32 %27)
br label %29
29: ; preds = %13, %12
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %14, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %8, %6 ], [ %3, %4 ]
%8 = phi i32 [ %7, %6 ], [ %1, %4 ]
%9 = phi i32 [ %10, %6 ], [ %0, %4 ]
%10 = add nsw i32 %9, -1
%11 = tail call i32 @f(i32 %10, i32 %8, i32 %7, i32 %2)
%12 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @movedisk to i32 (i32, i32, ...)*)(i32 %8, i32 %2)
%13 = icmp eq i32 %10, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(int *, int *, int);
void strncpy_bad2() {
  int arr1[10];
  int arr2[20];
  strncpy(arr2, arr1, 44);
}


x86 assembly (clang, -O0):
<strncpy_bad2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2c,%edx
call   1030 <strncpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_bad2>:
sub    $0x88,%rsp
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x2c,%edx
call   1030 <strncpy@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @strncpy_bad2() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @strncpy(i32* %3, i32* %4, i32 44)
ret void
}

LLVM IR (-O2):
define void @strncpy_bad2() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @strncpy(i32* %5, i32* %6, i32 44)
ret void
}
void read_test_fini() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @startwin_close() {
ret i32 0
}
/* Variables and functions */
scalar_t__ readfd(int, int *);
int my_receivefd(int fd) {
  int passed_fd = -42;
  if (readfd(fd, &passed_fd) < 0) {
    return -1;
  } else {
    return passed_fd;
  }
}


x86 assembly (clang, -O0):
<my_receivefd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0xffffffd6,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1030 <readfd@plt>
cmp    $0x0,%rax
jge    1144 <my_receivefd+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <my_receivefd+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_receivefd>:
push   %rax
movl   $0xffffffd6,0x4(%rsp)
ff
lea    0x4(%rsp),%rsi
call   1030 <readfd@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1134 <my_receivefd+0x24>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @my_receivefd(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 -42, i32* %2
%4 = call i64 @readfd(i32 %0, i32* %2)
%5 = icmp slt i64 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 -1, i32 %6
ret i32 %7
}