xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++)
    printf("arg[%d] = %s\n", i, argv[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"arg[%d] = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
int eg_indirect_table_get(unsigned int, int, unsigned int, int, unsigned int *);
int eg_sa_table_get(unsigned int dev_id, unsigned int index,
                    unsigned int *pentry) {
  if ((index < 32) || (index > 63)) {
    return -1;
  }
  return eg_indirect_table_get(dev_id, 2, index, 4, pentry);
}


x86 assembly (clang, -O0):
<eg_sa_table_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x20,-0xc(%rbp)
jb     1136 <eg_sa_table_get+0x26>
cmpl   $0x3f,-0xc(%rbp)
jbe    1142 <eg_sa_table_get+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <eg_sa_table_get+0x4e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x2,%esi
mov    $0x4,%ecx
call   1030 <eg_indirect_table_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eg_sa_table_get>:
mov    %esi,%eax
and    $0xffffffe0,%eax
cmp    $0x20,%eax
jne    112e <eg_sa_table_get+0x1e>
mov    %rdx,%r8
mov    %esi,%edx
mov    $0x2,%esi
mov    $0x4,%ecx
jmp    1030 <eg_indirect_table_get@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @eg_sa_table_get(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 32
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 63
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 -1, i32* %4
br label %19
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @eg_indirect_table_get(i32 %15, i32 2, i32 %16, i32 4, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @eg_sa_table_get(i32 %0, i32 %1, i32* %2) {
%4 = and i32 %1, -32
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @eg_indirect_table_get(i32 %0, i32 2, i32 %1, i32 4, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ strtol(char const *, char **, int);
int strtoi(const char *str, char **endptr, int base) {
  return (int)strtol(str, endptr, base);
}


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

x86 assembly (clang, -O2):
<strtoi>:
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i32 @strtoi(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtol(i8* %0, i8** %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
unsigned int EFlash_Read(unsigned int waddr) {
  unsigned int eflash_read = *(volatile unsigned int *)waddr;
  return eflash_read;
}


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

x86 assembly (clang, -O2):
<EFlash_Read>:
mov    %edi,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @EFlash_Read(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @EFlash_Read(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
ret i32 %4
}
int ft_isprint(int c) {
  if ((c >= 32 && c <= 126))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     1127 <ft_isprint+0x27>
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <ft_isprint+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isprint+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ hash;

/* Variables and functions */
scalar_t__ fs_exsists(char *);
int /*<<< orphan*/ strcat(char *, char *);
int c3c0_h45h(char *restrict hash) {
  char filepath[sizeof(hash) + 10] = ".1337-617/";
  strcat(filepath, hash);
  if (fs_exsists(filepath)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<c3c0_h45h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcat@plt>
lea    -0x30(%rbp),%rdi
call   1040 <fs_exsists@plt>
cmp    $0x0,%rax
je     1179 <c3c0_h45h+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1180 <c3c0_h45h+0x60>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c3c0_h45h>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rsi
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    %rbx,%rdi
call   1040 <fs_exsists@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.c3c0_h45h.filepath = [18 x i8] c".1337-617/\00\00\00\00\00\00\00\00"
define i32 @c3c0_h45h(i8* noalias %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [18 x i8]
store i8* %0, i8** %3
%5 = bitcast [18 x i8]* %4 to i8*
%6 = getelementptr inbounds [18 x i8], [18 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcat(i8* %6, i8* %7)
%9 = getelementptr inbounds [18 x i8], [18 x i8]* %4, i64 0, i64 0
%10 = call i64 @fs_exsists(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %14
13: ; preds = %1
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@__const.c3c0_h45h.filepath = [18 x i8] c".1337-617/\00\00\00\00\00\00\00\00"
define i32 @c3c0_h45h(i8* noalias %0) {
%2 = alloca [18 x i8]
%3 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcat(i8* %3, i8* %0)
%5 = call i64 @fs_exsists(i8* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void __s32_print(void *cc, void *k, void *v) {
  fprintf(stdout, "(%s,%s)\n", (char *)k, (char *)v);
}


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

x86 assembly (clang, -O2):
<__s32_print>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"(%s,%s)\0A\00"
define void @__s32_print(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"(%s,%s)\0A\00"
define void @__s32_print(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int __builtin_arc_lr(int);
int foo(int x) { return __builtin_arc_lr(x); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <__builtin_arc_lr@plt>

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @__builtin_arc_lr(i32 %0)
ret i32 %2
}
long long testClosureVrLL(long long (*closure)(void)) { return (*closure)(); }


x86 assembly (clang, -O0):
<testClosureVrLL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrLL>:
jmp    *%rdi

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

LLVM IR (-O2):
define i64 @testClosureVrLL(i64 ()* nocapture %0) {
%2 = tail call i64 %0()
ret i64 %2
}
/* Type definitions */
struct Qnode {
  int dummy;
};

/* Variables and functions */
int queue_empty(struct Qnode *front, struct Qnode *rear) {
  if (front == rear && front == NULL) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<queue_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1131 <queue_empty+0x31>
cmpq   $0x0,-0x10(%rbp)
jne    1131 <queue_empty+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <queue_empty+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_empty>:
xor    %eax,%eax
or     %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.Qnode = type { i32 }
define i32 @queue_empty(%struct.Qnode* %0, %struct.Qnode* %1) {
%3 = alloca i32
%4 = alloca %struct.Qnode*
%5 = alloca %struct.Qnode*
store %struct.Qnode* %0, %struct.Qnode** %4
store %struct.Qnode* %1, %struct.Qnode** %5
%6 = load %struct.Qnode*, %struct.Qnode** %4
%7 = load %struct.Qnode*, %struct.Qnode** %5
%8 = icmp eq %struct.Qnode* %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load %struct.Qnode*, %struct.Qnode** %4
%11 = icmp eq %struct.Qnode* %10, null
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 1, i32* %3
br label %14
13: ; preds = %9, %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.Qnode = type { i32 }
define i32 @queue_empty(%struct.Qnode* readnone %0, %struct.Qnode* readnone %1) {
%3 = icmp eq %struct.Qnode* %0, null
%4 = icmp eq %struct.Qnode* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void nseel_asm_max_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_max_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_test();
int /*<<< orphan*/ print_error(char *, char const *const, int const);
void _fail(const char *const file, const int line) {
  print_error("ERROR: "
              "%s:%d"
              " Failure!\n",
              file, line);
  exit_test();
}


x86 assembly (clang, -O0):
<_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <print_error@plt>
mov    $0x0,%al
call   1040 <exit_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fail>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <print_error@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <exit_test@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"ERROR: %s:%d Failure!\0A\00"
define void @_fail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @print_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 (...) @exit_test()
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"ERROR: %s:%d Failure!\0A\00"
define void @_fail(i8* %0, i32 %1) {
%3 = tail call i32 @print_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 (...) @exit_test()
ret void
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_0a(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x3Db979DB;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_0a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x3db979db,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_0a>:
xor    $0x3db979db,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_0a(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = xor i32 %6, 1035565531
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_0a(i32 %0, i32 %1) {
%3 = xor i32 %0, 1035565531
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int, char, int);
int main(void) {
  int index;
  for (index = 'A'; index <= 'Z'; index++)
    printf("%c\t%3d\t\t%c\t%3d\n", (char)index, index, (char)index + 32,
           index + 32);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x41,-0x8(%rbp)
cmpl   $0x5a,-0x8(%rbp)
jg     1169 <main+0x59>
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x20,%eax
mov    -0x8(%rbp),%r8d
add    $0x20,%r8d
lea    0xeb0(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%ecx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x41,%ebx
mov    $0x61,%al
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x20(%rbx),%r8d
movsbl %al,%ebp
add    $0xe0,%al
movsbl %al,%esi
mov    %r14,%rdi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
add    $0x1,%bpl
add    $0x1,%ebx
mov    %ebp,%eax
cmp    $0x5b,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"%c\09%3d\09\09%c\09%3d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 65, %0 ], [ %7, %1 ]
%3 = trunc i32 %2 to i8
%4 = add nuw nsw i8 %3, 32
%5 = add nuw nsw i32 %2, 32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 signext %3, i32 %2, i8 signext %4, i32 %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 91
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
int isalpha(int c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <isalpha+0x39>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void voip_writeInt16(int16_t v, void *p) {
  v = htons(v);
  memcpy(p, &v, 2);
}


x86 assembly (clang, -O0):
<voip_writeInt16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voip_writeInt16>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @voip_writeInt16(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 i32 @htons(i32 %5)
store i32 %6, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @memcpy(i8* %7, i32* %3, i32 2)
ret void
}

LLVM IR (-O2):
define void @voip_writeInt16(i32 %0, i8* %1) {
%3 = alloca i32
%4 = tail call i32 @htons(i32 %0)
store i32 %4, i32* %3
%5 = call i32 @memcpy(i8* %1, i32* %3, i32 2)
ret void
}
int f3(struct s1 *p) {
  return (__extension__(struct s7 { int j; } *) p)->j;
}


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

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

LLVM IR (-O0):
%struct.s1 = type opaque
%struct.s7 = type { i32 }
define i32 @f3(%struct.s1* %0) {
%2 = alloca %struct.s1*
store %struct.s1* %0, %struct.s1** %2
%3 = load %struct.s1*, %struct.s1** %2
%4 = bitcast %struct.s1* %3 to %struct.s7*
%5 = getelementptr inbounds %struct.s7, %struct.s7* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.s1 = type opaque
define i32 @f3(%struct.s1* nocapture %0) {
%2 = bitcast %struct.s1* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XVisualInfo;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ DefaultScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *glXChooseVisual(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int *);
int /*<<< orphan*/ printf(char *);
XVisualInfo *_getXvis(Display *dpy, int *attr) {
  XVisualInfo *vis = glXChooseVisual(dpy, DefaultScreen(dpy), attr);
  if (vis == NULL) {
    printf("ERROR: no RGBA visual");
    exit(0);
  }
  return vis;
}


x86 assembly (clang, -O0):
<_getXvis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <DefaultScreen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <glXChooseVisual@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1192 <_getXvis+0x52>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getXvis>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1060 <DefaultScreen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
call   1040 <glXChooseVisual@plt>
test   %rax,%rax
je     1169 <_getXvis+0x29>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"ERROR: no RGBA visual\00"
define i32* @_getXvis(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 @DefaultScreen(i32* %7)
%9 = load i32*, i32** %4
%10 = call i32* @glXChooseVisual(i32* %6, i32 %8, i32* %9)
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@.str = [22 x i8] c"ERROR: no RGBA visual\00"
define i32* @_getXvis(i32* %0, i32* %1) {
%3 = tail call i32 @DefaultScreen(i32* %0)
%4 = tail call i32* @glXChooseVisual(i32* %0, i32 %3, i32* %1)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
ret i32* %4
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void setCursor(uint8_t x, uint8_t y) {
  uint8_t seq[4] = "\e#??";
  seq[2] = x;
  seq[3] = y;
  write(1, seq, 4);
}


x86 assembly (clang, -O0):
<setCursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    0xed6(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x4(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCursor>:
push   %rax
movl   $0x3f3f231b,0x4(%rsp)
3f
mov    %dil,0x6(%rsp)
mov    %sil,0x7(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.setCursor.seq = [4 x i8] c"\1B#??"
define void @setCursor(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca [4 x i8]
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = bitcast [4 x i8]* %5 to i8*
%7 = load i8, i8* %3
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
store i8 %7, i8* %8
%9 = load i8, i8* %4
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
store i8 %9, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%12 = call i32 @write(i32 1, i8* %11, i32 4)
ret void
}

LLVM IR (-O2):
define void @setCursor(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to [4 x i8]*
%5 = bitcast i32* %3 to i8*
store i32 1061102363, i32* %3
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 %0, i8* %6
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
store i8 %1, i8* %7
%8 = call i32 @write(i32 1, i8* %5, i32 4)
ret void
}
/* Type definitions */
struct ip {
  int /*<<< orphan*/ ip_off;
};

/* Variables and functions */
int IP_OFFMASK;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int ntohs(int /*<<< orphan*/);
int IsIpFragment(unsigned char *ipPacket) {
  struct ip *iph;
  assert(ipPacket != NULL);
  iph = (struct ip *)ipPacket;
  if ((ntohs(iph->ip_off) & IP_OFFMASK) != 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<IsIpFragment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1040 <ntohs@plt>
mov    0x2e90(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     116f <IsIpFragment+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <IsIpFragment+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsIpFragment>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%edi
call   1040 <ntohs@plt>
mov    0x2ea8(%rip),%rdx
xor    %ecx,%ecx
test   %eax,(%rdx)
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ip = type { i32 }
@IP_OFFMASK = global i32 0
define i32 @IsIpFragment(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.ip*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to %struct.ip*
store %struct.ip* %10, %struct.ip** %4
%11 = load %struct.ip*, %struct.ip** %4
%12 = getelementptr inbounds %struct.ip, %struct.ip* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @ntohs(i32 %13)
%15 = load i32, i32* @IP_OFFMASK
%16 = and i32 %14, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %1
store i32 1, i32* %2
br label %20
19: ; preds = %1
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@IP_OFFMASK = global i32 0
define i32 @IsIpFragment(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @ntohs(i32 %6)
%8 = load i32, i32* @IP_OFFMASK
%9 = and i32 %8, %7
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
int maxthree(int a, int b, int c) {
  int max = a;
  if (b > max) {
    max = b;
  }
  if (c > max) {
    max = c;
  }
  return max;
}


x86 assembly (clang, -O0):
<maxthree>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1125 <maxthree+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1137 <maxthree+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @maxthree(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %5
store i32 %13, i32* %7
br label %14
14: ; preds = %12, %3
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32, i32* %6
store i32 %19, i32* %7
br label %20
20: ; preds = %18, %14
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @maxthree(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ case1();
int /*<<< orphan*/ case2();
int /*<<< orphan*/ case3();
int main() {
  case1();
  case2();
  case3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @case1()
%2 = tail call i32 (...) @case2()
%3 = tail call i32 (...) @case3()
ret i32 0
}
/* Variables and functions */
scalar_t__ ack(int, int);
scalar_t__ wait_reply(int, int);
int fping_monitor(int sfd) {
  int err = 0;
  if (sfd < 0)
    return sfd;
  if (ack(sfd, 20) != 0)
    err = -1;
  if (!err && wait_reply(sfd, 20) != 0)
    err = -1;
  return err;
}


x86 assembly (clang, -O0):
<fping_monitor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1147 <fping_monitor+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1193 <fping_monitor+0x73>
mov    -0x8(%rbp),%edi
mov    $0x14,%esi
call   1030 <ack@plt>
cmp    $0x0,%rax
je     1165 <fping_monitor+0x45>
movl   $0xffffffff,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    118d <fping_monitor+0x6d>
mov    -0x8(%rbp),%edi
mov    $0x14,%esi
call   1040 <wait_reply@plt>
cmp    $0x0,%rax
je     118d <fping_monitor+0x6d>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fping_monitor>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
js     1142 <fping_monitor+0x22>
mov    %ebx,%edi
mov    $0x14,%esi
call   1030 <ack@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1146 <fping_monitor+0x26>
pop    %rbx
ret
mov    %ebx,%eax
pop    %rbx
ret
mov    %ebx,%edi
mov    $0x14,%esi
call   1040 <wait_reply@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fping_monitor(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @ack(i32 %0, i32 20)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @wait_reply(i32 %0, i32 20)
%8 = icmp ne i64 %7, 0
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ %0, %1 ], [ -1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void net_bundle_core_module_inside_tcp_cb(int fd, short event, void *arg) {
  printf("-----------have a request in tcp-------------------\n");
  return;
}


x86 assembly (clang, -O0):
<net_bundle_core_module_inside_tcp_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [53 x i8] c"-----------have a request in tcp-------------------\0A\00"
define void @net_bundle_core_module_inside_tcp_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"-----------have a request in tcp-------------------\00"
define void @net_bundle_core_module_inside_tcp_cb(i32 %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret void
}
int id_cmp(const void *a, const void *b) {
  int *id1 = (int *)a;
  int *id2 = (int *)b;
  if (*id1 > *id2) {
    return (1);
  }
  if (*id1 < *id2) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<id_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    113a <id_cmp+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115f <id_cmp+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <id_cmp+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <id_cmp+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<id_cmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @id_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp slt i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
float mp_load_float(char const **);
int mp_load_u8(char const **);
float mp_decode_float(const char **data) {
  uint8_t c = mp_load_u8(data);
  assert(c == 0xca);
  (void)c;
  return mp_load_float(data);
}


x86 assembly (clang, -O0):
<mp_decode_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <mp_load_u8@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xca,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <mp_load_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_decode_float>:
push   %rbx
mov    %rdi,%rbx
call   1050 <mp_load_u8@plt>
xor    %edi,%edi
cmp    $0xca,%eax
sete   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mp_load_float@plt>

LLVM IR (-O0):
define float @mp_decode_float(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i32 @mp_load_u8(i8** %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 202
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %3
%11 = load i8**, i8*** %2
%12 = call float @mp_load_float(i8** %11)
ret float %12
}

LLVM IR (-O2):
define float @mp_decode_float(i8** %0) {
%2 = tail call i32 @mp_load_u8(i8** %0)
%3 = icmp eq i32 %2, 202
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call float @mp_load_float(i8** %0)
ret float %6
}
void set_output_file(char *fname, unsigned int flength) {}


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

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

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

LLVM IR (-O2):
define void @set_output_file(i8* nocapture %0, i32 %1) {
ret void
}
int main(int argc, char **argv) { struct empty_struct *local_struct; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.empty_struct = type opaque
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void const *instruction_pointer();
const void *FIPS_text_end() { return instruction_pointer(); }


x86 assembly (clang, -O0):
<FIPS_text_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <instruction_pointer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIPS_text_end>:
xor    %eax,%eax
jmp    1030 <instruction_pointer@plt>

LLVM IR (-O0):
define i8* @FIPS_text_end() {
%1 = call i8* (...) @instruction_pointer()
ret i8* %1
}

LLVM IR (-O2):
define i8* @FIPS_text_end() {
%1 = tail call i8* (...) @instruction_pointer()
ret i8* %1
}
__attribute__((vector_size(16))) int f2(__attribute__((vector_size(16))) int t,
                                        int a) {
  ((int *)&t)[2] = a;
  return t;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movdqa %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
movdqa -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movd   %edi,%xmm1
shufps $0x30,%xmm0,%xmm1
shufps $0x84,%xmm1,%xmm0
ret

LLVM IR (-O0):
define <4 x i32> @f2(<4 x i32> %0, i32 %1) {
%3 = alloca <4 x i32>
%4 = alloca i32
store <4 x i32> %0, <4 x i32>* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = bitcast <4 x i32>* %3 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 2
store i32 %5, i32* %7
%8 = load <4 x i32>, <4 x i32>* %3
ret <4 x i32> %8
}

LLVM IR (-O2):
define <4 x i32> @f2(<4 x i32> %0, i32 %1) {
%3 = insertelement <4 x i32> %0, i32 %1, i64 2
ret <4 x i32> %3
}
unsigned int delta(const char a, const char b) { return (a == b ? 0 : 1); }


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edx
movsbl -0x2(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta>:
xor    %eax,%eax
cmp    %sil,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @delta(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @delta(i8 signext %0, i8 signext %1) {
%3 = icmp ne i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int CON_LogSize();
unsigned int CON_LogFree(void) { return 32768 - CON_LogSize() - 1; }


x86 assembly (clang, -O0):
<CON_LogFree>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CON_LogSize@plt>
mov    %eax,%ecx
mov    $0x8000,%eax
sub    %ecx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CON_LogFree>:
push   %rax
xor    %eax,%eax
call   1030 <CON_LogSize@plt>
mov    $0x7fff,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CON_LogFree() {
%1 = call i32 (...) @CON_LogSize()
%2 = sub nsw i32 32768, %1
%3 = sub nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @CON_LogFree() {
%1 = tail call i32 (...) @CON_LogSize()
%2 = sub i32 32767, %1
ret i32 %2
}
/* Type definitions */
struct typ {
  int dummy;
};
struct module {
  int dummy;
};

/* Variables and functions */
struct typ *do_typ_create_tentative(struct module *, struct typ *,
                                    struct typ **, size_t, int);
struct typ *typ_create_tentative(struct module *trigger_mod, struct typ *t,
                                 struct typ **args, size_t arity) {
  struct typ *r = do_typ_create_tentative(trigger_mod, t, args, arity, 1);
  return r;
}


x86 assembly (clang, -O0):
<typ_create_tentative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <do_typ_create_tentative@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<typ_create_tentative>:
mov    $0x1,%r8d
jmp    1030 <do_typ_create_tentative@plt>

LLVM IR (-O0):
%struct.module = type { i32 }
%struct.typ = type { i32 }
define %struct.typ* @typ_create_tentative(%struct.module* %0, %struct.typ* %1, %struct.typ** %2, i64 %3) {
%5 = alloca %struct.module*
%6 = alloca %struct.typ*
%7 = alloca %struct.typ**
%8 = alloca i64
%9 = alloca %struct.typ*
store %struct.module* %0, %struct.module** %5
store %struct.typ* %1, %struct.typ** %6
store %struct.typ** %2, %struct.typ*** %7
store i64 %3, i64* %8
%10 = load %struct.module*, %struct.module** %5
%11 = load %struct.typ*, %struct.typ** %6
%12 = load %struct.typ**, %struct.typ*** %7
%13 = load i64, i64* %8
%14 = call %struct.typ* @do_typ_create_tentative(%struct.module* %10, %struct.typ* %11, %struct.typ** %12, i64 %13, i32 1)
store %struct.typ* %14, %struct.typ** %9
%15 = load %struct.typ*, %struct.typ** %9
ret %struct.typ* %15
}

LLVM IR (-O2):
%struct.module = type { i32 }
%struct.typ = type { i32 }
define %struct.typ* @typ_create_tentative(%struct.module* %0, %struct.typ* %1, %struct.typ** %2, i64 %3) {
%5 = tail call %struct.typ* @do_typ_create_tentative(%struct.module* %0, %struct.typ* %1, %struct.typ** %2, i64 %3, i32 1)
ret %struct.typ* %5
}