xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strpbrk(char *, char *);
char *t16(char *x) { return strpbrk(x, ""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @t16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strpbrk(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @t16(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32dec(int /*<<< orphan*/ const *);
void be32dec_vect(uint32_t *dst, const uint8_t *src, size_t len) {
  size_t i;
  for (i = 0; i < len / 4; i++) {
    dst[i] = be32dec(src + i * 4);
  }
}


x86 assembly (clang, -O0):
<be32dec_vect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x2,%rcx
cmp    %rcx,%rax
jae    1177 <be32dec_vect+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <be32dec@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <be32dec_vect+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32dec_vect>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x4,%rdx
jb     1149 <be32dec_vect+0x39>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
shr    $0x2,%r14
xor    %ebx,%ebx
nopl   (%rax)
mov    %r12,%rdi
call   1030 <be32dec@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
add    $0x10,%r12
cmp    %rbx,%r14
jne    1130 <be32dec_vect+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @be32dec_vect(i32* nocapture writeonly %0, i32* %1, i64 %2) {
%4 = icmp ult i64 %2, 4
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = lshr i64 %2, 2
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %13, %7 ], [ 0, %5 ]
%9 = shl i64 %8, 2
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = tail call i32 @be32dec(i32* %10)
%12 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdout;
void trixCloseOutput(FILE *dst) {
  if (dst != NULL && dst != stdout) {
    fclose(dst);
  }
}


x86 assembly (clang, -O0):
<trixCloseOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <trixCloseOutput+0x34>
mov    -0x8(%rbp),%rax
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%rax
je     1144 <trixCloseOutput+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trixCloseOutput>:
test   %rdi,%rdi
je     1126 <trixCloseOutput+0x16>
mov    0x2ec4(%rip),%rax
cmp    %rdi,(%rax)
je     1126 <trixCloseOutput+0x16>
jmp    1030 <fclose@plt>
ret

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

LLVM IR (-O2):
@stdout = global i32* null
define void @trixCloseOutput(i32* %0) {
%2 = icmp eq i32* %0, null
%3 = load i32*, i32** @stdout
%4 = icmp eq i32* %3, %0
%5 = select i1 %2, i1 true, i1 %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @fclose(i32* %0)
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
char usb_getcharWait(char *, int /*<<< orphan*/);
char usb_getchar(void) {
  char c;
  return usb_getcharWait(&c, 0);
}


x86 assembly (clang, -O0):
<usb_getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
xor    %esi,%esi
call   1030 <usb_getcharWait@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_getchar>:
push   %rax
lea    0x7(%rsp),%rdi
xor    %esi,%esi
call   1030 <usb_getcharWait@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @usb_getchar() {
%1 = alloca i8
%2 = call signext i8 @usb_getcharWait(i8* %1, i32 0)
ret i8 %2
}

LLVM IR (-O2):
define signext i8 @usb_getchar() {
%1 = alloca i8
%2 = call signext i8 @usb_getcharWait(i8* %1, i32 0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void generate_hfile_end(FILE *hfile) { fprintf(hfile, "\n#endif\n"); }


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

x86 assembly (clang, -O2):
<generate_hfile_end>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\0A#endif\0A\00"
define void @generate_hfile_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\0A#endif\0A\00"
define void @generate_hfile_end(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8, i64 1, i32* %0)
ret void
}
/* Type definitions */
struct userrec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cmd_stick_yn(int, char *, int);
void cmd_stick(struct userrec *u, int idx, char *par) {
  cmd_stick_yn(idx, par, 1);
}


x86 assembly (clang, -O0):
<cmd_stick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <cmd_stick_yn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_stick>:
mov    %esi,%edi
mov    %rdx,%rsi
mov    $0x1,%edx
jmp    1030 <cmd_stick_yn@plt>

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

LLVM IR (-O2):
%struct.userrec = type { i32 }
define void @cmd_stick(%struct.userrec* nocapture readnone %0, i32 %1, i8* %2) {
%4 = tail call i32 @cmd_stick_yn(i32 %1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int O_APPEND;
int O_CREAT;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void debug_write(char *str) {
  int fd = open("/tmp/debugdedup", O_WRONLY | O_APPEND | O_CREAT);
  write(fd, str, strlen(str));
  close(fd);
}


x86 assembly (clang, -O0):
<debug_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
mov    0x2e6c(%rip),%rax
or     (%rax),%esi
mov    0x2e93(%rip),%rax
or     (%rax),%esi
lea    0xe92(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_write>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e86(%rip),%rax
mov    0x2e77(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rdi,%rbx
mov    0x2e99(%rip),%rax
or     (%rax),%esi
lea    0xe98(%rip),%rdi
call   1060 <open@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <close@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"/tmp/debugdedup\00"
@O_WRONLY = global i32 0
@O_APPEND = global i32 0
@O_CREAT = global i32 0
define void @debug_write(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_APPEND
%6 = or i32 %4, %5
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i8*, i8** %2
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @write(i32 %10, i8* %11, i32 %13)
%15 = load i32, i32* %3
%16 = call i32 @close(i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"/tmp/debugdedup\00"
@O_WRONLY = global i32 0
@O_APPEND = global i32 0
@O_CREAT = global i32 0
define void @debug_write(i8* %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_APPEND
%4 = or i32 %3, %2
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @strlen(i8* %0)
%9 = tail call i32 @write(i32 %7, i8* %0, i32 %8)
%10 = tail call i32 @close(i32 %7)
ret void
}
int reg_iswordchar(int c) {
  return c == '_' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
         (c >= '0' && c <= '9');
}


x86 assembly (clang, -O0):
<reg_iswordchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x5f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1167 <reg_iswordchar+0x67>
cmpl   $0x61,-0x4(%rbp)
jl     112f <reg_iswordchar+0x2f>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1167 <reg_iswordchar+0x67>
cmpl   $0x41,-0x4(%rbp)
jl     1148 <reg_iswordchar+0x48>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1167 <reg_iswordchar+0x67>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1161 <reg_iswordchar+0x61>
cmpl   $0x39,-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):
<reg_iswordchar>:
cmp    $0x5f,%edi
sete   %al
mov    %edi,%ecx
and    $0xffffffdf,%ecx
add    $0xffffffbf,%ecx
cmp    $0x1a,%ecx
setb   %cl
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @reg_iswordchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 95
br i1 %4, label %25, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 122
br i1 %10, label %25, label %11
11: ; preds = %8, %5
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 90
br i1 %16, label %25, label %17
17: ; preds = %14, %11
%18 = load i32, i32* %2
%19 = icmp sge i32 %18, 48
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp sle i32 %21, 57
br label %23
23: ; preds = %20, %17
%24 = phi i1 [ false, %17 ], [ %22, %20 ]
br label %25
25: ; preds = %23, %14, %8, %1
%26 = phi i1 [ true, %14 ], [ true, %8 ], [ true, %1 ], [ %24, %23 ]
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @reg_iswordchar(i32 %0) {
%2 = icmp eq i32 %0, 95
%3 = and i32 %0, -33
%4 = add i32 %3, -65
%5 = icmp ult i32 %4, 26
%6 = or i1 %2, %5
%7 = add i32 %0, -48
%8 = icmp ult i32 %7, 10
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
void terminate_c_str(char *__attribute__((nonnull)) const iter) {
  *iter = '\0';
}


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

x86 assembly (clang, -O2):
<terminate_c_str>:
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @terminate_c_str(i8* nocapture writeonly %0) {
store i8 0, i8* %0
ret void
}
void g_completion_add_items() {}


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

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

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

LLVM IR (-O2):
define void @g_completion_add_items() {
ret void
}
/* Variables and functions */
int kfork(char *);
int kkfork() { return kfork("/bin/u1"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/u1\00"
define i32 @kkfork() {
%1 = tail call i32 @kfork(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct elf32_hdr {
  scalar_t__ e_machine;
  int e_entry;
};

/* Variables and functions */
scalar_t__ EM_UNICORE;
int elf_check_arch(const struct elf32_hdr *x) {
  if (x->e_machine != EM_UNICORE) {
    return 0;
  }
  if (x->e_entry & 3) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<elf_check_arch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2ed2(%rip),%rcx
cmp    (%rcx),%rax
je     112b <elf_check_arch+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1151 <elf_check_arch+0x51>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     114a <elf_check_arch+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <elf_check_arch+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_check_arch>:
mov    (%rdi),%rcx
mov    0x2ede(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
jne    111a <elf_check_arch+0x1a>
xor    %eax,%eax
testb  $0x3,0x8(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.elf32_hdr = type { i64, i32 }
@EM_UNICORE = global i64 0
define i32 @elf_check_arch(%struct.elf32_hdr* %0) {
%2 = alloca i32
%3 = alloca %struct.elf32_hdr*
store %struct.elf32_hdr* %0, %struct.elf32_hdr** %3
%4 = load %struct.elf32_hdr*, %struct.elf32_hdr** %3
%5 = getelementptr inbounds %struct.elf32_hdr, %struct.elf32_hdr* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @EM_UNICORE
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %18
10: ; preds = %1
%11 = load %struct.elf32_hdr*, %struct.elf32_hdr** %3
%12 = getelementptr inbounds %struct.elf32_hdr, %struct.elf32_hdr* %11, i32 0, i32 1
%13 = load i32, i32* %12
%14 = and i32 %13, 3
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 0, i32* %2
br label %18
17: ; preds = %10
store i32 1, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.elf32_hdr = type { i64, i32 }
@EM_UNICORE = global i64 0
define i32 @elf_check_arch(%struct.elf32_hdr* nocapture %0) {
%2 = getelementptr inbounds %struct.elf32_hdr, %struct.elf32_hdr* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @EM_UNICORE
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.elf32_hdr, %struct.elf32_hdr* %0, i64 0, i32 1
%8 = load i32, i32* %7
%9 = and i32 %8, 3
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
char *decrypted(char *sentence) { return "decryption sample"; }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"decryption sample\00"
define i8* @decrypted(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"decryption sample\00"
define i8* @decrypted(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void org_trifort_sleep(int micro_seconds) { usleep(micro_seconds); }


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

x86 assembly (clang, -O2):
<org_trifort_sleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @org_trifort_sleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int *);
void g(int x, int y, int *z) {
  int y1;
  if (x > 0) {
    f(x - 1, &y1);
    *z = y1 + y;
  } else
    *z = 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114c <g+0x3c>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
lea    -0x14(%rbp),%rsi
call   1030 <f@plt>
mov    -0x14(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1156 <g+0x46>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
test   %edi,%edi
jle    112f <g+0x1f>
mov    %esi,%ebp
add    $0xffffffff,%edi
lea    0x4(%rsp),%rsi
call   1030 <f@plt>
add    0x4(%rsp),%ebp
jmp    1134 <g+0x24>
mov    $0x1,%ebp
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @g(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = add nsw i32 %0, -1
%9 = call i32 @f(i32 %8, i32* %4)
%10 = load i32, i32* %4
%11 = add nsw i32 %10, %1
br label %12
12: ; preds = %3, %7
%13 = phi i32 [ %11, %7 ], [ 1, %3 ]
store i32 %13, i32* %2
ret void
}
/* Variables and functions */
int main_proc(char *);
int show_usage();
int main(int argc, char *argv[]) {
  if (argc != 2) {
    return show_usage();
  }
  return main_proc(argv[1]);
}


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)
cmpl   $0x2,-0x8(%rbp)
je     114f <main+0x2f>
mov    $0x0,%al
call   1040 <show_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <main_proc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    112e <main+0xe>
mov    0x8(%rsi),%rdi
jmp    1030 <main_proc@plt>
xor    %eax,%eax
jmp    1040 <show_usage@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @show_usage()
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @main_proc(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %5, %4 ], [ %9, %6 ]
ret i32 %11
}
int cycle_is_fetch_g(unsigned int flags) {
  return (flags & 0x00000e00) == 0x00000400;
}


x86 assembly (clang, -O0):
<cycle_is_fetch_g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xe00,%eax
cmp    $0x400,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_is_fetch_g>:
and    $0xe00,%edi
xor    %eax,%eax
cmp    $0x400,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @cycle_is_fetch_g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3584
%5 = icmp eq i32 %4, 1024
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @cycle_is_fetch_g(i32 %0) {
%2 = and i32 %0, 3584
%3 = icmp eq i32 %2, 1024
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isxdigit(int c) {
  return (isdigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1175 <isxdigit+0x65>
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1152 <isxdigit+0x42>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1175 <isxdigit+0x65>
xor    %eax,%eax
mov    $0x61,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jg     116f <isxdigit+0x5f>
cmpl   $0x66,-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
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 65, %7
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 70
br i1 %11, label %20, label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = icmp sle i32 97, %13
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 102
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br label %20
20: ; preds = %18, %9, %1
%21 = phi i1 [ true, %9 ], [ true, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
void gtk_accel_map_foreach() {}


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

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

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

LLVM IR (-O2):
define void @gtk_accel_map_foreach() {
ret void
}
/* Variables and functions */
int is_prime(long double);
long int calculate_appropriated_length(long int min_size) {
  long int appropriate_length;
  int result;
  appropriate_length = min_size;
  result = is_prime((long double)appropriate_length);
  while (result == 0) {
    appropriate_length++;
    result = is_prime((long double)appropriate_length);
  }
  return appropriate_length;
}


x86 assembly (clang, -O0):
<calculate_appropriated_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <is_prime@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    116f <calculate_appropriated_length+0x5f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <is_prime@plt>
mov    %eax,-0x14(%rbp)
jmp    113c <calculate_appropriated_length+0x2c>
mov    -0x10(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_appropriated_length>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
mov    %rdi,0x18(%rsp)
fildll 0x18(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
fstpt  (%rsp)
call   1030 <is_prime@plt>
test   %eax,%eax
jne    114b <calculate_appropriated_length+0x3b>
add    $0x1,%rbx
mov    %rbx,0x10(%rsp)
fildll 0x10(%rsp)
jmp    1130 <calculate_appropriated_length+0x20>
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @calculate_appropriated_length(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %2
%5 = load i64, i64* %2
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to x86_fp80
%8 = call i32 @is_prime(x86_fp80 %7)
store i32 %8, i32* %4
br label %9
9: ; preds = %12, %1
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = sitofp i64 %15 to x86_fp80
%17 = call i32 @is_prime(x86_fp80 %16)
store i32 %17, i32* %4
br label %9
18: ; preds = %9
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @calculate_appropriated_length(i64 %0) {
%2 = sitofp i64 %0 to x86_fp80
%3 = tail call i32 @is_prime(x86_fp80 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1, %5
%6 = phi i64 [ %7, %5 ], [ %0, %1 ]
%7 = add nsw i64 %6, 1
%8 = sitofp i64 %7 to x86_fp80
%9 = tail call i32 @is_prime(x86_fp80 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %1
%12 = phi i64 [ %0, %1 ], [ %7, %5 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
__attribute__((always_)) void tx_abort(void) {
  printf("%s\n", "abort transaction");
}


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

x86 assembly (clang, -O2):
<tx_abort>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [18 x i8] c"abort transaction\00"
define void @tx_abort() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [18 x i8] c"abort transaction\00"
define void @tx_abort() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int A_BOLD;
int COLOR_PAIR(int);
int /*<<< orphan*/ attron(int);
void attribute_on_c(int option) { attron(COLOR_PAIR(option) | A_BOLD); }


x86 assembly (clang, -O0):
<attribute_on_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <attron@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attribute_on_c>:
push   %rax
call   1040 <COLOR_PAIR@plt>
mov    0x2eb3(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <attron@plt>

LLVM IR (-O0):
@A_BOLD = global i32 0
define void @attribute_on_c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @COLOR_PAIR(i32 %3)
%5 = load i32, i32* @A_BOLD
%6 = or i32 %4, %5
%7 = call i32 @attron(i32 %6)
ret void
}

LLVM IR (-O2):
@A_BOLD = global i32 0
define void @attribute_on_c(i32 %0) {
%2 = tail call i32 @COLOR_PAIR(i32 %0)
%3 = load i32, i32* @A_BOLD
%4 = or i32 %3, %2
%5 = tail call i32 @attron(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "9read [-dU] [-p port] [-u user] addr path\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"9read [-dU] [-p port] [-u user] addr path\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"9read [-dU] [-p port] [-u user] addr path\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int main() {
  char *test = "select \"foo\" from test;";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"select \22foo\22 from test;\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void draw_finish(FILE *fp) { fprintf(fp, "showpage\n"); }


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

x86 assembly (clang, -O2):
<draw_finish>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"showpage\0A\00"
define void @draw_finish(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"showpage\0A\00"
define void @draw_finish(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 9, i64 1, i32* %0)
ret void
}
char *_Locale_collate_name(const void *__DUMMY_PAR1, char *__DUMMY_PAR) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @_Locale_collate_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ set(int);
void *another() {
  int i;
  for (i = 50; i < 100; i++) {
    set(i);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<another>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x32,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    113f <another+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <set@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <another+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<another>:
push   %rbx
mov    $0x32,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <set@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1120 <another+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @another() {
%1 = alloca i32
store i32 50, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @set(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @another() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 50, %0 ], [ %4, %1 ]
%3 = tail call i32 @set(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ stack_testing_suite();
void main() { stack_testing_suite(); }


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @stack_testing_suite()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @stack_testing_suite()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ pfpanic(char *, unsigned short, unsigned short, char const *,
                           char const *, int, int, int /*<<< orphan*/);
void __pfpanic_pthread_join(unsigned short _syslog, unsigned short _verbose,
                            const char *_function_name, const char *_file_name,
                            int _line_number, int _errno) {
  pfpanic("Unable to join thread", _syslog, _verbose, _function_name,
          _file_name, _line_number, _errno, EX_OSERR);
}


x86 assembly (clang, -O0):
<__pfpanic_pthread_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%r10d
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
lea    0xea2(%rip),%rdi
movzwl %si,%esi
movzwl %dx,%edx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <pfpanic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfpanic_pthread_join>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb8(%rip),%rdi
mov    (%rdi),%eax
lea    0xecf(%rip),%rdi
push   %rax
push   %r10
call   1030 <pfpanic@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Unable to join thread\00"
@EX_OSERR = global i32 0
define void @__pfpanic_pthread_join(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i16 %0, i16* %7
store i16 %1, i16* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = load i32, i32* @EX_OSERR
%20 = call i32 @pfpanic(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i16 zeroext %13, i16 zeroext %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Unable to join thread\00"
@EX_OSERR = global i32 0
define void @__pfpanic_pthread_join(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = load i32, i32* @EX_OSERR
%8 = tail call i32 @pfpanic(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %7)
ret void
}
int cmp_uint_asc(const void *x, const void *y) {
  if (*(unsigned int *)x < *(unsigned int *)y) {
    return -1;
  } else if (*(unsigned int *)x > *(unsigned int *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_uint_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jae    112a <cmp_uint_asc+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <cmp_uint_asc+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jbe    1148 <cmp_uint_asc+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1154 <cmp_uint_asc+0x54>
jmp    114d <cmp_uint_asc+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_uint_asc>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_uint_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ult i32 %4, %6
%8 = icmp ugt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void and_m32_imm32(void *_m32, unsigned long imm32) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0x81);
  put8(0x25);
  put32((unsigned long)(m32));
  put32(imm32);
}


x86 assembly (clang, -O0):
<and_m32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x81,%edi
call   1030 <put8@plt>
mov    $0x25,%edi
call   1030 <put8@plt>
mov    -0x18(%rbp),%rdi
call   1040 <put32@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_m32_imm32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x81,%edi
call   1030 <put8@plt>
mov    $0x25,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
call   1040 <put32@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @and_m32_imm32(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = call i32 @put8(i32 129)
%9 = call i32 @put8(i32 37)
%10 = load i64*, i64** %5
%11 = ptrtoint i64* %10 to i64
%12 = call i32 @put32(i64 %11)
%13 = load i64, i64* %4
%14 = call i32 @put32(i64 %13)
ret void
}

LLVM IR (-O2):
define void @and_m32_imm32(i8* %0, i64 %1) {
%3 = tail call i32 @put8(i32 129)
%4 = tail call i32 @put8(i32 37)
%5 = ptrtoint i8* %0 to i64
%6 = tail call i32 @put32(i64 %5)
%7 = tail call i32 @put32(i64 %1)
ret void
}
void foo() {
  register int zmm_var asm("zmm6") __attribute__((unused));
  __asm__ __volatile__("vxorpd %%zmm0, %%zmm0, %%zmm7\n" : : : "zmm7");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
vxorpd %zmm0,%zmm0,%zmm7
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
vxorpd %zmm0,%zmm0,%zmm7
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @foo() {
tail call void asm sideeffect "vxorpd %zmm0, %zmm0, %zmm7\0A", "~{zmm7},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct macan_ctx {
  int dummy;
};
struct can_frame {
  int dummy;
};

/* Variables and functions */
bool macan_send(struct macan_ctx *ctx, const struct can_frame *cf) {
  (void)ctx, (void)cf;
  return true;
}


x86 assembly (clang, -O0):
<macan_send>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.macan_ctx = type { i32 }
%struct.can_frame = type { i32 }
define i32 @macan_send(%struct.macan_ctx* %0, %struct.can_frame* %1) {
%3 = alloca %struct.macan_ctx*
%4 = alloca %struct.can_frame*
store %struct.macan_ctx* %0, %struct.macan_ctx** %3
store %struct.can_frame* %1, %struct.can_frame** %4
%5 = load %struct.macan_ctx*, %struct.macan_ctx** %3
%6 = load %struct.can_frame*, %struct.can_frame** %4
ret i32 1
}

LLVM IR (-O2):
%struct.macan_ctx = type { i32 }
%struct.can_frame = type { i32 }
define i32 @macan_send(%struct.macan_ctx* nocapture readnone %0, %struct.can_frame* nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
struct pdeq {
  int dummy;
};
struct cds_list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
struct cds_list_head *pdeq_pop_error(struct pdeq *d) {
  printf("pdeq_pop_error()\n");
  abort();
}


x86 assembly (clang, -O0):
<pdeq_pop_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
%struct.cds_list_head = type { i32 }
%struct.pdeq = type { i32 }
@.str = [18 x i8] c"pdeq_pop_error()\0A\00"
define %struct.cds_list_head* @pdeq_pop_error(%struct.pdeq* %0) {
%2 = alloca %struct.pdeq*
store %struct.pdeq* %0, %struct.pdeq** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.cds_list_head = type { i32 }
%struct.pdeq = type { i32 }
@str = [17 x i8] c"pdeq_pop_error()\00"
define noalias %struct.cds_list_head* @pdeq_pop_error(%struct.pdeq* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeFileNames(char *workingDirectory, char *inputFileName,
                   char *outputFileName) {
  if (workingDirectory != NULL)
    free(workingDirectory);
  if (inputFileName != NULL)
    free(inputFileName);
  if (outputFileName != NULL)
    free(outputFileName);
}


x86 assembly (clang, -O0):
<freeFileNames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <freeFileNames+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x10(%rbp)
je     114c <freeFileNames+0x3c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x18(%rbp)
je     1160 <freeFileNames+0x50>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeFileNames>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
test   %rdi,%rdi
je     1124 <freeFileNames+0x14>
call   1030 <free@plt>
test   %rbx,%rbx
je     1131 <freeFileNames+0x21>
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r14,%r14
je     1145 <freeFileNames+0x35>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @freeFileNames(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 i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %9, %3
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %5
%17 = call i32 @free(i8* %16)
br label %18
18: ; preds = %15, %12
%19 = load i8*, i8** %6
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i8*, i8** %6
%23 = call i32 @free(i8* %22)
br label %24
24: ; preds = %21, %18
ret void
}

LLVM IR (-O2):
define void @freeFileNames(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @free(i8* %1)
br label %11
11: ; preds = %9, %7
%12 = icmp eq i8* %2, null
br i1 %12, label %15, label %13
13: ; preds = %11
%14 = tail call i32 @free(i8* %2)
br label %15
15: ; preds = %13, %11
ret void
}