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

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IP_HDRINCL;
int /*<<< orphan*/ printf(char *);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
void socket_iphdrincl(int sd) {
  const int one = 1;
  if (setsockopt(sd, IPPROTO_IP, IP_HDRINCL, (char *)&one, sizeof(one)) == -1) {
    printf("[socket_iphdrincl] can't set IP_HDRINCL option\n");
  }
}


x86 assembly (clang, -O0):
<socket_iphdrincl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    116b <socket_iphdrincl+0x4b>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_iphdrincl>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     1152 <socket_iphdrincl+0x32>
pop    %rax
ret
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@IPPROTO_IP = global i32 0
@IP_HDRINCL = global i32 0
@.str = [48 x i8] c"[socket_iphdrincl] can't set IP_HDRINCL option\0A\00"
define void @socket_iphdrincl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_IP
%6 = load i32, i32* @IP_HDRINCL
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@IPPROTO_IP = global i32 0
@IP_HDRINCL = global i32 0
@str = [47 x i8] c"[socket_iphdrincl] can't set IP_HDRINCL option\00"
define void @socket_iphdrincl(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_IP
%5 = load i32, i32* @IP_HDRINCL
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
double square_2(x)
double x;
{ return x * x; }


x86 assembly (clang, -O0):
<square_2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_2>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @square_2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @square_2(double %0) {
%2 = fmul double %0, %0
ret double %2
}
void clear_bit(char *bits, int n) { bits[n / 8] &= ~(1 << (7 - (n % 8))); }


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    $0x7,%ecx
sub    %edx,%ecx
mov    $0x1,%esi
shl    %cl,%esi
xor    $0xffffffff,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%esi
mov    $0x7,%cl
sub    %sil,%cl
mov    $0x1,%edx
shl    %cl,%edx
sar    $0x3,%eax
cltq
not    %dl
and    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @clear_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 8
%7 = sub nsw i32 7, %6
%8 = shl i32 1, %7
%9 = xor i32 %8, -1
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 8
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = and i32 %16, %9
%18 = trunc i32 %17 to i8
store i8 %18, i8* %14
ret void
}

LLVM IR (-O2):
define void @clear_bit(i8* nocapture %0, i32 %1) {
%3 = srem i32 %1, 8
%4 = sub nsw i32 7, %3
%5 = shl nuw nsw i32 1, %4
%6 = sdiv i32 %1, 8
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = trunc i32 %5 to i8
%11 = xor i8 %10, -1
%12 = and i8 %9, %11
store i8 %12, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_cache();
int main(int argc, char **argv) {
  check_cache();
  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 <check_cache@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_cache@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 (...) @check_cache()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @check_cache()
ret i32 0
}
/* Variables and functions */
char *do_path_append(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ strlen(char *);
char *path_append(char *s1, char *s2) {
  return do_path_append(s1, strlen(s1), s2);
}


x86 assembly (clang, -O0):
<path_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <do_path_append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_append>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <do_path_append@plt>

LLVM IR (-O0):
define i8* @path_append(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 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i8* @do_path_append(i8* %5, i32 %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @path_append(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @do_path_append(i8* %0, i32 %3, i8* %1)
ret i8* %4
}
unsigned long pmd_index(unsigned long address) {
  return (address >> 22) & (1024 - 1);
}


x86 assembly (clang, -O0):
<pmd_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x16,%rax
and    $0x3ff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmd_index>:
mov    %rdi,%rax
shr    $0x16,%eax
ret

LLVM IR (-O0):
define i64 @pmd_index(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 22
%5 = and i64 %4, 1023
ret i64 %5
}

LLVM IR (-O2):
define i64 @pmd_index(i64 %0) {
%2 = lshr i64 %0, 22
%3 = and i64 %2, 1023
ret i64 %3
}
double fifdmax1(double a, double b) {
  if (a < b)
    return b;
  else
    return a;
}


x86 assembly (clang, -O0):
<fifdmax1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fifdmax1+0x31>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <fifdmax1+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifdmax1>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fifdmax1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @fifdmax1(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t inw(uint16_t port) {
  uint16_t data;
  asm volatile("inw %w1, %w0" : "=a"(data) : "Nd"(port));
  return data;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
in     (%dx),%ax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %rdi,%rdx
in     (%dx),%ax
ret

LLVM IR (-O0):
define i8* @inw(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inw(i8* %0) {
%2 = tail call i8* asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int compare_float(float a, float b) {
  if (a < b) {
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<compare_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    112d <compare_float+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1134 <compare_float+0x34>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_float>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @compare_float(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %11
10: ; preds = %2
store i32 1, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare_float(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, i32 -1, i32 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
int pdu_eth(struct packet *, int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
            int);
int pdu_eth_arp(struct packet *p, const uint8_t *src_addr) {
  uint8_t broadcast[6];
  memset(broadcast, 0xff, 6);
  return pdu_eth(p, broadcast, src_addr, 0x0806);
}


x86 assembly (clang, -O0):
<pdu_eth_arp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0xff,%esi
mov    $0x6,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x806,%ecx
call   1030 <pdu_eth@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_eth_arp>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0xff,%esi
mov    $0x6,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x806,%ecx
call   1030 <pdu_eth@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.packet = type { i32 }
define i32 @pdu_eth_arp(%struct.packet* %0, i32* %1) {
%3 = alloca %struct.packet*
%4 = alloca i32*
%5 = alloca [6 x i32]
store %struct.packet* %0, %struct.packet** %3
store i32* %1, i32** %4
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%7 = call i32 @memset(i32* %6, i32 255, i32 6)
%8 = load %struct.packet*, %struct.packet** %3
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%10 = load i32*, i32** %4
%11 = call i32 @pdu_eth(%struct.packet* %8, i32* %9, i32* %10, i32 2054)
ret i32 %11
}

LLVM IR (-O2):
%struct.packet = type { i32 }
define i32 @pdu_eth_arp(%struct.packet* %0, i32* %1) {
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%6 = call i32 @memset(i32* %5, i32 255, i32 6)
%7 = call i32 @pdu_eth(%struct.packet* %0, i32* %5, i32* %1, i32 2054)
ret i32 %7
}
/* Variables and functions */
void *tommy_hashlin_remove_existing(void *, void *);
void *remove_elem_hash_table(void *ht, void *ht_node) {
  return tommy_hashlin_remove_existing(ht, ht_node);
}


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

x86 assembly (clang, -O2):
<remove_elem_hash_table>:
jmp    1030 <tommy_hashlin_remove_existing@plt>

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

LLVM IR (-O2):
define i8* @remove_elem_hash_table(i8* %0, i8* %1) {
%3 = tail call i8* @tommy_hashlin_remove_existing(i8* %0, i8* %1)
ret i8* %3
}
void gtk_tree_view_get_expander_column() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_get_expander_column() {
ret void
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ err_sys(char *);
void Close(int filedes) {
  if (close(filedes) < 0)
    err_sys("close error");
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
jge    1149 <Close+0x29>
lea    0xebc(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rax
call   1040 <close@plt>
test   %rax,%rax
js     112d <Close+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"close error\00"
define void @Close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @err_sys(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"close error\00"
define void @Close(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err_sys(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
void polf_(n, parray) int *n;
float parray[][3];
{ polf((long)*n, parray); }


x86 assembly (clang, -O0):
<polf_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <polf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polf_>:
movslq (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <polf@plt>

LLVM IR (-O0):
define void @polf_(i32* %0, [3 x float]* %1) {
%3 = alloca i32*
%4 = alloca [3 x float]*
store i32* %0, i32** %3
store [3 x float]* %1, [3 x float]** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = load [3 x float]*, [3 x float]** %4
%9 = call i32 (i64, [3 x float]*, ...) bitcast (i32 (...)* @polf to i32 (i64, [3 x float]*, ...)*)(i64 %7, [3 x float]* %8)
ret void
}

LLVM IR (-O2):
define void @polf_(i32* nocapture %0, [3 x float]* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = tail call i32 (i64, [3 x float]*, ...) bitcast (i32 (...)* @polf to i32 (i64, [3 x float]*, ...)*)(i64 %4, [3 x float]* %1)
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char *path = NULL;
  path = getenv("PATH");
  if (path == NULL) {
    printf("path == NULL\n");
    return -1;
  }
  printf("path = %s\n", path);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xec2(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116c <main+0x4c>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <main+0x65>
mov    -0x10(%rbp),%rsi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1157 <main+0x27>
lea    0xebc(%rip),%rdi
xor    %ebx,%ebx
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1168 <main+0x38>
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"PATH\00"
@.str.1 = [14 x i8] c"path == NULL\0A\00"
@.str.2 = [11 x i8] c"path = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %11
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %9)
store i32 0, i32* %1
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"PATH\00"
@.str.2 = [11 x i8] c"path = %s\0A\00"
@str = [13 x i8] c"path == NULL\00"
define i32 @main() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ -1, %3 ], [ 0, %5 ]
ret i32 %8
}
int f_ne_cr1(float a1) { return (((100) != (a1))); }


x86 assembly (clang, -O0):
<f_ne_cr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ne_cr1>:
cmpneqss 0xef7(%rip),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_ne_cr1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp une float 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_ne_cr1(float %0) {
%2 = fcmp une float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ wrap(char *, char *);
int main(int argc, char *argv[]) {
  wrap("%s", argv[1]);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xecb(%rip),%rdi
call   1030 <wrap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @wrap(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @wrap(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
int main(void) {
  float base, altura, area;
  base = 5.25;
  altura = 17.32;
  area = base * altura / 2;
  printf("Base:%g Altura:%g Area:%g", base, altura, area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  0xeb5(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef4(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
movss  0xed8(%rip),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Base:%g Altura:%g Area:%g\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float 5.250000e+00, float* %2
store float 0x403151EB80000000, float* %3
%5 = load float, float* %2
%6 = load float, float* %3
%7 = fmul float %5, %6
%8 = fdiv float %7, 2.000000e+00
store float %8, float* %4
%9 = load float, float* %2
%10 = load float, float* %3
%11 = load float, float* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float %9, float %10, float %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Base:%g Altura:%g Area:%g\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float 5.250000e+00, float 0x403151EB80000000, float 0x4046BB8520000000)
ret i32 0
}
/* Variables and functions */
scalar_t__ is_collatz(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Is 27 a Collatz number?\n");
  if (is_collatz(27)) {
    printf("Yes!\n");
  } else {
    printf("No :(\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1b,%edi
call   1040 <is_collatz@plt>
cmp    $0x0,%rax
je     1160 <main+0x40>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    116c <main+0x4c>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1b,%edi
call   1040 <is_collatz@plt>
test   %rax,%rax
lea    0xed7(%rip),%rax
lea    0xed6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Is 27 a Collatz number?\0A\00"
@.str.1 = [6 x i8] c"Yes!\0A\00"
@.str.2 = [7 x i8] c"No :(\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i64 @is_collatz(i32 27)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@str = [24 x i8] c"Is 27 a Collatz number?\00"
@str.3 = [6 x i8] c"No :(\00"
@str.4 = [5 x i8] c"Yes!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 @is_collatz(i32 27)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.4, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
int linearSearch(int a[], int size, int item) {
  int loc = -1, i;
  for (i = 0; i < size; i++) {
    if (a[i] == item) {
      loc = i + 1;
      break;
    }
  }
  return loc;
}


x86 assembly (clang, -O0):
<linearSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <linearSearch+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jne    114a <linearSearch+0x4a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <linearSearch+0x5d>
jmp    114f <linearSearch+0x4f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <linearSearch+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearSearch>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <linearSearch+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <linearSearch+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <linearSearch+0x10>
ret
add    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @linearSearch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %15
%8 = phi i64 [ 0, %5 ], [ %16, %15 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = trunc i64 %8 to i32
%14 = add nuw nsw i32 %13, 1
br label %18
15: ; preds = %7
%16 = add nuw nsw i64 %8, 1
%17 = icmp eq i64 %16, %6
br i1 %17, label %18, label %7
18: ; preds = %15, %3, %12
%19 = phi i32 [ %14, %12 ], [ -1, %3 ], [ -1, %15 ]
ret i32 %19
}
void batadv_dat_free(struct batadv_priv *bat_priv) {}


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

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

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

LLVM IR (-O2):
%struct.batadv_priv = type opaque
define void @batadv_dat_free(%struct.batadv_priv* nocapture %0) {
ret void
}
double inchesToMetres(double inches) { return inches / 39.370; }


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

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

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

LLVM IR (-O2):
define double @inchesToMetres(double %0) {
%2 = fdiv double %0, 3.937000e+01
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ test_log_conflict();
int /*<<< orphan*/ test_log_entries_appended();
int /*<<< orphan*/ test_log_out_of_sync();
int /*<<< orphan*/ test_reply_false_if_term_lt_current_term();
int /*<<< orphan*/ test_reset_commit_index();
int main() {
  test_reply_false_if_term_lt_current_term();
  test_log_out_of_sync();
  test_log_conflict();
  test_log_entries_appended();
  test_reset_commit_index();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_reply_false_if_term_lt_current_term@plt>
mov    $0x0,%al
call   1050 <test_log_out_of_sync@plt>
mov    $0x0,%al
call   1060 <test_log_conflict@plt>
mov    $0x0,%al
call   1040 <test_log_entries_appended@plt>
mov    $0x0,%al
call   1070 <test_reset_commit_index@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_reply_false_if_term_lt_current_term@plt>
xor    %eax,%eax
call   1050 <test_log_out_of_sync@plt>
xor    %eax,%eax
call   1060 <test_log_conflict@plt>
xor    %eax,%eax
call   1040 <test_log_entries_appended@plt>
xor    %eax,%eax
call   1070 <test_reset_commit_index@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_reply_false_if_term_lt_current_term()
%2 = call i32 (...) @test_log_out_of_sync()
%3 = call i32 (...) @test_log_conflict()
%4 = call i32 (...) @test_log_entries_appended()
%5 = call i32 (...) @test_reset_commit_index()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_reply_false_if_term_lt_current_term()
%2 = tail call i32 (...) @test_log_out_of_sync()
%3 = tail call i32 (...) @test_log_conflict()
%4 = tail call i32 (...) @test_log_entries_appended()
%5 = tail call i32 (...) @test_reset_commit_index()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ helper_double_18_recursive(double *, int);
void helper_double_18(double *buf) { helper_double_18_recursive(buf, 18); }


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

x86 assembly (clang, -O2):
<helper_double_18>:
mov    $0x12,%esi
jmp    1030 <helper_double_18_recursive@plt>

LLVM IR (-O0):
define void @helper_double_18(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @helper_double_18_recursive(double* %3, i32 18)
ret void
}

LLVM IR (-O2):
define void @helper_double_18(double* %0) {
%2 = tail call i32 @helper_double_18_recursive(double* %0, i32 18)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NumAleatorio(int /*<<< orphan*/, int);
double log(int /*<<< orphan*/);
double DistExponencial(double med) { return (-med) * log(NumAleatorio(0, 1)); }


x86 assembly (clang, -O0):
<DistExponencial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <NumAleatorio@plt>
mov    %eax,%edi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DistExponencial>:
sub    $0x18,%rsp
xorpd  0xed4(%rip),%xmm0
movapd %xmm0,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <NumAleatorio@plt>
mov    %eax,%edi
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @DistExponencial(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @NumAleatorio(i32 0, i32 1)
%6 = call double @log(i32 %5)
%7 = fmul double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @DistExponencial(double %0) {
%2 = fneg double %0
%3 = tail call i32 @NumAleatorio(i32 0, i32 1)
%4 = tail call double @log(i32 %3)
%5 = fmul double %4, %2
ret double %5
}
int unregister_reboot_notifier(struct notifier_block *x) {
  int a;
  return a;
}


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @unregister_reboot_notifier(%struct.notifier_block* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
int cmd_ghn(int argc, char *argv[]) {
  printw("Ghn command\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Ghn command\0A\00"
define i32 @cmd_ghn(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printw(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Ghn command\0A\00"
define i32 @cmd_ghn(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printw(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int fibRec(int x) {
  if (x <= 1)
    return x;
  return fibRec(x - 1) + fibRec(x - 2);
}


x86 assembly (clang, -O0):
<fibRec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1130 <fibRec+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibRec+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibRec@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibRec@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibRec>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fibRec+0x10>
mov    %ebx,%ecx
jmp    1144 <fibRec+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibRec@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fibRec+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibRec(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibRec(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ core_test();
int main(int argc, char *argv[]) {
  core_test();
  return EXIT_SUCCESS;
}


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 <core_test@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @core_test()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @core_test()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
int ima_path_check(struct path *path, int mask, int update_counts) { return 0; }


x86 assembly (clang, -O0):
<ima_path_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.path = type opaque
define i32 @ima_path_check(%struct.path* %0, i32 %1, i32 %2) {
%4 = alloca %struct.path*
%5 = alloca i32
%6 = alloca i32
store %struct.path* %0, %struct.path** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.path = type opaque
define i32 @ima_path_check(%struct.path* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
int startwin_settitle(const char *s) {
  s = s;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @startwin_settitle(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t abs_fun_int16_t(int16_t a) {
  int16_t mask = a >> 15;
  return (a + mask) ^ mask;
}


x86 assembly (clang, -O0):
<abs_fun_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_fun_int16_t>:
mov    %edi,%ecx
sar    $0xf,%ecx
lea    (%rdi,%rcx,1),%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @abs_fun_int16_t(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 15
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = xor i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @abs_fun_int16_t(i32 %0) {
%2 = ashr i32 %0, 15
%3 = add nsw i32 %2, %0
%4 = xor i32 %3, %2
ret i32 %4
}
void terminal_func() { return; }


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

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

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

LLVM IR (-O2):
define void @terminal_func() {
ret void
}
unsigned long trunc_page(unsigned long page) { return (page & ~(0x1000 - 1)); }


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

x86 assembly (clang, -O2):
<trunc_page>:
mov    %rdi,%rax
and    $0xfffffffffffff000,%rax
ret

LLVM IR (-O0):
define i64 @trunc_page(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -4096
ret i64 %4
}

LLVM IR (-O2):
define i64 @trunc_page(i64 %0) {
%2 = and i64 %0, -4096
ret i64 %2
}
/* Variables and functions */
double atof(char const *);
int cpt_parse_value(const char *str, double *val) {
  *val = atof(str);
  return 0;
}


x86 assembly (clang, -O0):
<cpt_parse_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpt_parse_value>:
push   %rbx
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpt_parse_value(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
store i8* %0, i8** %3
store double* %1, double** %4
%5 = load i8*, i8** %3
%6 = call double @atof(i8* %5)
%7 = load double*, double** %4
store double %6, double* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @cpt_parse_value(i8* nocapture %0, double* nocapture writeonly %1) {
%3 = tail call double @atof(i8* %0)
store double %3, double* %1
ret i32 0
}
int main() {
  printargs(3, 1, 2, 3, -4, -1);
  error("%s,%d,%s", "abc", 1232, "KK");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0xfffffffc,%r8d
mov    $0xffffffff,%r9d
mov    %ecx,%edi
mov    $0x0,%al
call   1030 <printargs@plt>
lea    0xea6(%rip),%rdi
lea    0xea8(%rip),%rsi
mov    $0x4d0,%edx
lea    0xea0(%rip),%rcx
mov    $0x0,%al
call   1040 <error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0xfffffffc,%r8d
mov    $0xffffffff,%r9d
xor    %eax,%eax
call   1030 <printargs@plt>
lea    0xeb1(%rip),%rdi
lea    0xeb3(%rip),%rsi
lea    0xeb0(%rip),%rcx
mov    $0x4d0,%edx
xor    %eax,%eax
call   1040 <error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s,%d,%s\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [3 x i8] c"KK\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @printargs to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 3, i32 1, i32 2, i32 3, i32 -4, i32 -1)
%3 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1232, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s,%d,%s\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [3 x i8] c"KK\00"
define i32 @main() {
%1 = tail call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @printargs to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 3, i32 1, i32 2, i32 3, i32 -4, i32 -1)
%2 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1232, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
int /*<<< orphan*/ WaypointActiveHandle();
void WaypointActiveUpdated() { UAVObjUpdated(WaypointActiveHandle()); }


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

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

LLVM IR (-O0):
define void @WaypointActiveUpdated() {
%1 = call i32 (...) @WaypointActiveHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @WaypointActiveUpdated() {
%1 = tail call i32 (...) @WaypointActiveHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
struct tls {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tls *);
int /*<<< orphan*/ tls_client_uninit(struct tls *);
void clean_tls_peer(void *peer) {
  if (peer) {
    struct tls *tls = (struct tls *)peer;
    tls_client_uninit(tls);
    free(tls);
  }
}


x86 assembly (clang, -O0):
<clean_tls_peer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <clean_tls_peer+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <tls_client_uninit@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_tls_peer>:
test   %rdi,%rdi
je     1137 <clean_tls_peer+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <tls_client_uninit@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.tls = type { i32 }
define void @clean_tls_peer(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tls*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to %struct.tls*
store %struct.tls* %8, %struct.tls** %3
%9 = load %struct.tls*, %struct.tls** %3
%10 = call i32 @tls_client_uninit(%struct.tls* %9)
%11 = load %struct.tls*, %struct.tls** %3
%12 = call i32 @free(%struct.tls* %11)
br label %13
13: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.tls = type { i32 }
define void @clean_tls_peer(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to %struct.tls*
%5 = tail call i32 @tls_client_uninit(%struct.tls* %4)
%6 = tail call i32 @free(%struct.tls* %4)
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: prof2sram [options] <input Profile.dat> <output SRAM>\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"Usage: prof2sram [options] <input Profile.dat> <output SRAM>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [61 x i8] c"Usage: prof2sram [options] <input Profile.dat> <output SRAM>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}