xunge/DecIR huggingface dataset:
__attribute__((always_)) void flush_tlb_pgtables(struct mm_struct *mm,
                                                 unsigned long start,
                                                 unsigned long end) {}


x86 assembly (clang, -O0):
<flush_tlb_pgtables>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @flush_tlb_pgtables(%struct.mm_struct* nocapture %0, i64 %1, i64 %2) {
ret void
}
void pci_disable_link_state(struct pci_dev *pdev, int state) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_disable_link_state(%struct.pci_dev* nocapture %0, i32 %1) {
ret void
}
int find(int a, int parent[]) {
  if (parent[a] == a)
    return a;
  else
    return find(parent[a], parent);
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    113e <find+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <find+0x45>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rsi
call   1030 <find@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    %edi,%eax
movslq %edi,%rcx
mov    (%rsi,%rcx,4),%edi
cmp    %ecx,%edi
jne    1100 <find>
ret

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

LLVM IR (-O2):
define i32 @find(i32 %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %7, %3 ]
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, %4
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ checkheap(int);
void mm_checkheap(int verbose) { checkheap(verbose); }


x86 assembly (clang, -O0):
<mm_checkheap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <checkheap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_checkheap>:
jmp    1030 <checkheap@plt>

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

LLVM IR (-O2):
define void @mm_checkheap(i32 %0) {
%2 = tail call i32 @checkheap(i32 %0)
ret void
}
/* Variables and functions */
int ENXIO;
int arch_timer_sched_clock_init(void) { return -ENXIO; }


x86 assembly (clang, -O0):
<arch_timer_sched_clock_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_timer_sched_clock_init>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @arch_timer_sched_clock_init() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @arch_timer_sched_clock_init() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ DecodeI_xxxxxxxxssmmmrrr();
int /*<<< orphan*/ DoBinOr(int /*<<< orphan*/);
void DoCodeOrI(void) { DoBinOr(DecodeI_xxxxxxxxssmmmrrr()); }


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

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

LLVM IR (-O0):
define void @DoCodeOrI() {
%1 = call i32 (...) @DecodeI_xxxxxxxxssmmmrrr()
%2 = call i32 @DoBinOr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeOrI() {
%1 = tail call i32 (...) @DecodeI_xxxxxxxxssmmmrrr()
%2 = tail call i32 @DoBinOr(i32 %1)
ret void
}
int a_sc(int a, signed char *b, int *c) {
  int d = a + *b;
  *c = d == 0;
  return d;
}


x86 assembly (clang, -O0):
<a_sc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_sc>:
movsbl (%rsi),%eax
xor    %ecx,%ecx
add    %edi,%eax
sete   %cl
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define i32 @a_sc(i32 %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add nsw i32 %8, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = load i32*, i32** %6
store i32 %15, i32* %16
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @a_sc(i32 %0, i8* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, %0
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %2
ret i32 %6
}
/* Variables and functions */
int __ESBMC_isnan(double);
int isnan(double d) { return __ESBMC_isnan(d); }


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

x86 assembly (clang, -O2):
<isnan>:
jmp    1030 <__ESBMC_isnan@plt>

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

LLVM IR (-O2):
define i32 @isnan(double %0) {
%2 = tail call i32 @__ESBMC_isnan(double %0)
ret i32 %2
}
int ti_vhf_start(double const *options) { return (int)options[0]; }


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

x86 assembly (clang, -O2):
<ti_vhf_start>:
cvttsd2si (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ti_vhf_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ti_vhf_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int func_arg0(char *p) {
  strcpy(p, "Hello another world!");
  return strlen(p);
}


x86 assembly (clang, -O0):
<func_arg0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_arg0>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strlen@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Hello another world!\00"
define i32 @func_arg0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [21 x i8] c"Hello another world!\00"
define i32 @func_arg0(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strlen(i8* %0)
ret i32 %3
}
char stateToChar(int state) {
  char c = '0' + state;
  switch (state) {
  case 1:
    c = 'O';
    break;
  case -1:
    c = 'X';
    break;
  case 0:
    c = ' ';
    break;
  }
  return c;
}


x86 assembly (clang, -O0):
<stateToChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%al
add    $0x30,%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xffffffff,%eax
je     114d <stateToChar+0x4d>
jmp    1123 <stateToChar+0x23>
mov    -0xc(%rbp),%eax
test   %eax,%eax
je     1156 <stateToChar+0x56>
jmp    1133 <stateToChar+0x33>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
jne    115a <stateToChar+0x5a>
jmp    1144 <stateToChar+0x44>
movb   $0x4f,-0x5(%rbp)
jmp    115a <stateToChar+0x5a>
movb   $0x58,-0x5(%rbp)
jmp    115a <stateToChar+0x5a>
movb   $0x20,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stateToChar>:
lea    0x30(%rdi),%eax
lea    0x8(,%rdi,8),%ecx
mov    %edi,%edx
add    $0x1,%edx
mov    $0x4f2058,%esi
shr    %cl,%esi
cmp    $0x3,%edx
movzbl %al,%eax
cmovb  %esi,%eax
ret

LLVM IR (-O0):
define signext i8 @stateToChar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 48, %4
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = load i32, i32* %2
switch i32 %7, label %11 [
i32 1, label %8
i32 -1, label %9
i32 0, label %10
]
8: ; preds = %1
store i8 79, i8* %3
br label %11
9: ; preds = %1
store i8 88, i8* %3
br label %11
10: ; preds = %1
store i8 32, i8* %3
br label %11
11: ; preds = %1, %10, %9, %8
%12 = load i8, i8* %3
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @stateToChar(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
%4 = add i32 %0, 1
%5 = icmp ult i32 %4, 3
%6 = trunc i32 %4 to i24
%7 = shl i24 %6, 3
%8 = lshr i24 5185624, %7
%9 = trunc i24 %8 to i8
%10 = select i1 %5, i8 %9, i8 %3
ret i8 %10
}
char *hash_plugin_summary(void) {
  return ("pixmd5 \t\tCisco PIX password hashes plugin");
}


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_summary>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [42 x i8] c"pixmd5 \09\09Cisco PIX password hashes plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [42 x i8] c"pixmd5 \09\09Cisco PIX password hashes plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void star(int n) {
  printf("      *");
  printf("     * *");
  printf("    *   *");
}


x86 assembly (clang, -O0):
<star>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c" *\00"
@.str.1 = [9 x i8] c" * *\00"
@.str.2 = [10 x i8] c" * *\00"
define void @star(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c" *\00"
@.str.1 = [9 x i8] c" * *\00"
@.str.2 = [10 x i8] c" * *\00"
define void @star(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int putchar(int c) {
  putc(c, stdout);
  return (c);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <putc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
call   1030 <putc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = call i32 @putc(i32 %3, i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @putchar(i32 returned %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @putc(i32 %0, i32 %2)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ reverse_string(char *, int, int);
void left_to_right(char *c, int n, int m) {
  m = m % n;
  reverse_string(c, 0, m - 1);
  reverse_string(c, m, n - 1);
  reverse_string(c, 0, n - 1);
}


x86 assembly (clang, -O0):
<left_to_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <reverse_string@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse_string@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <reverse_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<left_to_right>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%eax
mov    %esi,%ebx
mov    %rdi,%r14
cltd
idiv   %esi
mov    %edx,%r15d
lea    -0x1(%r15),%edx
xor    %esi,%esi
call   1030 <reverse_string@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
call   1030 <reverse_string@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <reverse_string@plt>

LLVM IR (-O0):
define void @left_to_right(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = srem i32 %7, %8
store i32 %9, i32* %6
%10 = load i8*, i8** %4
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 1
%13 = call i32 @reverse_string(i8* %10, i32 0, i32 %12)
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = sub nsw i32 %16, 1
%18 = call i32 @reverse_string(i8* %14, i32 %15, i32 %17)
%19 = load i8*, i8** %4
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
%22 = call i32 @reverse_string(i8* %19, i32 0, i32 %21)
ret void
}

LLVM IR (-O2):
define void @left_to_right(i8* %0, i32 %1, i32 %2) {
%4 = srem i32 %2, %1
%5 = add nsw i32 %4, -1
%6 = tail call i32 @reverse_string(i8* %0, i32 0, i32 %5)
%7 = add nsw i32 %1, -1
%8 = tail call i32 @reverse_string(i8* %0, i32 %4, i32 %7)
%9 = tail call i32 @reverse_string(i8* %0, i32 0, i32 %7)
ret void
}
signed long long signedlonglong_ignoring_signedshort(signed long long x,
                                                     signed short y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlonglong_ignoring_signedshort(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_signedshort(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pstream_new() {
  printf("NOT IMPLEMENTED:"
         "pa_pstream_new"
         "\n");
}


x86 assembly (clang, -O0):
<pa_pstream_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_pstream_new\0A\00"
define i32 @pa_pstream_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_pstream_new\00"
define i32 @pa_pstream_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void os_apm_printinfo(struct olsr_apm_info *ApmInfo __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
%struct.olsr_apm_info = type opaque
define void @os_apm_printinfo(%struct.olsr_apm_info* nocapture %0) {
ret void
}
/* Variables and functions */
double fastexp2(double);
double fastlog2(double);
double fastpow(double x, double y) { return fastexp2(fastlog2(x) * y); }


x86 assembly (clang, -O0):
<fastpow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <fastlog2@plt>
mulsd  -0x10(%rbp),%xmm0
call   1030 <fastexp2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastpow>:
push   %rax
movsd  %xmm1,(%rsp)
call   1040 <fastlog2@plt>
mulsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <fastexp2@plt>

LLVM IR (-O0):
define double @fastpow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @fastlog2(double %5)
%7 = load double, double* %4
%8 = fmul double %6, %7
%9 = call double @fastexp2(double %8)
ret double %9
}

LLVM IR (-O2):
define double @fastpow(double %0, double %1) {
%3 = tail call double @fastlog2(double %0)
%4 = fmul double %3, %1
%5 = tail call double @fastexp2(double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void sys_sleep(unsigned int msec) { usleep(msec * 1000); }


x86 assembly (clang, -O0):
<sys_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @sys_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @sys_sleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int, int, int);
int main() {
  test(1, 2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
scalar_t__ in_range(int const, char, char);
bool is_alpha(const int c) {
  return in_range(c, 'A', 'Z') || in_range(c, 'a', 'z');
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x41,%esi
mov    $0x5a,%edx
call   1030 <in_range@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    115b <is_alpha+0x4b>
mov    -0x4(%rbp),%edi
mov    $0x61,%esi
mov    $0x7a,%edx
call   1030 <in_range@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
push   %rbx
mov    %edi,%ebx
mov    $0x41,%esi
mov    $0x5a,%edx
call   1030 <in_range@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1131 <is_alpha+0x21>
pop    %rbx
ret
mov    %ebx,%edi
mov    $0x61,%esi
mov    $0x7a,%edx
call   1030 <in_range@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_alpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @in_range(i32 %3, i8 signext 65, i8 signext 90)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @in_range(i32 %7, i8 signext 97, i8 signext 122)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_alpha(i32 %0) {
%2 = tail call i64 @in_range(i32 %0, i8 signext 65, i8 signext 90)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @in_range(i32 %0, i8 signext 97, i8 signext 122)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int l_fast;
  static int s_l_fast;
  l_fast = 1;
  s_l_fast = 2;
  l_fast = foo(s_l_fast);
  printf("%d\n", l_fast);
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_GET_FD_BY_ID;
int /*<<< orphan*/ bzero(union bpf_attr *, int);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_map_get_fd_by_id(__u32 id) {
  union bpf_attr attr;
  bzero(&attr, sizeof(attr));
  attr.map_id = id;
  return sys_bpf(BPF_MAP_GET_FD_BY_ID, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_map_get_fd_by_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <bzero@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_map_get_fd_by_id>:
push   %rax
mov    %edi,(%rsp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_MAP_GET_FD_BY_ID = global i32 0
define i32 @bpf_map_get_fd_by_id(i32 %0) {
%2 = alloca i32
%3 = alloca %union.bpf_attr
store i32 %0, i32* %2
%4 = call i32 @bzero(%union.bpf_attr* %3, i32 4)
%5 = load i32, i32* %2
%6 = bitcast %union.bpf_attr* %3 to i32*
store i32 %5, i32* %6
%7 = load i32, i32* @BPF_MAP_GET_FD_BY_ID
%8 = call i32 @sys_bpf(i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_MAP_GET_FD_BY_ID = global i32 0
define i32 @bpf_map_get_fd_by_id(i32 %0) {
%2 = alloca %union.bpf_attr
%3 = bitcast %union.bpf_attr* %2 to i8*
%4 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = load i32, i32* @BPF_MAP_GET_FD_BY_ID
%6 = call i32 @sys_bpf(i32 %5, %union.bpf_attr* %2, i32 4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ write(int /*<<< orphan*/, int /*<<< orphan*/ *,
                         int /*<<< orphan*/);
ssize_t qmi_helpers_write(int32_t qmi_fd, uint8_t *buf, ssize_t len) {
  return write(qmi_fd, buf, len);
}


x86 assembly (clang, -O0):
<qmi_helpers_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qmi_helpers_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @qmi_helpers_write(i32 %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void av_freep(void *ptr) {
  if (ptr) {
    void **arg = (void **)ptr;
    free(*arg);
    *arg = 0;
  }
}


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

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

LLVM IR (-O0):
define void @av_freep(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
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 i8**
store i8** %8, i8*** %3
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
%12 = load i8**, i8*** %3
store i8* null, i8** %12
br label %13
13: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @av_freep(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = tail call i32 @free(i8* %5)
store i8* null, i8** %4
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void crash(const char *filename) {
  perror(filename);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<crash>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @crash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @crash(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int pldummy_tek() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_tek() {
ret i32 0
}
void cpupri_cleanup(struct cpupri *cp) {}


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

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

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

LLVM IR (-O2):
%struct.cpupri = type opaque
define void @cpupri_cleanup(%struct.cpupri* nocapture %0) {
ret void
}
/* Variables and functions */
float fractal_sxnoise_2d(float, float, int, double, double, double, double);
float fractal_2d_noise(float x, float y) {
  return fractal_sxnoise_2d(x * 0.5, y * 0.5, 4, 2.0, 0.5, 0.0, 0.0);
}


x86 assembly (clang, -O0):
<fractal_2d_noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xebc(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
mov    $0x4,%edi
movsd  0xe9f(%rip),%xmm2
movsd  0xe9f(%rip),%xmm3
xorps  %xmm5,%xmm5
movaps %xmm5,%xmm4
call   1030 <fractal_sxnoise_2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fractal_2d_noise>:
movss  0xee8(%rip),%xmm2
mulss  %xmm2,%xmm0
mulss  %xmm2,%xmm1
movsd  0xee0(%rip),%xmm2
movsd  0xee0(%rip),%xmm3
xorps  %xmm4,%xmm4
xorps  %xmm5,%xmm5
mov    $0x4,%edi
jmp    1030 <fractal_sxnoise_2d@plt>

LLVM IR (-O0):
define float @fractal_2d_noise(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fmul double %6, 5.000000e-01
%8 = fptrunc double %7 to float
%9 = load float, float* %4
%10 = fpext float %9 to double
%11 = fmul double %10, 5.000000e-01
%12 = fptrunc double %11 to float
%13 = call float @fractal_sxnoise_2d(float %8, float %12, i32 4, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00)
ret float %13
}

LLVM IR (-O2):
define float @fractal_2d_noise(float %0, float %1) {
%3 = fmul float %0, 5.000000e-01
%4 = fmul float %1, 5.000000e-01
%5 = tail call float @fractal_sxnoise_2d(float %3, float %4, i32 4, double 2.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: mkfs.minix <input file> <ninodes> <nblocks>\n");
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"usage: mkfs.minix <input file> <ninodes> <nblocks>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [51 x i8] c"usage: mkfs.minix <input file> <ninodes> <nblocks>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
int int_from_string(const char **str) {
  int ret = 0;
  while (**str >= '0' && **str <= '9') {
    ret *= 10;
    ret += **str - '0';
    (*str)++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<int_from_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     113a <int_from_string+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <int_from_string+0x4a>
jmp    1177 <int_from_string+0x77>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    110f <int_from_string+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_from_string>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
lea    -0x30(%rdx),%esi
xor    %eax,%eax
cmp    $0x9,%sil
ja     113f <int_from_string+0x3f>
add    $0x1,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movzbl %dl,%edx
lea    (%rax,%rax,4),%eax
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
mov    %rcx,(%rdi)
movzbl (%rcx),%edx
lea    -0x30(%rdx),%esi
add    $0x1,%rcx
cmp    $0xa,%sil
jb     1120 <int_from_string+0x20>
ret

LLVM IR (-O0):
define i32 @int_from_string(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %16
10: ; preds = %4
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 57
br label %16
16: ; preds = %10, %4
%17 = phi i1 [ false, %4 ], [ %15, %10 ]
br i1 %17, label %18, label %31
18: ; preds = %16
%19 = load i32, i32* %3
%20 = mul nsw i32 %19, 10
store i32 %20, i32* %3
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %24, 48
%26 = load i32, i32* %3
%27 = add nsw i32 %26, %25
store i32 %27, i32* %3
%28 = load i8**, i8*** %2
%29 = load i8*, i8** %28
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %28
br label %4
31: ; preds = %16
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @int_from_string(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %3, %1 ]
%8 = phi i8* [ %14, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = zext i8 %7 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(void) {
  for (;;) {
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @sleep(i32 1)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int hea_test_u64_bit(int /*<<< orphan*/ const, int);
int hea_cq_aer_mem_access_err_check(const __u64 *aer) {
  return hea_test_u64_bit(*aer, 33);
}


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

x86 assembly (clang, -O2):
<hea_cq_aer_mem_access_err_check>:
mov    (%rdi),%edi
mov    $0x21,%esi
jmp    1030 <hea_test_u64_bit@plt>

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

LLVM IR (-O2):
define i32 @hea_cq_aer_mem_access_err_check(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_test_u64_bit(i32 %2, i32 33)
ret i32 %3
}
int main(void) { return 56; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x38,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 56
}
void SensorSetET_SANYO(unsigned char *RegBuf, unsigned char div) {}


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

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

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

LLVM IR (-O2):
define void @SensorSetET_SANYO(i8* nocapture %0, i8 zeroext %1) {
ret void
}
void NCONF_free(void) {}


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

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

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

LLVM IR (-O2):
define void @NCONF_free() {
ret void
}
void cscF(signed char *x) {
  char *y;
  y = x;
}


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

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

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

LLVM IR (-O2):
define void @cscF(i8* nocapture %0) {
ret void
}
void test73_Test_16_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test73_Test_16_targetInit__I() {
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *buildTree();
int /*<<< orphan*/ swapNodes(struct node *);
int main() {
  struct node *root;
  int height;
  root = buildTree();
  swapNodes(root);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
%3 = alloca i32
store i32 0, i32* %1
%4 = call %struct.node* (...) @buildTree()
store %struct.node* %4, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
%6 = call i32 @swapNodes(%struct.node* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = tail call %struct.node* (...) @buildTree()
%2 = tail call i32 @swapNodes(%struct.node* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello, \cworld\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, cworld\0A\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 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, cworld\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
scalar_t__ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ unix_error(char *);
void my_pthread_detach(pthread_t thread, char *errormsg) {
  if (pthread_detach(thread) != 0) {
    unix_error(errormsg);
  }
}


x86 assembly (clang, -O0):
<my_pthread_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pthread_detach@plt>
cmp    $0x0,%rax
je     114a <my_pthread_detach+0x2a>
mov    -0x10(%rbp),%rdi
call   1040 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_detach>:
push   %rbx
mov    %rsi,%rbx
call   1030 <pthread_detach@plt>
test   %rax,%rax
je     1137 <my_pthread_detach+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <unix_error@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @my_pthread_detach(i32 %0, i8* %1) {
%3 = tail call i64 @pthread_detach(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
float sqrt(float);
float trigono(float x, float y) {
  float ypoteinoysa, p;
  ypoteinoysa = sqrt(x * x + y * y);
  p = ypoteinoysa + x + y;
  return p;
}


x86 assembly (clang, -O0):
<trigono>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trigono>:
movaps %xmm0,%xmm3
movaps %xmm1,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm0,%xmm0
addss  %xmm2,%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jb     1130 <trigono+0x20>
sqrtss %xmm0,%xmm0
jmp    1150 <trigono+0x40>
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm3,(%rsp)
call   1030 <sqrt@plt>
movss  (%rsp),%xmm3
movss  0x4(%rsp),%xmm1
add    $0x8,%rsp
addss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @trigono(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = load float, float* %3
%9 = load float, float* %4
%10 = load float, float* %4
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
%13 = call float @sqrt(float %12)
store float %13, float* %5
%14 = load float, float* %5
%15 = load float, float* %3
%16 = fadd float %14, %15
%17 = load float, float* %4
%18 = fadd float %16, %17
store float %18, float* %6
%19 = load float, float* %6
ret float %19
}

LLVM IR (-O2):
define float @trigono(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = tail call float @sqrt(float %4)
%6 = fadd float %5, %0
%7 = fadd float %6, %1
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void child_death(int p) {
  waitpid(-1, NULL, WNOHANG);
  signal(SIGCHLD, child_death);
}


x86 assembly (clang, -O0):
<child_death>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    0x2e9e(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_death>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2eaa(%rip),%rsi
pop    %rax
jmp    1030 <signal@plt>

LLVM IR (-O0):
@WNOHANG = global i32 0
@SIGCHLD = global i32 0
define void @child_death(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @WNOHANG
%4 = call i32 @waitpid(i32 -1, i32* null, i32 %3)
%5 = load i32, i32* @SIGCHLD
%6 = call i32 @signal(i32 %5, void (i32)* @child_death)
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@SIGCHLD = global i32 0
define void @child_death(i32 %0) {
%2 = load i32, i32* @WNOHANG
%3 = tail call i32 @waitpid(i32 -1, i32* null, i32 %2)
%4 = load i32, i32* @SIGCHLD
%5 = tail call i32 @signal(i32 %4, void (i32)* @child_death)
ret void
}