xunge/DecIR huggingface dataset:
char *sstrcpy(char *dest, char *src) {
  while ((*dest++ = *src++) != 0)
    ;
  return src;
}


x86 assembly (clang, -O0):
<sstrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <sstrcpy+0x3f>
jmp    110c <sstrcpy+0xc>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstrcpy>:
mov    %rsi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
mov    %cl,(%rdi)
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sstrcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @sstrcpy(i8* nocapture writeonly %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %6
}
/* Variables and functions */
char *strdup(char const *);
size_t strlen(char *);
char *strstrip2(const char *input_str) {
  char *str = strdup(input_str);
  size_t len = strlen(str);
  if (len == 0) {
    return str;
  }
  if (str[len - 1] == '"') {
    str[len - 1] = '\0';
  }
  return str;
}


x86 assembly (clang, -O0):
<strstrip2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115e <strstrip2+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118f <strstrip2+0x6f>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    1187 <strstrip2+0x67>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstrip2>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
je     1142 <strstrip2+0x22>
cmpb   $0x22,-0x1(%rax,%rbx,1)
jne    1142 <strstrip2+0x22>
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @strstrip2(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = add i64 %3, -1
%7 = getelementptr inbounds i8, i8* %2, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 34
br i1 %9, label %10, label %11
10: ; preds = %5
store i8 0, i8* %7
br label %11
11: ; preds = %5, %10, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputc(int, int /*<<< orphan*/ *);
int putc(int i, FILE *stream) { return fputc(i, stream); }


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

x86 assembly (clang, -O2):
<putc>:
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define i32 @putc(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @fputc(i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cursorhide(void) { printf("\033[?25l"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25l\00"
define void @cursorhide() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25l\00"
define void @cursorhide() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int f_2x(void) { return 2; }


x86 assembly (clang, -O0):
<f_2x>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f_2x() {
ret i32 2
}

LLVM IR (-O2):
define i32 @f_2x() {
ret i32 2
}
void vde_chain_nm5_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @vde_chain_nm5_incref() {
ret void
}
void gdk_x11_display_get_xdisplay() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_display_get_xdisplay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void flush(int *unit) {
  switch (*unit) {
  case 0:
  case 6:
    fflush(stderr);
    fflush(stdout);
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1143 <flush+0x33>
jmp    1132 <flush+0x22>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
jne    115f <flush+0x4f>
jmp    1143 <flush+0x33>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
jmp    1164 <flush+0x54>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rax
mov    (%rdi),%eax
cmp    $0x6,%eax
je     111c <flush+0xc>
test   %eax,%eax
jne    1139 <flush+0x29>
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <fflush@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
define void @flush(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 0, label %5
i32 6, label %5
]
5: ; preds = %1, %1
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
br label %10
10: ; preds = %1, %5
br label %11
11: ; preds = %10
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
define void @flush(i32* nocapture %0) {
%2 = load i32, i32* %0
switch i32 %2, label %8 [
i32 0, label %3
i32 6, label %3
]
3: ; preds = %1, %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
br label %8
8: ; preds = %3, %1
ret void
}
void dbg_dump_node(const struct ubifs_info *c, const void *node) { return; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define void @dbg_dump_node(%struct.ubifs_info* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int opt_doublemode(char *opt) {
  if (strcmp(opt, "-d") == 0)
    return 1;
  if (strcmp(opt, "--double") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opt_doublemode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <opt_doublemode+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_doublemode+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <opt_doublemode+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_doublemode+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_doublemode>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <opt_doublemode+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-d\00"
@.str.1 = [9 x i8] c"--double\00"
define i32 @opt_doublemode(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"-d\00"
@.str.1 = [9 x i8] c"--double\00"
define i32 @opt_doublemode(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solve_by_dobldobl_homotopy_continuation(int number_of_tasks) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(236, &number_of_tasks, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_by_dobldobl_homotopy_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xec,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_by_dobldobl_homotopy_continuation>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xec,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solve_by_dobldobl_homotopy_continuation(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 236, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @solve_by_dobldobl_homotopy_continuation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 236, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
int test_imm_1Buint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x1B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Buint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x1b,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Buint64_lowword_mem>:
testb  $0x1b,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Buint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 27
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int Compare(const void *a_p, const void *b_p) {
  int a = *((int *)a_p);
  int b = *((int *)b_p);
  if (a < b)
    return -1;
  else if (a == b)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<Compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <Compare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <Compare+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <Compare+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <Compare+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Compare(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*
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 0, i32* %3
br label %24
23: ; preds = %18
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @Compare(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 slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
TAG_CALLBACK(spp_trace) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @TAG_CALLBACK(i32 %0) {
ret i32 0
}
char *test_myAdd_large(const char **_ja_name) {
  do {
    *_ja_name = __func__;
    if (!(myAdd(1000, 1000) == 2000))
      return "1000 + 1000 == 2000";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_myAdd_large>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
mov    %rcx,(%rax)
mov    $0x3e8,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <myAdd@plt>
cmp    $0x7d0,%eax
je     1153 <test_myAdd_large+0x43>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <test_myAdd_large+0x50>
jmp    1158 <test_myAdd_large+0x48>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_myAdd_large>:
push   %rbx
lea    0xee8(%rip),%rax
mov    %rax,(%rdi)
xor    %ebx,%ebx
mov    $0x3e8,%edi
mov    $0x3e8,%esi
xor    %eax,%eax
call   1030 <myAdd@plt>
cmp    $0x7d0,%eax
lea    0xed7(%rip),%rax
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@__func__.test_myAdd_large = [17 x i8] c"test_myAdd_large\00"
@.str = [20 x i8] c"1000 + 1000 == 2000\00"
define i8* @test_myAdd_large(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8** %0, i8*** %3
br label %4
4: ; preds = %1
%5 = load i8**, i8*** %3
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.test_myAdd_large, i64 0, i64 0), i8** %5
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @myAdd to i32 (i32, i32, ...)*)(i32 1000, i32 1000)
%7 = icmp eq i32 %6, 2000
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %2
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@__func__.test_myAdd_large = [17 x i8] c"test_myAdd_large\00"
@.str = [20 x i8] c"1000 + 1000 == 2000\00"
define i8* @test_myAdd_large(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.test_myAdd_large, i64 0, i64 0), i8** %0
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @myAdd to i32 (i32, i32, ...)*)(i32 1000, i32 1000)
%3 = icmp eq i32 %2, 2000
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
ret i8* %4
}
/* Type definitions */
struct bytecode_jit_core {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ record_unwind_current_buffer();
__attribute__((fastcall)) void
bytecode_jit_save_current_buffer(struct bytecode_jit_core *core) {
  record_unwind_current_buffer();
}


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

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

LLVM IR (-O0):
%struct.bytecode_jit_core = type { i32 }
define void @bytecode_jit_save_current_buffer(%struct.bytecode_jit_core* %0) {
%2 = alloca %struct.bytecode_jit_core*
store %struct.bytecode_jit_core* %0, %struct.bytecode_jit_core** %2
%3 = call i32 (...) @record_unwind_current_buffer()
ret void
}

LLVM IR (-O2):
%struct.bytecode_jit_core = type { i32 }
define void @bytecode_jit_save_current_buffer(%struct.bytecode_jit_core* nocapture readnone %0) {
%2 = tail call i32 (...) @record_unwind_current_buffer()
ret void
}
/* Variables and functions */
int floor(double);
signed int lfloor(double x) { return floor(x); }


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

x86 assembly (clang, -O2):
<lfloor>:
jmp    1030 <floor@plt>

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

LLVM IR (-O2):
define i32 @lfloor(double %0) {
%2 = tail call i32 @floor(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mdaq_rpc_init();
int mdaq_file_init(void) {
  mdaq_rpc_init();
  return 0;
}


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

x86 assembly (clang, -O2):
<mdaq_file_init>:
push   %rax
xor    %eax,%eax
call   1030 <mdaq_rpc_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mdaq_file_init() {
%1 = call i32 (...) @mdaq_rpc_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @mdaq_file_init() {
%1 = tail call i32 (...) @mdaq_rpc_init()
ret i32 0
}
/* Variables and functions */
int rpartition(int *, int, int);
void quickSort(int arr[], int start, int end) {
  if (start < end) {
    int pIndex = rpartition(arr, start, end);
    quickSort(arr, start, pIndex - 1);
    quickSort(arr, pIndex + 1, end);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <rpartition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <rpartition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @rpartition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ base_test();
int /*<<< orphan*/ greth_test(int);
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
int /*<<< orphan*/ spictrl_test(int, int);
main() {
  report_start();
  base_test();
  spictrl_test(0x80000400, 1);
  spictrl_test(0x80000500, 2);
  greth_test(0x80000600);
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <report_start@plt>
mov    $0x0,%al
call   1060 <base_test@plt>
mov    $0x80000400,%edi
mov    $0x1,%esi
call   1030 <spictrl_test@plt>
mov    $0x80000500,%edi
mov    $0x2,%esi
call   1030 <spictrl_test@plt>
mov    $0x80000600,%edi
call   1050 <greth_test@plt>
mov    $0x0,%al
call   1040 <report_end@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <report_start@plt>
xor    %eax,%eax
call   1060 <base_test@plt>
mov    $0x80000400,%edi
mov    $0x1,%esi
call   1030 <spictrl_test@plt>
mov    $0x80000500,%edi
mov    $0x2,%esi
call   1030 <spictrl_test@plt>
mov    $0x80000600,%edi
call   1050 <greth_test@plt>
xor    %eax,%eax
call   1040 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @report_start()
%2 = call i32 (...) @base_test()
%3 = call i32 @spictrl_test(i32 -2147482624, i32 1)
%4 = call i32 @spictrl_test(i32 -2147482368, i32 2)
%5 = call i32 @greth_test(i32 -2147482112)
%6 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @base_test()
%3 = tail call i32 @spictrl_test(i32 -2147482624, i32 1)
%4 = tail call i32 @spictrl_test(i32 -2147482368, i32 2)
%5 = tail call i32 @greth_test(i32 -2147482112)
%6 = tail call i32 (...) @report_end()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_key_t;

/* Variables and functions */
void *pthread_getspecific(pthread_key_t key) { return (NULL); }


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

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

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

LLVM IR (-O2):
define noalias i8* @pthread_getspecific(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ removeNewline(char *, int);
int /*<<< orphan*/ stdin;
void *getString(char *string) {
  fgets(string, 62, stdin);
  removeNewline(string, 62);
  fflush(stdin);
}


x86 assembly (clang, -O0):
<getString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    $0x3e,%esi
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3e,%esi
call   1030 <removeNewline@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getString>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eaa(%rip),%r14
mov    (%r14),%edx
mov    $0x3e,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    $0x3e,%esi
call   1030 <removeNewline@plt>
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i8* @getString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 62, i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @removeNewline(i8* %7, i32 62)
%9 = load i32, i32* @stdin
%10 = call i32 @fflush(i32 %9)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@stdin = global i32 0
define noalias i8* @getString(i8* %0) {
%2 = load i32, i32* @stdin
%3 = tail call i32 @fgets(i8* %0, i32 62, i32 %2)
%4 = tail call i32 @removeNewline(i8* %0, i32 62)
%5 = load i32, i32* @stdin
%6 = tail call i32 @fflush(i32 %5)
ret i8* undef
}
/* Variables and functions */
void stub1(double, float);
void testClosureDFrV(void (*closure)(double, float), double a1, float a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureDFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1131 <testClosureDFrV+0x31>
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureDFrV>:
test   %rdi,%rdi
je     1107 <testClosureDFrV+0x7>
jmp    *%rdi
ret

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

LLVM IR (-O2):
define void @testClosureDFrV(void (double, float)* %0, double %1, float %2) {
%4 = icmp eq void (double, float)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(double %1, float %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ both_logs(char *, int);
int determine_proc_usage(const char *proc_arg) {
  int rc = proc_arg[0] - '0';
  both_logs("Proc: %d\n", rc);
  return rc;
}


x86 assembly (clang, -O0):
<determine_proc_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <both_logs@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determine_proc_usage>:
push   %rbx
movsbl (%rdi),%ebx
add    $0xffffffd0,%ebx
lea    0xee2(%rip),%rdi
mov    %ebx,%esi
call   1030 <both_logs@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Proc: %d\0A\00"
define i32 @determine_proc_usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 48
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @both_logs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [10 x i8] c"Proc: %d\0A\00"
define i32 @determine_proc_usage(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -48
%5 = tail call i32 @both_logs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 %4
}
/* Variables and functions */
scalar_t__ strlen(char *);
int IsDDot(char *lps) {
  int flg = 0;
  int i = (int)strlen(lps);
  if (i) {
    if ((i == 2) && (lps[0] == '.') && (lps[1] == '.')) {
      flg = 1;
    }
  }
  return flg;
}


x86 assembly (clang, -O0):
<IsDDot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1170 <IsDDot+0x60>
cmpl   $0x2,-0x10(%rbp)
jne    116b <IsDDot+0x5b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    116b <IsDDot+0x5b>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    116b <IsDDot+0x5b>
movl   $0x1,-0xc(%rbp)
jmp    1170 <IsDDot+0x60>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDDot>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x2,%ecx
jne    1131 <IsDDot+0x21>
cmpb   $0x2e,(%rbx)
jne    1131 <IsDDot+0x21>
xor    %eax,%eax
cmpb   $0x2e,0x1(%rbx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @IsDDot(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 46
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 46
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %5, %1
%14 = phi i32 [ 0, %5 ], [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
cbuf28(f, n) int f, n;
{ cbuf(f, n, 28); }


x86 assembly (clang, -O0):
<cbuf28>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x1c,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf28>:
mov    $0x1c,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf28(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 28)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf28(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 28)
ret i32 undef
}
void security_ip_encapsulate(struct sk_buff *skb) {}


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

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

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

LLVM IR (-O2):
%struct.sk_buff = type opaque
define void @security_ip_encapsulate(%struct.sk_buff* nocapture %0) {
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_error_copy(void *dest,
                                                             const void *e) {
  return -EINVAL;
}


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

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_error_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_error_copy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int /*<<< orphan*/);
int /*<<< orphan*/ IntRegister(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ _QEIIntNumberGet(int /*<<< orphan*/);
void QEIIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)) {
  uint32_t ui32Int;
  ;
  ui32Int = _QEIIntNumberGet(ui32Base);
  ;
  IntRegister(ui32Int, pfnHandler);
  IntEnable(ui32Int);
}


x86 assembly (clang, -O0):
<QEIIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_QEIIntNumberGet@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <IntRegister@plt>
mov    -0x14(%rbp),%edi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntRegister>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <_QEIIntNumberGet@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <IntRegister@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @QEIIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
%5 = alloca i32
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%6 = load i32, i32* %3
%7 = call i32 @_QEIIntNumberGet(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load void ()*, void ()** %4
%10 = bitcast void ()* %9 to void (...)*
%11 = call i32 @IntRegister(i32 %8, void (...)* %10)
%12 = load i32, i32* %5
%13 = call i32 @IntEnable(i32 %12)
ret void
}

LLVM IR (-O2):
define void @QEIIntRegister(i32 %0, void ()* %1) {
%3 = tail call i32 @_QEIIntNumberGet(i32 %0)
%4 = bitcast void ()* %1 to void (...)*
%5 = tail call i32 @IntRegister(i32 %3, void (...)* %4)
%6 = tail call i32 @IntEnable(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ vals(int **);
int main(void) {
  int *stuff;
  vals(&stuff);
  stuff[0] = 42;
  f(5);
  assert(42 == stuff[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <vals@plt>
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
mov    $0x5,%edi
call   1040 <f@plt>
mov    -0x10(%rbp),%rcx
mov    $0x2a,%eax
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <vals@plt>
mov    (%rsp),%rax
movl   $0x2a,(%rax)
mov    $0x5,%edi
call   1040 <f@plt>
mov    (%rsp),%rax
xor    %edi,%edi
cmpl   $0x2a,(%rax)
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32 @vals(i32** %2)
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 42, i32* %5
%6 = call i32 @f(i32 5)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = icmp eq i32 42, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @vals(i32** %1)
%4 = load i32*, i32** %1
store i32 42, i32* %4
%5 = call i32 @f(i32 5)
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 42
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}
void match_field() {
  int i, j;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 1000000; j++) {
      ;
    }
  }
}


x86 assembly (clang, -O0):
<match_field>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    114f <match_field+0x4f>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    113c <match_field+0x3c>
jmp    112e <match_field+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <match_field+0x1c>
jmp    1141 <match_field+0x41>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <match_field+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @match_field() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char int_to_char(int n) {
  assert(n >= 0 && n <= 9);
  return (n + 48);
}


x86 assembly (clang, -O0):
<int_to_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1134 <int_to_char+0x24>
cmpl   $0x9,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_char>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0xa,%ebx
setb   %dil
call   1030 <assert@plt>
add    $0x30,%bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @int_to_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 48
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @int_to_char(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = trunc i32 %0 to i8
%6 = add i8 %5, 48
ret i8 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
char *GetMemory(char **p, int num) { *p = (char *)malloc(num); }


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

x86 assembly (clang, -O2):
<GetMemory>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @GetMemory(i8** %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = load i8**, i8*** %4
store i8* %8, i8** %9
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @GetMemory(i8** nocapture writeonly %0, i32 %1) {
%3 = tail call i64 @malloc(i32 %1)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %0
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_rdctl(int);
uint32_t _Nios2_Get_ctlreg_bstatus(void) {
  return (uint32_t)__builtin_rdctl(2);
}


x86 assembly (clang, -O0):
<_Nios2_Get_ctlreg_bstatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <__builtin_rdctl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Nios2_Get_ctlreg_bstatus>:
mov    $0x2,%edi
jmp    1030 <__builtin_rdctl@plt>

LLVM IR (-O0):
define i32 @_Nios2_Get_ctlreg_bstatus() {
%1 = call i32 @__builtin_rdctl(i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @_Nios2_Get_ctlreg_bstatus() {
%1 = tail call i32 @__builtin_rdctl(i32 2)
ret i32 %1
}
int check_if_gpio_legal(int n) { return n >= 2 && n <= 27; }


x86 assembly (clang, -O0):
<check_if_gpio_legal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <check_if_gpio_legal+0x20>
cmpl   $0x1b,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_gpio_legal>:
add    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @check_if_gpio_legal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 27
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @check_if_gpio_legal(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void exiterror(const char *a, const char *b) {
  fprintf(stderr, "%s%s\n", a, b);
  exit(-1);
}


x86 assembly (clang, -O0):
<exiterror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exiterror>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s%s\0A\00"
define void @exiterror(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
void clock_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @clock_reset() {
ret void
}