xunge/DecIR huggingface dataset:
void wifi_rsp_system_set_max_power_saving_state(
    const struct wifi_msg_system_set_max_power_saving_state_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_system_set_max_power_saving_state_rsp_t = type opaque
define void @wifi_rsp_system_set_max_power_saving_state(%struct.wifi_msg_system_set_max_power_saving_state_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned long X86_EFLAGS_IF;
int raw_irqs_disabled_flags(unsigned long flags) {
  return !(flags & X86_EFLAGS_IF);
}


x86 assembly (clang, -O0):
<raw_irqs_disabled_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ee5(%rip),%rcx
and    (%rcx),%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_irqs_disabled_flags>:
mov    0x2ef1(%rip),%rcx
xor    %eax,%eax
test   %rdi,(%rcx)
sete   %al
ret

LLVM IR (-O0):
@X86_EFLAGS_IF = global i64 0
define i32 @raw_irqs_disabled_flags(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @X86_EFLAGS_IF
%5 = and i64 %3, %4
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@X86_EFLAGS_IF = global i64 0
define i32 @raw_irqs_disabled_flags(i64 %0) {
%2 = load i64, i64* @X86_EFLAGS_IF
%3 = and i64 %2, %0
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct ibv_srq_init_attr {
  int dummy;
};
struct ibv_srq {
  int dummy;
};
struct ibv_pd {
  int dummy;
};

/* Variables and functions */
struct ibv_srq *_create_srq(struct ibv_pd *, struct ibv_srq_init_attr *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
struct ibv_srq *ibv_create_srq(struct ibv_pd *pd,
                               struct ibv_srq_init_attr *srq_init_attr) {
  dmtcp_plugin_disable_ckpt();
  struct ibv_srq *user_copy = _create_srq(pd, srq_init_attr);
  dmtcp_plugin_enable_ckpt();
  return user_copy;
}


x86 assembly (clang, -O0):
<ibv_create_srq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_create_srq@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_create_srq>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <_create_srq@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ibv_srq = type { i32 }
%struct.ibv_pd = type { i32 }
%struct.ibv_srq_init_attr = type { i32 }
define %struct.ibv_srq* @ibv_create_srq(%struct.ibv_pd* %0, %struct.ibv_srq_init_attr* %1) {
%3 = alloca %struct.ibv_pd*
%4 = alloca %struct.ibv_srq_init_attr*
%5 = alloca %struct.ibv_srq*
store %struct.ibv_pd* %0, %struct.ibv_pd** %3
store %struct.ibv_srq_init_attr* %1, %struct.ibv_srq_init_attr** %4
%6 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%7 = load %struct.ibv_pd*, %struct.ibv_pd** %3
%8 = load %struct.ibv_srq_init_attr*, %struct.ibv_srq_init_attr** %4
%9 = call %struct.ibv_srq* @_create_srq(%struct.ibv_pd* %7, %struct.ibv_srq_init_attr* %8)
store %struct.ibv_srq* %9, %struct.ibv_srq** %5
%10 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%11 = load %struct.ibv_srq*, %struct.ibv_srq** %5
ret %struct.ibv_srq* %11
}

LLVM IR (-O2):
%struct.ibv_srq = type { i32 }
%struct.ibv_pd = type { i32 }
%struct.ibv_srq_init_attr = type { i32 }
define %struct.ibv_srq* @ibv_create_srq(%struct.ibv_pd* %0, %struct.ibv_srq_init_attr* %1) {
%3 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%4 = tail call %struct.ibv_srq* @_create_srq(%struct.ibv_pd* %0, %struct.ibv_srq_init_attr* %1)
%5 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret %struct.ibv_srq* %4
}
/* Type definitions */
struct ehci_sitd {
  int dummy;
};
struct ehci_hcd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ehci_err(struct ehci_hcd *, char *, struct ehci_sitd *);
unsigned sitd_complete(struct ehci_hcd *ehci, struct ehci_sitd *sitd) {
  ehci_err(ehci, "sitd_complete %p?\n", sitd);
  return 0;
}


x86 assembly (clang, -O0):
<sitd_complete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <ehci_err@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sitd_complete>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <ehci_err@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ehci_hcd = type { i32 }
%struct.ehci_sitd = type { i32 }
@.str = [19 x i8] c"sitd_complete %p?\0A\00"
define i32 @sitd_complete(%struct.ehci_hcd* %0, %struct.ehci_sitd* %1) {
%3 = alloca %struct.ehci_hcd*
%4 = alloca %struct.ehci_sitd*
store %struct.ehci_hcd* %0, %struct.ehci_hcd** %3
store %struct.ehci_sitd* %1, %struct.ehci_sitd** %4
%5 = load %struct.ehci_hcd*, %struct.ehci_hcd** %3
%6 = load %struct.ehci_sitd*, %struct.ehci_sitd** %4
%7 = call i32 @ehci_err(%struct.ehci_hcd* %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.ehci_sitd* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.ehci_hcd = type { i32 }
%struct.ehci_sitd = type { i32 }
@.str = [19 x i8] c"sitd_complete %p?\0A\00"
define i32 @sitd_complete(%struct.ehci_hcd* %0, %struct.ehci_sitd* %1) {
%3 = tail call i32 @ehci_err(%struct.ehci_hcd* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.ehci_sitd* %1)
ret i32 0
}
/* Type definitions */
struct mm_config {
  int dummy;
};

/* Variables and functions */
void *pgp_create(void *, struct mm_config *);
void *__pgp_create_agent(void *addr, struct mm_config *cfg) {
  return pgp_create(addr, cfg);
}


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

x86 assembly (clang, -O2):
<__pgp_create_agent>:
jmp    1030 <pgp_create@plt>

LLVM IR (-O0):
%struct.mm_config = type { i32 }
define i8* @__pgp_create_agent(i8* %0, %struct.mm_config* %1) {
%3 = alloca i8*
%4 = alloca %struct.mm_config*
store i8* %0, i8** %3
store %struct.mm_config* %1, %struct.mm_config** %4
%5 = load i8*, i8** %3
%6 = load %struct.mm_config*, %struct.mm_config** %4
%7 = call i8* @pgp_create(i8* %5, %struct.mm_config* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.mm_config = type { i32 }
define i8* @__pgp_create_agent(i8* %0, %struct.mm_config* %1) {
%3 = tail call i8* @pgp_create(i8* %0, %struct.mm_config* %1)
ret i8* %3
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int foo(int *x) {
  *x = __VERIFIER_nondet_int();
  return *x;
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @__VERIFIER_nondet_int()
%4 = load i32*, i32** %2
store i32 %3, i32* %4
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
store i32 %2, i32* %0
ret i32 %2
}
char which_row(int i, int x) {
  if (i == 0)
    return ('f');
  else if (i == x - 1)
    return ('l');
  else
    return ('m');
}


x86 assembly (clang, -O0):
<which_row>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <which_row+0x1d>
movb   $0x66,-0x1(%rbp)
jmp    113b <which_row+0x3b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1137 <which_row+0x37>
movb   $0x6c,-0x1(%rbp)
jmp    113b <which_row+0x3b>
movb   $0x6d,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<which_row>:
add    $0xffffffff,%esi
cmp    %edi,%esi
sete   %al
xor    $0x6d,%al
test   %edi,%edi
movzbl %al,%ecx
mov    $0x66,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @which_row(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = add nsw i32 %1, -1
%5 = icmp eq i32 %4, %0
%6 = select i1 %5, i8 108, i8 109
%7 = select i1 %3, i8 102, i8 %6
ret i8 %7
}
void printmsg(const char *value) {
  const char *c;
  for (c = value; *c; c++)
    *((volatile unsigned int *)0x100020) = *c;
}


x86 assembly (clang, -O0):
<printmsg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <printmsg+0x3c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x100020,%eax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <printmsg+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmsg>:
mov    (%rdi),%al
test   %al,%al
je     1125 <printmsg+0x25>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
movsbl %al,%eax
mov    %eax,0x100020
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <printmsg+0x10>
ret

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

LLVM IR (-O2):
define void @printmsg(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
store volatile i32 %7, i32* inttoptr (i64 1048608 to i32*)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int close(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  int s;
  s = socket(AF_INET, SOCK_STREAM, 0);
  return (close(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <close@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_STREAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @main() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = tail call i32 @close(i32 %3)
ret i32 %4
}
/* Variables and functions */
char *strstr(char const *, char const *);
int strpos(const char cadena1[], const char cadena2[]) {
  int toret = -1;
  if (cadena1 != NULL && cadena2 != NULL) {
    const char *pos = strstr(cadena1, cadena2);
    if (pos != NULL) {
      toret = pos - cadena1;
    }
  }
  return toret;
}


x86 assembly (clang, -O0):
<strpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116c <strpos+0x5c>
cmpq   $0x0,-0x10(%rbp)
je     116c <strpos+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1167 <strpos+0x57>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    116c <strpos+0x5c>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpos>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     1135 <strpos+0x25>
test   %rsi,%rsi
je     1135 <strpos+0x25>
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @strpos(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 -1, i32* %5
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %26
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i8* @strstr(i8* %13, i8* %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = load i8*, i8** %6
%20 = load i8*, i8** %3
%21 = ptrtoint i8* %19 to i64
%22 = ptrtoint i8* %20 to i64
%23 = sub i64 %21, %22
%24 = trunc i64 %23 to i32
store i32 %24, i32* %5
br label %25
25: ; preds = %18, %12
br label %26
26: ; preds = %25, %9, %2
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @strpos(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = tail call i8* @strstr(i8* %0, i8* %1)
%8 = icmp eq i8* %7, null
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = select i1 %8, i32 -1, i32 %12
br label %14
14: ; preds = %6, %2
%15 = phi i32 [ %13, %6 ], [ -1, %2 ]
ret i32 %15
}
/* Variables and functions */
unsigned short calc2(unsigned short);
unsigned short calc1(unsigned short x) { return calc2(x) + x; }


x86 assembly (clang, -O0):
<calc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <calc2@plt>
movzwl %ax,%eax
movzwl -0x2(%rbp),%ecx
add    %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc1>:
push   %rbx
mov    %edi,%ebx
call   1030 <calc2@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @calc1(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @calc2(i16 zeroext %3)
%5 = zext i16 %4 to i32
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = add nsw i32 %5, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @calc1(i16 zeroext %0) {
%2 = tail call zeroext i16 @calc2(i16 zeroext %0)
%3 = add i16 %2, %0
ret i16 %3
}
int filter_ipv4addr(const struct in_addr *ifaddr, unsigned int flags) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.in_addr = type opaque
define i32 @filter_ipv4addr(%struct.in_addr* %0, i32 %1) {
%3 = alloca %struct.in_addr*
%4 = alloca i32
store %struct.in_addr* %0, %struct.in_addr** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.in_addr = type opaque
define i32 @filter_ipv4addr(%struct.in_addr* nocapture readnone %0, i32 %1) {
ret i32 0
}
void RTAvlroGCPtrGetRight(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPtrGetRight() {
ret void
}
unsigned long gpio_dpin_to_pad(unsigned long pin) {
  static const unsigned long g_ulPinToPadMap[64] = {
      10,  11,  12,  13,  14,  15,  16,  17,  255, 255, 18,  19,  20,
      21,  22,  23,  24,  40,  28,  29,  25,  255, 255, 255, 255, 255,
      255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
      255, 255, 255, 255, 255, 31,  255, 255, 255, 255, 0,   255, 32,
      30,  255, 1,   255, 2,   3,   4,   5,   6,   7,   8,   9};
  return g_ulPinToPadMap[pin];
}


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

x86 assembly (clang, -O2):
<gpio_dpin_to_pad>:
lea    0xef9(%rip),%rax
mov    (%rax,%rdi,8),%rax
ret

LLVM IR (-O0):
@gpio_dpin_to_pad.g_ulPinToPadMap = internal constant [64 x i64] [i64 10, i64 11, i64 12, i64 13, i64 14, i64 15, i64 16, i64 17, i64 255, i64 255, i64 18, i64 19, i64 20, i64 21, i64 22, i64 23, i64 24, i64 40, i64 28, i64 29, i64 25, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 31, i64 255, i64 255, i64 255, i64 255, i64 0, i64 255, i64 32, i64 30, i64 255, i64 1, i64 255, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9]
define i64 @gpio_dpin_to_pad(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = getelementptr inbounds [64 x i64], [64 x i64]* @gpio_dpin_to_pad.g_ulPinToPadMap, i64 0, i64 %3
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
@gpio_dpin_to_pad.g_ulPinToPadMap = internal unnamed_addr constant [64 x i64] [i64 10, i64 11, i64 12, i64 13, i64 14, i64 15, i64 16, i64 17, i64 255, i64 255, i64 18, i64 19, i64 20, i64 21, i64 22, i64 23, i64 24, i64 40, i64 28, i64 29, i64 25, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 31, i64 255, i64 255, i64 255, i64 255, i64 0, i64 255, i64 32, i64 30, i64 255, i64 1, i64 255, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9]
define i64 @gpio_dpin_to_pad(i64 %0) {
%2 = getelementptr inbounds [64 x i64], [64 x i64]* @gpio_dpin_to_pad.g_ulPinToPadMap, i64 0, i64 %0
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_matrix(float **m, int nrl, int nrh, int ncl, int nch) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_matrix(float** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds float*, float** %0, i64 %6
%8 = load float*, float** %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds float, float* %8, i64 %9
%11 = getelementptr inbounds float, float* %10, i64 -1
%12 = bitcast float* %11 to i8*
%13 = tail call i32 @free(i8* %12)
%14 = getelementptr inbounds float*, float** %7, i64 -1
%15 = bitcast float** %14 to i8*
%16 = tail call i32 @free(i8* %15)
ret void
}
int test_ilog2(int x) {
  int mask, result;
  result = 31;
  mask = 1 << result;
  while (!(x & mask)) {
    result--;
    mask = 1 << result;
  }
  return result;
}


x86 assembly (clang, -O0):
<test_ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1f,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1136 <test_ilog2+0x36>
jmp    1151 <test_ilog2+0x51>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <test_ilog2+0x1b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ilog2>:
mov    $0x1f,%eax
test   %edi,%edi
js     1118 <test_ilog2+0x18>
nopl   0x0(%rax)
add    $0xffffffff,%eax
bt     %eax,%edi
jae    1110 <test_ilog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @test_ilog2(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ 31, %1 ]
%5 = add nsw i32 %4, -1
%6 = shl nuw i32 1, %5
%7 = and i32 %6, %0
%8 = icmp eq i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 31, %1 ], [ %5, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int usage(void) {
  printf(
      "bxvrrpd version 0.1 (implementation of RFC 3768)\n"
      "Usage: bxvrrpd -i ifname -v vrid [OPTIONS] ipaddr\n"
      "	-d, --daemonize  : Run as daemon\n"
      "	-i, --ifname     : the LAN interface name to run on\n"
      "	-v, --vrid       : the id of the virtual server [1-255]\n"
      "	-n, --no-preempt : Set non-preempt mode (dfl: preemptible)\n"
      "	-p, --prio       : Set local priority (dfl: 100)\n"
      "	-I, --interval   : Set the advertisement interval (in sec) (dfl: 1)\n"
      "	-h, --help       : help message\n"
      "	    --verbose    : (No implementation)\n"
      "	ipaddr   : the ip address(es) of the virtual server\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [549 x i8] c"bxvrrpd version 0.1 (implementation of RFC 3768)\0AUsage: bxvrrpd -i ifname -v vrid [OPTIONS] ipaddr\0A\09-d, --daemonize : Run as daemon\0A\09-i, --ifname : the LAN interface name to run on\0A\09-v, --vrid : the id of the virtual server [1-255]\0A\09-n, --no-preempt : Set non-preempt mode (dfl: preemptible)\0A\09-p, --prio : Set local priority (dfl: 100)\0A\09-I, --interval : Set the advertisement interval (in sec) (dfl: 1)\0A\09-h, --help : help message\0A\09 --verbose : (No implementation)\0A\09ipaddr : the ip address(es) of the virtual server\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([549 x i8], [549 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [548 x i8] c"bxvrrpd version 0.1 (implementation of RFC 3768)\0AUsage: bxvrrpd -i ifname -v vrid [OPTIONS] ipaddr\0A\09-d, --daemonize : Run as daemon\0A\09-i, --ifname : the LAN interface name to run on\0A\09-v, --vrid : the id of the virtual server [1-255]\0A\09-n, --no-preempt : Set non-preempt mode (dfl: preemptible)\0A\09-p, --prio : Set local priority (dfl: 100)\0A\09-I, --interval : Set the advertisement interval (in sec) (dfl: 1)\0A\09-h, --help : help message\0A\09 --verbose : (No implementation)\0A\09ipaddr : the ip address(es) of the virtual server\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([548 x i8], [548 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ GL_POINTS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex2i(int /*<<< orphan*/, int /*<<< orphan*/);
void draw_pixel(GLint cx, GLint cy) {
  glColor3f(1.0, 0.0, 0.0);
  glBegin(GL_POINTS);
  glVertex2i(cx, cy);
  glEnd();
}


x86 assembly (clang, -O0):
<draw_pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  0xeaa(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1050 <glColor3f@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <glVertex2i@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_pixel>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movsd  0xeb1(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1050 <glColor3f@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <glVertex2i@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_POINTS = global i32 0
define void @draw_pixel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%6 = load i32, i32* @GL_POINTS
%7 = call i32 @glBegin(i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @glVertex2i(i32 %8, i32 %9)
%11 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_POINTS = global i32 0
define void @draw_pixel(i32 %0, i32 %1) {
%3 = tail call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%4 = load i32, i32* @GL_POINTS
%5 = tail call i32 @glBegin(i32 %4)
%6 = tail call i32 @glVertex2i(i32 %0, i32 %1)
%7 = tail call i32 (...) @glEnd()
ret void
}
int ss_leb128skip(char *ssc) {
  unsigned char *start = (unsigned char *)ssc;
  while (*((unsigned char *)ssc++) >= 128)
    ;
  return (unsigned char *)ssc - start;
}


x86 assembly (clang, -O0):
<ss_leb128skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
cmp    $0x80,%eax
jl     1132 <ss_leb128skip+0x32>
jmp    1110 <ss_leb128skip+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_leb128skip>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
js     1110 <ss_leb128skip+0x10>
ret

LLVM IR (-O0):
define i32 @ss_leb128skip(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = icmp sge i32 %9, 128
br i1 %10, label %11, label %12
11: ; preds = %5
br label %5
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @ss_leb128skip(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp slt i8 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _host_usage(void) {
  fputs("Usage: "
        "host"
        " [-46] address\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_host_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_host_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: host [-46] address\0A\00"
@stderr = global i32 0
define i32 @_host_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: host [-46] address\0A\00"
@stderr = global i32 0
define i32 @_host_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
int test_imm_8Auint32_reg(unsigned int val) {
  return ((val) & (0x8A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Auint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x8a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_8Auint32_reg(i32 %0) {
%2 = and i32 %0, 138
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t ftoa(double v, char *buf, int flen, size_t maxlen) { return 0; }


x86 assembly (clang, -O0):
<ftoa>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @ftoa(double %0, i8* %1, i32 %2, i64 %3) {
%5 = alloca double
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
store double %0, double* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i64 %3, i64* %8
ret i64 0
}

LLVM IR (-O2):
define i64 @ftoa(double %0, i8* nocapture readnone %1, i32 %2, i64 %3) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ fillVector(int **, int);
int /*<<< orphan*/ printVector(int **, int);
int main() {
  int v[10];
  fillVector(&v, 10);
  printVector(&v, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <fillVector@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <printVector@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <fillVector@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printVector@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i32**
%3 = call i32 @fillVector(i32** %2, i32 10)
%4 = bitcast [10 x i32]* %1 to i32**
%5 = call i32 @printVector(i32** %4, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = bitcast [10 x i32]* %1 to i32**
%4 = call i32 @fillVector(i32** %3, i32 10)
%5 = call i32 @printVector(i32** %3, i32 10)
ret i32 0
}
void I422ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @I422ToARGB() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ripemd160(unsigned char *, int, unsigned char *);
int /*<<< orphan*/ sha256(unsigned char const *, size_t, unsigned char *);
void sha256_ripemd160(unsigned char const *in, size_t in_size,
                      unsigned char *out) {
  unsigned char h1[32];
  sha256(in, in_size, h1);
  ripemd160(h1, 32, out);
}


x86 assembly (clang, -O0):
<sha256_ripemd160>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1040 <sha256@plt>
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x20,%esi
call   1030 <ripemd160@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha256_ripemd160>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rbx
mov    %rsp,%r14
mov    %r14,%rdx
call   1040 <sha256@plt>
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
call   1030 <ripemd160@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sha256_ripemd160(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca [32 x i8]
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%11 = call i32 @sha256(i8* %8, i64 %9, i8* %10)
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = call i32 @ripemd160(i8* %12, i32 32, i8* %13)
ret void
}

LLVM IR (-O2):
define void @sha256_ripemd160(i8* %0, i64 %1, i8* %2) {
%4 = alloca [32 x i8]
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%6 = call i32 @sha256(i8* %0, i64 %1, i8* %5)
%7 = call i32 @ripemd160(i8* %5, i32 32, i8* %2)
ret void
}
int test_fits_bits(int x, int n) {
  int tmax_n = (1 << (n - 1)) - 1;
  int tmin_n = -tmax_n - 1;
  return x >= tmin_n && x <= tmax_n;
}


x86 assembly (clang, -O0):
<test_fits_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x11(%rbp)
jl     1145 <test_fits_bits+0x45>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fits_bits>:
lea    -0x1(%rsi),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
cmp    %edi,%eax
not    %eax
setle  %cl
cmp    %edi,%eax
setge  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @test_fits_bits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = sub nsw i32 0, %11
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %6
%14 = load i32, i32* %3
%15 = load i32, i32* %6
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %2
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = icmp sle i32 %18, %19
br label %21
21: ; preds = %17, %2
%22 = phi i1 [ false, %2 ], [ %20, %17 ]
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @test_fits_bits(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nsw i32 -1, %3
%5 = xor i32 %4, -1
%6 = icmp sle i32 %4, %0
%7 = icmp sge i32 %5, %0
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_notes(char *notes) {
  write("json-task.json", "\"notes\":\"%s\", ", notes);
}


x86 assembly (clang, -O0):
<function_notes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_notes>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [15 x i8] c"\22notes\22:\22%s\22, \00"
define void @function_notes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [15 x i8] c"\22notes\22:\22%s\22, \00"
define void @function_notes(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int __get_array_size(char *);
int __infer_nondet_int();
char *getcwd(char *buffer, size_t size) {
  int n;
  int size_buf;
  n = __infer_nondet_int();
  if (n > 0) {
    size_buf = __get_array_size(buffer);
    if (size > size_buf)
      while (1)
        ;
    return buffer;
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<getcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1178 <getcwd+0x58>
mov    -0x10(%rbp),%rdi
call   1040 <__get_array_size@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
cmp    %rcx,%rax
jbe    116b <getcwd+0x4b>
jmp    1166 <getcwd+0x46>
jmp    1166 <getcwd+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1180 <getcwd+0x60>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %eax,%eax
jle    1152 <getcwd+0x32>
mov    %rbx,%rdi
call   1040 <__get_array_size@plt>
cltq
cmp    %r14,%rax
jae    1154 <getcwd+0x34>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1150 <getcwd+0x30>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @getcwd(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
%8 = call i32 (...) @__infer_nondet_int()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @__get_array_size(i8* %12)
store i32 %13, i32* %7
%14 = load i64, i64* %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = icmp ugt i64 %14, %16
br i1 %17, label %18, label %20
18: ; preds = %11
br label %19
19: ; preds = %18, %19
br label %19
20: ; preds = %11
%21 = load i8*, i8** %4
store i8* %21, i8** %3
br label %23
22: ; preds = %2
store i8* null, i8** %3
br label %23
23: ; preds = %22, %20
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @getcwd(i8* %0, i64 %1) {
%3 = tail call i32 (...) @__infer_nondet_int()
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @__get_array_size(i8* %0)
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, %1
br i1 %8, label %9, label %10
9: ; preds = %5, %9
br label %9
10: ; preds = %2, %5
%11 = phi i8* [ %0, %5 ], [ null, %2 ]
ret i8* %11
}
double gsl_pow_3(const double x) { return x * x * x; }


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

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

LLVM IR (-O0):
define double @gsl_pow_3(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
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @gsl_pow_3(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int binToDecimal(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Input a binary number: ");
  scanf("%d", &num);
  printf("The decimal version is %d\n", binToDecimal(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <binToDecimal@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <binToDecimal@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Input a binary number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"The decimal version is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @binToDecimal(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Input a binary number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"The decimal version is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @binToDecimal(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          "usage: %s [ [-q msqid] [-m shmid] [-s semid]\n"
          "          [-Q msgkey] [-M shmkey] [-S semkey] ... ]\n",
          progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [98 x i8] c"usage: %s [ [-q msqid] [-m shmid] [-s semid]\0A [-Q msgkey] [-M shmkey] [-S semkey] ... ]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [98 x i8] c"usage: %s [ [-q msqid] [-m shmid] [-s semid]\0A [-Q msgkey] [-M shmkey] [-S semkey] ... ]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}