xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int safe_atou(char const *, unsigned int *);
int safe_atou32(const char *s, uint32_t *ret_u) {
  struct _assert_struct_0 {
    char x[(sizeof(uint32_t) == sizeof(unsigned)) ? 0 : -1];
  };
  ;
  return safe_atou(s, (unsigned *)ret_u);
}


x86 assembly (clang, -O0):
<safe_atou32>:
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 <safe_atou@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_atou32>:
jmp    1030 <safe_atou@plt>

LLVM IR (-O0):
define i32 @safe_atou32(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 @safe_atou(i8* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @safe_atou32(i8* %0, i32* %1) {
%3 = tail call i32 @safe_atou(i8* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ initialize_arr(int *, int);
void call_initialize_arr_Bad() {
  int arr[10];
  initialize_arr(arr, 20);
}


x86 assembly (clang, -O0):
<call_initialize_arr_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
mov    $0x14,%esi
call   1030 <initialize_arr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_initialize_arr_Bad>:
sub    $0x28,%rsp
mov    %rsp,%rdi
mov    $0x14,%esi
call   1030 <initialize_arr@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define void @call_initialize_arr_Bad() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @initialize_arr(i32* %3, i32 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mailimf_dot_atom_free(char *dot_atom) { free(dot_atom); }


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

x86 assembly (clang, -O2):
<mailimf_dot_atom_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mailimf_dot_atom_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yyunput(int /*<<< orphan*/, int /*<<< orphan*/);
int yywrap(void) {
  return 1;
  yyunput(0, 0);
}


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

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

LLVM IR (-O0):
define i32 @yywrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @yywrap() {
ret i32 1
}
void hexTobin(unsigned char *hex, unsigned char *bin) {
  int i, j;
  for (i = 0; i < 160; i++) {
    bin[i] = (hex[(int)(i / 8)] >> i) & 1;
  }
}


x86 assembly (clang, -O0):
<hexTobin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa0,-0x14(%rbp)
jge    1163 <hexTobin+0x63>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <hexTobin+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexTobin>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%r8d
shr    $0x3,%r8d
movzbl (%rdi,%r8,1),%edx
mov    %eax,%ecx
shr    %cl,%edx
and    $0x1,%dl
mov    %dl,(%rsi,%rax,1)
movzbl (%rdi,%r8,1),%edx
lea    0x1(%rax),%ecx
shr    %cl,%edx
and    $0x1,%dl
mov    %dl,0x1(%rsi,%rax,1)
add    $0x2,%rax
cmp    $0xa0,%rax
jne    1110 <hexTobin+0x10>
ret

LLVM IR (-O0):
define void @hexTobin(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %7
7: ; preds = %26, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 160
br i1 %9, label %10, label %29
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sdiv i32 %12, 8
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i32, i32* %5
%19 = ashr i32 %17, %18
%20 = and i32 %19, 1
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 %21, i8* %25
br label %26
26: ; preds = %10
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %7
29: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @hexTobin(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %26, %3 ]
%5 = trunc i64 %4 to i32
%6 = lshr i64 %4, 3
%7 = and i64 %6, 536870911
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = lshr i32 %10, %5
%12 = trunc i32 %11 to i8
%13 = and i8 %12, 1
%14 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %13, i8* %14
%15 = or i64 %4, 1
%16 = trunc i64 %15 to i32
%17 = lshr i64 %4, 3
%18 = and i64 %17, 536870911
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = lshr i32 %21, %16
%23 = trunc i32 %22 to i8
%24 = and i8 %23, 1
%25 = getelementptr inbounds i8, i8* %1, i64 %15
store i8 %24, i8* %25
%26 = add nuw nsw i64 %4, 2
%27 = icmp eq i64 %26, 160
br i1 %27, label %28, label %3
28: ; preds = %3
ret void
}
/* Variables and functions */
int rand();
void fillRandomVec(int *x) {
  for (int i = 0; i < 10000000; i++)
    x[i] = rand() % 50;
}


x86 assembly (clang, -O0):
<fillRandomVec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x989680,-0xc(%rbp)
jge    1158 <fillRandomVec+0x48>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <fillRandomVec+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillRandomVec>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x32,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x989680,%rbx
jne    1120 <fillRandomVec+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fillRandomVec(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* %3
%6 = icmp slt i32 %5, 10000000
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 50
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 %9, i32* %13
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @fillRandomVec(i32* nocapture writeonly %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 50
%7 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %6, i32* %7
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 10000000
br i1 %9, label %2, label %3
}
void swap(int idx[], int a, int b) {
  int tmp = idx[a];
  idx[a] = idx[b];
  idx[b] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
void *slob_alloc(size_t);
void *malloc(size_t n) {
  void *ret;
  ret = slob_alloc(n);
  return ret;
}


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

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

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

LLVM IR (-O2):
define i8* @malloc(i64 %0) {
%2 = tail call i8* @slob_alloc(i64 %0)
ret i8* %2
}
int test_imm_85int64_lowword_mem(long long *val) {
  return ((*val) & (0x85 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_85int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 133
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_strdel(char **as) {
  if (as != NULL) {
    (void)free(*as);
    *as = NULL;
  }
}


x86 assembly (clang, -O0):
<ft_strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <ft_strdel+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdel>:
test   %rdi,%rdi
je     1129 <ft_strdel+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_strdel(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
%9 = load i8**, i8*** %2
store i8* null, i8** %9
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef size_t int64_t;

/* Variables and functions */
int64_t roundUp(size_t numToRound, size_t multiple) {
  if (multiple == 0)
    return numToRound;
  int64_t remainder = numToRound % multiple;
  if (remainder == 0)
    return numToRound;
  return numToRound + multiple - remainder;
}


x86 assembly (clang, -O0):
<roundUp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1124 <roundUp+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115c <roundUp+0x5c>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114c <roundUp+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115c <roundUp+0x5c>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundUp>:
test   %rsi,%rsi
je     112e <roundUp+0x2e>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111b <roundUp+0x1b>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    1121 <roundUp+0x21>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
add    %rdi,%rsi
sub    %rdx,%rsi
test   %rdx,%rdx
cmovne %rsi,%rdi
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @roundUp(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = urem i64 %0, %1
%6 = icmp eq i64 %5, 0
%7 = add i64 %1, %0
%8 = sub i64 %7, %5
%9 = select i1 %6, i64 %0, i64 %8
br label %10
10: ; preds = %2, %4
%11 = phi i64 [ %9, %4 ], [ %0, %2 ]
ret i64 %11
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double GetFlatTime(struct timeval *tv) {
  return (double)tv->tv_sec + ((double)tv->tv_usec) / 1000000.0;
}


x86 assembly (clang, -O0):
<GetFlatTime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFlatTime>:
cvtsi2sdq 0x8(%rdi),%xmm1
cvtsi2sdq (%rdi),%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @GetFlatTime(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %6, %11
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @GetFlatTime(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %8, %4
ret double %9
}
int resta(int x, int y) { return x - y; }


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

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

LLVM IR (-O0):
define i32 @resta(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}

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


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

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

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

LLVM IR (-O2):
define void @client_init() {
ret void
}
void gtk_tree_view_get_path_at_pos() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_get_path_at_pos() {
ret void
}
double f9(double x) {
  double t = x + 0.0;
  return t + 0.0;
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f9(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 0.000000e+00
store double %5, double* %3
%6 = load double, double* %3
%7 = fadd double %6, 0.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f9(double %0) {
%2 = fadd double %0, 0.000000e+00
ret double %2
}
struct desc_track *call_desc_lookup(int id) {}


x86 assembly (clang, -O0):
<call_desc_lookup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.desc_track = type opaque
define %struct.desc_track* @call_desc_lookup(i32 %0) {
%2 = alloca %struct.desc_track*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load %struct.desc_track*, %struct.desc_track** %2
ret %struct.desc_track* %4
}

LLVM IR (-O2):
%struct.desc_track = type opaque
define noalias %struct.desc_track* @call_desc_lookup(i32 %0) {
ret %struct.desc_track* undef
}
int imax(int n, int m) { return (n > m ? n : m); }


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <imax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imax(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int Bematech_FI_FlagsFiscais(Var, Retorno) {
  int cont = 0;
  return Formata("\x1b|35|17|\x1b", Var, Retorno);
}


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

x86 assembly (clang, -O2):
<Bematech_FI_FlagsFiscais>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|17|\1B\00"
define i32 @Bematech_FI_FlagsFiscais(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
void xshowmem(void) {}


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

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

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

LLVM IR (-O2):
define void @xshowmem() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
void init() {
  glClearColor(0.0, 0.5, 0.0, 0.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movsd  0xec1(%rip),%xmm1
movaps %xmm3,%xmm0
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glLoadIdentity@plt>
xorps  %xmm2,%xmm2
movsd  0xe86(%rip),%xmm5
movsd  0xe86(%rip),%xmm4
movaps %xmm2,%xmm0
movaps %xmm5,%xmm1
movaps %xmm5,%xmm3
call   1040 <glOrtho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
movsd  0xeb7(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
movsd  0xe94(%rip),%xmm4
movsd  0xe94(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm3
movaps %xmm1,%xmm5
pop    %rax
jmp    1040 <glOrtho@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = call i32 @glMatrixMode(i32 %2)
%4 = call i32 (...) @glLoadIdentity()
%5 = call i32 @glOrtho(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = tail call i32 @glMatrixMode(i32 %2)
%4 = tail call i32 (...) @glLoadIdentity()
%5 = tail call i32 @glOrtho(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}
long double test_expl(long double x) { return __builtin_expl(x); }


x86 assembly (clang, -O0):
<test_expl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_expl>:
jmp    1030 <expl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_expl(x86_fp80 %0) {
%2 = tail call x86_fp80 @expl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
double rand_unit();
double rand_double(double min, double max) {
  return min + rand_unit() * (max - min);
}


x86 assembly (clang, -O0):
<rand_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand_unit@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand_unit@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rand_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double (...) @rand_unit()
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = call double @llvm.fmuladd.f64(double %6, double %9, double %5)
ret double %10
}

LLVM IR (-O2):
define double @rand_double(double %0, double %1) {
%3 = tail call double (...) @rand_unit()
%4 = fsub double %1, %0
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %0)
ret double %5
}
__attribute__((no, noclone)) int f6(struct B *p, char *w, int z) {
  asm volatile("" : : "g"(p), "g"(w), "g"(z) : "memory");
  return 0;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%eax
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    %rsi,-0x10(%rsp)
mov    %rdi,-0x8(%rsp)
mov    %edx,-0x14(%rsp)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.B = type opaque
define i32 @f6(%struct.B* %0, i8* %1, i32 %2) {
%4 = alloca %struct.B*
%5 = alloca i8*
%6 = alloca i32
store %struct.B* %0, %struct.B** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.B*, %struct.B** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.B = type opaque
define i32 @f6(%struct.B* %0, i8* %1, i32 %2) {
tail call void asm sideeffect "", "imr,imr,imr,~{memory},~{dirflag},~{fpsr},~{flags}"(%struct.B* %0, i8* %1, i32 %2)
ret i32 0
}
double flor(double a, double b) { return a || b; }


x86 assembly (clang, -O0):
<flor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    1142 <flor+0x42>
jp     1142 <flor+0x42>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flor>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @flor(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp une double %5, 0.000000e+00
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp une double %8, 0.000000e+00
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @flor(double %0, double %1) {
%3 = fcmp une double %0, 0.000000e+00
%4 = fcmp une double %1, 0.000000e+00
%5 = or i1 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
float TMP36_temperature(float voltage_level) {
  return (voltage_level * 1000 - 500) / 10;
}


x86 assembly (clang, -O0):
<TMP36_temperature>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeee(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xee6(%rip),%xmm1
addss  %xmm1,%xmm0
movss  0xed2(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<TMP36_temperature>:
mulss  0xef8(%rip),%xmm0
addss  0xef4(%rip),%xmm0
divss  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @TMP36_temperature(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fmuladd.f32(float %3, float 1.000000e+03, float -5.000000e+02)
%5 = fdiv float %4, 1.000000e+01
ret float %5
}

LLVM IR (-O2):
define float @TMP36_temperature(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 1.000000e+03, float -5.000000e+02)
%3 = fdiv float %2, 1.000000e+01
ret float %3
}
int *a_ptr(int **b) { return *b; }


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

x86 assembly (clang, -O2):
<a_ptr>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @a_ptr(i32** nocapture %0) {
%2 = load i32*, i32** %0
ret i32* %2
}
void bitmap_fill(unsigned long *bitmap, int bits) {
  for (int i = 0; i < (((bits) + 64 - 1) / 64); i++)
    bitmap[i] = ~0;
}


x86 assembly (clang, -O0):
<bitmap_fill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x40,%eax
sub    $0x1,%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    1154 <bitmap_fill+0x54>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0xffffffffffffffff,(%rax,%rcx,8)
ff
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <bitmap_fill+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_fill>:
test   %esi,%esi
jle    112e <bitmap_fill+0x1e>
push   %rax
mov    %esi,%edx
add    $0x3f,%edx
shr    $0x3,%edx
and    $0xfffffff8,%edx
mov    $0xff,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bitmap_fill(i64* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = add nuw nsw i32 %1, 63
%6 = bitcast i64* %0 to i8*
%7 = lshr i32 %5, 3
%8 = and i32 %7, 536870904
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("factorial(3) = %d\n", factorial(3));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"factorial(3) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @factorial(i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"factorial(3) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wprintw(int /*<<< orphan*/ *, char const *, char *);
int s_wprintw(WINDOW *win, const char *fmt, char *string) {
  return (wprintw(win, fmt, string));
}


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

x86 assembly (clang, -O2):
<s_wprintw>:
jmp    1030 <wprintw@plt>

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

LLVM IR (-O2):
define i32 @s_wprintw(i32* %0, i8* %1, i8* %2) {
%4 = tail call i32 @wprintw(i32* %0, i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
char *alloca(int);
main() { char *c = alloca(23); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x17,%edi
call   1030 <alloca@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @alloca(i32 23)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ meepmeep();
int main(int argc, char *argv[]) {
  meepmeep();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @meepmeep()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  char *address;
};
typedef TYPE_1__ XHostAddress;

/* Variables and functions */
void set_XHostAddress_address(void *_p, void *_v) {
  ((XHostAddress *)_p)->address = (char *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i8* }
define void @set_XHostAddress_address(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i8* %5, i8** %8
ret void
}

LLVM IR (-O2):
define void @set_XHostAddress_address(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TimerLoadSet(int, int, unsigned long);
void wave_spwm_load(unsigned long value) {
  TimerLoadSet(0x40032000, 0x000000ff, value);
}


x86 assembly (clang, -O0):
<wave_spwm_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x40032000,%edi
mov    $0xff,%esi
call   1030 <TimerLoadSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_spwm_load>:
mov    %rdi,%rdx
mov    $0x40032000,%edi
mov    $0xff,%esi
jmp    1030 <TimerLoadSet@plt>

LLVM IR (-O0):
define void @wave_spwm_load(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @TimerLoadSet(i32 1073946624, i32 255, i64 %3)
ret void
}

LLVM IR (-O2):
define void @wave_spwm_load(i64 %0) {
%2 = tail call i32 @TimerLoadSet(i32 1073946624, i32 255, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putstr(char *);
void mister_clear_no_pause() {
  my_putstr("\033[2J");
  my_putstr("\033[0;0H");
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[0;0H\00"
define void @mister_clear_no_pause() {
%1 = call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @my_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[0;0H\00"
define void @mister_clear_no_pause() {
%1 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @my_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int hash_plugin_hash_length(void) { return 14; }


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

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

LLVM IR (-O0):
define i32 @hash_plugin_hash_length() {
ret i32 14
}

LLVM IR (-O2):
define i32 @hash_plugin_hash_length() {
ret i32 14
}
/* Variables and functions */
double log(int);
double Log2Plus1(double x) { return log(1 + x) / 0.693147180559945309417; }


x86 assembly (clang, -O0):
<Log2Plus1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log2Plus1>:
push   %rax
addsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
divsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Log2Plus1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @log(i32 %5)
%7 = fdiv double %6, 0x3FE62E42FEFA39EF
ret double %7
}

LLVM IR (-O2):
define double @Log2Plus1(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fptosi double %2 to i32
%4 = tail call double @log(i32 %3)
%5 = fdiv double %4, 0x3FE62E42FEFA39EF
ret double %5
}
int default_max_brightness(struct backlight *b) { return 100; }


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

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

LLVM IR (-O0):
%struct.backlight = type opaque
define i32 @default_max_brightness(%struct.backlight* %0) {
%2 = alloca %struct.backlight*
store %struct.backlight* %0, %struct.backlight** %2
ret i32 100
}

LLVM IR (-O2):
%struct.backlight = type opaque
define i32 @default_max_brightness(%struct.backlight* nocapture readnone %0) {
ret i32 100
}
/* Variables and functions */
short find_pos(short *);
void move_right(short *puzzle) {
  short temp, pos = find_pos(puzzle);
  temp = puzzle[pos];
  puzzle[pos] = puzzle[pos + 1];
  puzzle[pos + 1] = temp;
}


x86 assembly (clang, -O0):
<move_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <find_pos@plt>
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movswq -0xc(%rbp),%rcx
mov    (%rax,%rcx,2),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movswl -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%dx
mov    -0x8(%rbp),%rax
movswq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0xa(%rbp),%dx
mov    -0x8(%rbp),%rax
movswl -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dx,(%rax,%rcx,2)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_right>:
push   %rbx
mov    %rdi,%rbx
call   1030 <find_pos@plt>
movswq %ax,%rax
roll   $0x10,(%rbx,%rax,2)
pop    %rbx
ret

LLVM IR (-O0):
define void @move_right(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = call signext i16 @find_pos(i16* %5)
store i16 %6, i16* %4
%7 = load i16*, i16** %2
%8 = load i16, i16* %4
%9 = sext i16 %8 to i64
%10 = getelementptr inbounds i16, i16* %7, i64 %9
%11 = load i16, i16* %10
store i16 %11, i16* %3
%12 = load i16*, i16** %2
%13 = load i16, i16* %4
%14 = sext i16 %13 to i32
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i16, i16* %12, i64 %16
%18 = load i16, i16* %17
%19 = load i16*, i16** %2
%20 = load i16, i16* %4
%21 = sext i16 %20 to i64
%22 = getelementptr inbounds i16, i16* %19, i64 %21
store i16 %18, i16* %22
%23 = load i16, i16* %3
%24 = load i16*, i16** %2
%25 = load i16, i16* %4
%26 = sext i16 %25 to i32
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i16, i16* %24, i64 %28
store i16 %23, i16* %29
ret void
}

LLVM IR (-O2):
define void @move_right(i16* %0) {
%2 = tail call signext i16 @find_pos(i16* %0)
%3 = sext i16 %2 to i64
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = load i16, i16* %4
%6 = add nsw i64 %3, 1
%7 = getelementptr inbounds i16, i16* %0, i64 %6
%8 = load i16, i16* %7
store i16 %8, i16* %4
store i16 %5, i16* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void g(void) { f(1); }


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

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

LLVM IR (-O0):
define void @g() {
%1 = call i32 @f(i32 1)
ret void
}

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 @f(i32 1)
ret void
}
void gtk_tree_view_column_get_min_width() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_min_width() {
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR92_get(void) { return U_WMRCORENONE_get("U_WMR92"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR92\00"
define i32 @U_WMR92_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR92\00"
define i32 @U_WMR92_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
void count_lines() {
  int nl, c;
  nl = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\n')
      ++nl;
  }
  printf("%d\n", nl);
}


x86 assembly (clang, -O0):
<count_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1160 <count_lines+0x40>
cmpl   $0xa,-0x8(%rbp)
jne    115b <count_lines+0x3b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <count_lines+0xf>
mov    -0x4(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_lines>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <count_lines+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <count_lines+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @count_lines() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %13, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 10
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %13
13: ; preds = %10, %7
br label %3
14: ; preds = %3
%15 = load i32, i32* %1
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @count_lines() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}