xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ expm1l(long double);
int /*<<< orphan*/ link_failure_expm1l();
void test_expm1l(long double ld) {
  if (expm1l(ld) != expm1l(ld))
    link_failure_expm1l();
}


x86 assembly (clang, -O0):
<test_expm1l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <expm1l@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <expm1l@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_expm1l+0x43>
mov    $0x0,%al
call   1030 <link_failure_expm1l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_expm1l>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <expm1l@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <expm1l@plt>
cmp    %rax,%rbx
jne    1151 <test_expm1l+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_expm1l@plt>

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

LLVM IR (-O2):
define void @test_expm1l(x86_fp80 %0) {
%2 = tail call i64 @expm1l(x86_fp80 %0)
%3 = tail call i64 @expm1l(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_expm1l()
br label %7
7: ; preds = %5, %1
ret void
}
int f2(unsigned x) {
  switch (x) {
  default:
    return 3;
  case 0xFFFFFFFF ... 1:
    return 0;
  }
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %5 [
]
5: ; preds = %1
store i32 3, i32* %2
br label %7
6: ; No predecessors!
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
void authnone_verf(AUTH *auth) {}


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

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

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

LLVM IR (-O2):
define void @authnone_verf(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int StatMomentFloat(float *, int, int, int);
double StatVarFloat(float a[], int n, int s) {
  return StatMomentFloat(a, n, s, 2) / (n - 1);
}


x86 assembly (clang, -O0):
<StatVarFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x2,%ecx
call   1030 <StatMomentFloat@plt>
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatVarFloat>:
push   %rbx
mov    %esi,%ebx
mov    $0x2,%ecx
call   1030 <StatMomentFloat@plt>
add    $0xffffffff,%ebx
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StatVarFloat(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @StatMomentFloat(float* %7, i32 %8, i32 %9, i32 2)
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = sdiv i32 %10, %12
%14 = sitofp i32 %13 to double
ret double %14
}

LLVM IR (-O2):
define double @StatVarFloat(float* %0, i32 %1, i32 %2) {
%4 = tail call i32 @StatMomentFloat(float* %0, i32 %1, i32 %2, i32 2)
%5 = add nsw i32 %1, -1
%6 = sdiv i32 %4, %5
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
unsigned int instruction_size(unsigned int insn) {
  switch ((insn & 0xf00f)) {
  case 0x0000:
  case 0x0001:
  case 0x3001:
    return 4;
  }
  switch ((insn & 0xf08f)) {
  case 0x3009:
    return 4;
  }
  return 2;
}


x86 assembly (clang, -O0):
<instruction_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf00f,%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
jb     1133 <instruction_size+0x33>
jmp    1120 <instruction_size+0x20>
mov    -0xc(%rbp),%eax
sub    $0x3001,%eax
jne    113f <instruction_size+0x3f>
jmp    1133 <instruction_size+0x33>
movl   $0x4,-0x4(%rbp)
jmp    116a <instruction_size+0x6a>
mov    -0x8(%rbp),%eax
and    $0xf08f,%eax
sub    $0x3009,%eax
jne    1163 <instruction_size+0x63>
jmp    1157 <instruction_size+0x57>
movl   $0x4,-0x4(%rbp)
jmp    116a <instruction_size+0x6a>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instruction_size>:
mov    %edi,%ecx
and    $0xf00f,%ecx
mov    $0x4,%eax
cmp    $0x2,%cx
jb     1134 <instruction_size+0x34>
movzwl %cx,%ecx
cmp    $0x3001,%ecx
je     1134 <instruction_size+0x34>
and    $0xf08f,%edi
xor    %eax,%eax
cmp    $0x3009,%edi
sete   %al
add    %eax,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @instruction_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 61455
switch i32 %5, label %7 [
i32 0, label %6
i32 1, label %6
i32 12289, label %6
]
6: ; preds = %1, %1, %1
store i32 4, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, 61583
switch i32 %9, label %11 [
i32 12297, label %10
]
10: ; preds = %7
store i32 4, i32* %2
br label %12
11: ; preds = %7
store i32 2, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @instruction_size(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = and i16 %2, -4081
switch i16 %3, label %4 [
i16 0, label %8
i16 1, label %8
i16 12289, label %8
]
4: ; preds = %1
%5 = and i32 %0, 61583
%6 = icmp eq i32 %5, 12297
%7 = select i1 %6, i32 4, i32 2
br label %8
8: ; preds = %4, %1, %1, %1
%9 = phi i32 [ 4, %1 ], [ 4, %1 ], [ 4, %1 ], [ %7, %4 ]
ret i32 %9
}
char dec_to_hex(int dec) {
  if (dec < 10)
    return 48 + dec;
  else
    return 55 + dec;
}


x86 assembly (clang, -O0):
<dec_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <dec_to_hex+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1128 <dec_to_hex+0x28>
mov    -0x8(%rbp),%eax
add    $0x37,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_to_hex>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @dec_to_hex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add nsw i32 55, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %10, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @dec_to_hex(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
int notnum(string)
char *string;
{
  if (isnum(string))
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<notnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <isnum@plt>
cmp    $0x0,%eax
je     113c <notnum+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1143 <notnum+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notnum>:
push   %rax
xor    %eax,%eax
call   1030 <isnum@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @notnum(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @isnum to i32 (i8*, ...)*)(i8* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @notnum(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @isnum to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "./eaa X Y [-v]\n\twhere X,Y are both integers\n\t-v  be more verbose\n");
}


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

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

LLVM IR (-O0):
@.str = [66 x i8] c"./eaa X Y [-v]\0A\09where X,Y are both integers\0A\09-v be more verbose\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [65 x i8] c"./eaa X Y [-v]\0A\09where X,Y are both integers\0A\09-v be more verbose\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
ret void
}
int main(int n) { scanf("%d", &n), f(n), printf("\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
xor    %eax,%eax
call   1040 <f@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 %4)
%6 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Error(char *);
void Usage() {
  Error("USAGE: screwup  [-o <funcs> <func_desc>] <file1> [<file2> ..]\n"
        "no -o defaults to g_funcs.h g_func_decs.h\n");
}


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

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

LLVM IR (-O0):
@.str = [105 x i8] c"USAGE: screwup [-o <funcs> <func_desc>] <file1> [<file2> ..]\0Ano -o defaults to g_funcs.h g_func_decs.h\0A\00"
define void @Usage() {
%1 = call i32 @Error(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [105 x i8] c"USAGE: screwup [-o <funcs> <func_desc>] <file1> [<file2> ..]\0Ano -o defaults to g_funcs.h g_func_decs.h\0A\00"
define void @Usage() {
%1 = tail call i32 @Error(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
ret void
}
int x8_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x8_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct view_menu {
  int dummy;
};
struct view {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct view_menu *);
void view_menu_free(struct view *v) { free((struct view_menu *)v); }


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

x86 assembly (clang, -O2):
<view_menu_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.view = type { i32 }
%struct.view_menu = type { i32 }
define void @view_menu_free(%struct.view* %0) {
%2 = alloca %struct.view*
store %struct.view* %0, %struct.view** %2
%3 = load %struct.view*, %struct.view** %2
%4 = bitcast %struct.view* %3 to %struct.view_menu*
%5 = call i32 @free(%struct.view_menu* %4)
ret void
}

LLVM IR (-O2):
%struct.view = type { i32 }
%struct.view_menu = type { i32 }
define void @view_menu_free(%struct.view* nocapture %0) {
%2 = bitcast %struct.view* %0 to %struct.view_menu*
%3 = tail call i32 @free(%struct.view_menu* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_up_tables();
void init_tables(void) { set_up_tables(); }


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

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

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

LLVM IR (-O2):
define void @init_tables() {
%1 = tail call i32 (...) @set_up_tables()
ret void
}
/* Variables and functions */
int fabs(int);
int IsEqualFloat(void *a, void *b) {
  return (fabs(*(float *)a == *(float *)b) < 1e-10);
}


x86 assembly (clang, -O0):
<IsEqualFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xeb3(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsEqualFloat>:
push   %rax
movss  (%rsi),%xmm0
cmpeqss (%rdi),%xmm0
movd   %xmm0,%edi
and    $0x1,%edi
call   1030 <fabs@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @IsEqualFloat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fcmp oeq float %7, %10
%12 = zext i1 %11 to i32
%13 = call i32 @fabs(i32 %12)
%14 = sitofp i32 %13 to double
%15 = fcmp olt double %14, 1.000000e-10
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @IsEqualFloat(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp oeq float %4, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @fabs(i32 %8)
%10 = icmp slt i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pretty_print(int *array, int *array_size) {
  int i = 0;
  for (i = 0; i < *array_size; i++) {
    printf("%d\n", array[i]);
  }
}


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

x86 assembly (clang, -O2):
<pretty_print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmpl   $0x0,(%rsi)
jle    1149 <pretty_print+0x39>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
movslq (%r12),%rax
cmp    %rax,%rbx
jl     1130 <pretty_print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @pretty_print(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw nsw i64 %6, 1
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = icmp slt i64 %10, %12
br i1 %13, label %5, label %14
14: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void hello(void) {
  printf("bye1\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"bye1\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [5 x i8] c"bye1\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x67() {
  Assert_real((isxdigit(103) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              520, ("isxdigit should be 0 for g"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x67>:
push   %rbp
mov    %rsp,%rbp
mov    $0x67,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x208,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x67>:
push   %rax
mov    $0x67,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x208,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for g\00"
define void @t_isxdigit_0x67() {
%1 = call i64 @isxdigit(i32 103)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 520, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for g\00"
define void @t_isxdigit_0x67() {
%1 = tail call i64 @isxdigit(i32 103)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 520, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int megalog_present() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @megalog_present() {
ret i32 0
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ non_existent(struct S *, int);
void hooray5(struct S *p) { non_existent(p, 5); }


x86 assembly (clang, -O0):
<hooray5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1030 <non_existent@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hooray5>:
mov    $0x5,%esi
jmp    1030 <non_existent@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @hooray5(%struct.S* %0) {
%2 = alloca %struct.S*
store %struct.S* %0, %struct.S** %2
%3 = load %struct.S*, %struct.S** %2
%4 = call i32 @non_existent(%struct.S* %3, i32 5)
ret void
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @hooray5(%struct.S* %0) {
%2 = tail call i32 @non_existent(%struct.S* %0, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
int main(int argc, char *argv[]) {
  fopen("./asdasdasdasdas_no_exist_file", "r");
  perror("Error");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <fopen@plt>
lea    0xecf(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef4(%rip),%rsi
call   1030 <fopen@plt>
lea    0xee4(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"./asdasdasdasdas_no_exist_file\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"Error\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"./asdasdasdasdas_no_exist_file\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"Error\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int __strncmp(char const *, char const *, size_t);
int strncmp(const char *s1, const char *s2, size_t n) {
  return __strncmp(s1, s2, n);
}


x86 assembly (clang, -O0):
<strncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp>:
jmp    1030 <__strncmp@plt>

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

LLVM IR (-O2):
define i32 @strncmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @__strncmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ inc_only(unsigned char);
int /*<<< orphan*/ write_only(unsigned char);
void inc_and_write(unsigned char what) {
  inc_only(what);
  write_only(what);
}


x86 assembly (clang, -O0):
<inc_and_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <inc_only@plt>
movzbl -0x1(%rbp),%edi
call   1040 <write_only@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_and_write>:
push   %rbx
mov    %edi,%ebx
call   1030 <inc_only@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <write_only@plt>

LLVM IR (-O0):
define void @inc_and_write(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @inc_only(i8 zeroext %3)
%5 = load i8, i8* %2
%6 = call i32 @write_only(i8 zeroext %5)
ret void
}

LLVM IR (-O2):
define void @inc_and_write(i8 zeroext %0) {
%2 = tail call i32 @inc_only(i8 zeroext %0)
%3 = tail call i32 @write_only(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g_writeln(char *);
int usage(void) {
  g_writeln("tcp_proxy <local-port> <remote-ip> <remote-port> [dump]");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"tcp_proxy <local-port> <remote-ip> <remote-port> [dump]\00"
define i32 @usage() {
%1 = call i32 @g_writeln(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [56 x i8] c"tcp_proxy <local-port> <remote-ip> <remote-port> [dump]\00"
define i32 @usage() {
%1 = tail call i32 @g_writeln(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
char *getCorrectedArtworkBasename(char *basename) {
  char *basename_corrected = basename;
  return basename_corrected;
}


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

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

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

LLVM IR (-O2):
define i8* @getCorrectedArtworkBasename(i8* readnone returned %0) {
ret i8* %0
}
int test_imm_44int8_reg(signed char val) {
  return ((val) & (-0x44 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_44int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffbc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_44int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -68
%6 = icmp ne i32 %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_44int8_reg(i8 signext %0) {
%2 = and i8 %0, -68
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf(
      "Interlope loop interruptor 0.1\n"
      "Allows a command to loop periodically, or immediately when desired.\n"
      "To set an immediate loop, use 'pkill -RTMIN+[s argument] interlope\n\n"
      "Usage: interlope [-i interval] [-s signal] command\n"
      "Options:\n"
      " -i interval   The time interval (in milliseconds) on which to loop. "
      "If not given, will only loop on receipt of the given signal.\n"
      " -s n          The number, plus SIGRTMIN, to immediately loop the "
      "passed command.\n\n"
      "Example:\n"
      "$ interlope -i 3000 -s 2 ls\n"
      "$ pkill -RTMIN+2\n\n");
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [496 x i8] c"Interlope loop interruptor 0.1\0AAllows a command to loop periodically, or immediately when desired.\0ATo set an immediate loop, use 'pkill -RTMIN+[s argument] interlope\0A\0AUsage: interlope [-i interval] [-s signal] command\0AOptions:\0A -i interval The time interval (in milliseconds) on which to loop. If not given, will only loop on receipt of the given signal.\0A -s n The number, plus SIGRTMIN, to immediately loop the passed command.\0A\0AExample:\0A$ interlope -i 3000 -s 2 ls\0A$ pkill -RTMIN+2\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([496 x i8], [496 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [495 x i8] c"Interlope loop interruptor 0.1\0AAllows a command to loop periodically, or immediately when desired.\0ATo set an immediate loop, use 'pkill -RTMIN+[s argument] interlope\0A\0AUsage: interlope [-i interval] [-s signal] command\0AOptions:\0A -i interval The time interval (in milliseconds) on which to loop. If not given, will only loop on receipt of the given signal.\0A -s n The number, plus SIGRTMIN, to immediately loop the passed command.\0A\0AExample:\0A$ interlope -i 3000 -s 2 ls\0A$ pkill -RTMIN+2\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([495 x i8], [495 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void ReverseGPIOP$0$In$toggle(void) { HplMcs51GeneralIOC$P10$toggle(); }


x86 assembly (clang, -O0):
<ReverseGPIOP$0$In$toggle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HplMcs51GeneralIOC$P10$toggle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReverseGPIOP$0$In$toggle>:
xor    %eax,%eax
jmp    1030 <HplMcs51GeneralIOC$P10$toggle@plt>

LLVM IR (-O0):
define void @"ReverseGPIOP$0$In$toggle"() {
%1 = call i32 (...) @"HplMcs51GeneralIOC$P10$toggle"()
ret void
}

LLVM IR (-O2):
define void @"ReverseGPIOP$0$In$toggle"() {
%1 = tail call i32 (...) @"HplMcs51GeneralIOC$P10$toggle"()
ret void
}
/* Variables and functions */
double cos(double);
double sin(double x) { return cos(x - 1.57079632679489661923132169164); }


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 0x3FF921FB54442D18
%5 = call double @cos(double %4)
ret double %5
}

LLVM IR (-O2):
define double @sin(double %0) {
%2 = fadd double %0, 0xBFF921FB54442D18
%3 = tail call double @cos(double %2)
ret double %3
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t _get_cs(void) {
  uint16_t cs = 0;
  __asm__ __volatile__("mov %%cs, %0" : "=r"(cs));
  return cs;
}


x86 assembly (clang, -O0):
<_get_cs>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    %cs,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_cs>:
mov    %cs,%rax
ret

LLVM IR (-O0):
define i8* @_get_cs() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i8* asm sideeffect "mov %cs, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @_get_cs() {
%1 = tail call i8* asm sideeffect "mov %cs, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(void) {
  int a = 1;
  int b = 1;
  int c;
  int d;
  c = a++;
  d = ++b;
  printf("a=%d\nb=%d\nc=%d\nd=%d", a, b, c, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"a=%d\0Ab=%d\0Ac=%d\0Ad=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
store i32 %6, i32* %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
store i32 %9, i32* %5
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"a=%d\0Ab=%d\0Ac=%d\0Ad=%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 1, i32 2)
ret i32 0
}
void foo098(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo098(i32 %0) {
ret void
}
main() {
  int x;
  free(&x);
  char buf[3];
  free(buf);
  int *p = 0;
  free(p);
  struct A {
    int *x;
  } *a = 0;
  free(a->x);
  char **ents = 0;
  free(ents);
  free(&ents);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <free@plt>
lea    -0x7(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
lea    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.A = type { i32* }
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca i32*
%4 = alloca %struct.A*
%5 = alloca i8**
%6 = bitcast i32* %1 to i8*
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
store i32* null, i32** %3
%8 = load i32*, i32** %3
%9 = bitcast i32* %8 to i8*
store %struct.A* null, %struct.A** %4
%10 = load %struct.A*, %struct.A** %4
%11 = getelementptr inbounds %struct.A, %struct.A* %10, i32 0, i32 0
%12 = load i32*, i32** %11
%13 = bitcast i32* %12 to i8*
store i8** null, i8*** %5
%14 = load i8**, i8*** %5
%15 = bitcast i8** %14 to i8*
%16 = bitcast i8*** %5 to i8*
ret i32 0
}

LLVM IR (-O2):
%struct.A = type { i32* }
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int read(int, void *, size_t);
ssize_t std_read(int fd, void *buf, size_t count) {
  ssize_t c;
  if ((c = read(fd, buf, count)) == -1) {
    perror("read");
    exit(1);
  }
  return c;
}


x86 assembly (clang, -O0):
<std_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    1175 <std_read+0x45>
lea    0xe9a(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_read>:
push   %rax
call   1030 <read@plt>
cmp    $0xffffffff,%eax
je     113d <std_read+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"read\00"
define i32 @std_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
scalar_t__ kill(int /*<<< orphan*/, int);
int /*<<< orphan*/ unix_error(char *);
void Kill(pid_t pid, int sig) {
  if (kill(pid, sig) < 0) {
    unix_error("Kill error");
  }
}


x86 assembly (clang, -O0):
<Kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <kill@plt>
cmp    $0x0,%rax
jge    114f <Kill+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kill>:
push   %rax
call   1030 <kill@plt>
test   %rax,%rax
js     112d <Kill+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Kill error\00"
define void @Kill(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 i64 @kill(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Kill error\00"
define void @Kill(i32 %0, i32 %1) {
%3 = tail call i64 @kill(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
scalar_t__ check_dune();
scalar_t__ dune_enter();
void *test_pthread_thread(void *arg) {
  if (dune_enter())
    return NULL;
  if (check_dune())
    return NULL;
  return (void *)0x666;
}


x86 assembly (clang, -O0):
<test_pthread_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <dune_enter@plt>
cmp    $0x0,%rax
je     114a <test_pthread_thread+0x2a>
movq   $0x0,-0x8(%rbp)
jmp    1171 <test_pthread_thread+0x51>
mov    $0x0,%al
call   1040 <check_dune@plt>
cmp    $0x0,%rax
je     1168 <test_pthread_thread+0x48>
movq   $0x0,-0x8(%rbp)
jmp    1171 <test_pthread_thread+0x51>
mov    $0x666,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pthread_thread>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <dune_enter@plt>
test   %rax,%rax
jne    1148 <test_pthread_thread+0x28>
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <check_dune@plt>
test   %rax,%rax
mov    $0x666,%ebx
cmovne %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @test_pthread_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @dune_enter()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %12
7: ; preds = %1
%8 = call i64 (...) @check_dune()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* null, i8** %2
br label %12
11: ; preds = %7
store i8* inttoptr (i64 1638 to i8*), i8** %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_pthread_thread(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @dune_enter()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 (...) @check_dune()
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* inttoptr (i64 1638 to i8*), i8* null
br label %8
8: ; preds = %4, %1
%9 = phi i8* [ null, %1 ], [ %7, %4 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *);
void removecard(int a, int b) {
  move(b, a);
  printw("   ");
}


x86 assembly (clang, -O0):
<removecard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <move@plt>
lea    0xec0(%rip),%rdi
call   1030 <printw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removecard>:
push   %rax
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
call   1040 <move@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" \00"
define void @removecard(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @move(i32 %5, i32 %6)
%8 = call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
define void @removecard(i32 %0, i32 %1) {
%3 = tail call i32 @move(i32 %1, i32 %0)
%4 = tail call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void __attribute__((always_, format(printf, 1, 2)))
logging_null(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @logging_null(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, char *);
int read_nullpage(void *data) {
  printf("Address %p now contains: %s\n", data, (char *)data);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"Address %p now contains: %s\0A\00"
define i32 @read_nullpage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Address %p now contains: %s\0A\00"
define i32 @read_nullpage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret i32 0
}
/* Variables and functions */
int isalpha(char);
int match_alpha(char c) { return isalpha(c); }


x86 assembly (clang, -O0):
<match_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_alpha>:
jmp    1030 <isalpha@plt>

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

LLVM IR (-O2):
define i32 @match_alpha(i8 signext %0) {
%2 = tail call i32 @isalpha(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int f1(int /*<<< orphan*/);
int f2(int add) {
  if (add)
    return f1(0) + 26;
  return f1(0);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1137 <f2+0x27>
xor    %edi,%edi
call   1030 <f1@plt>
add    $0x1a,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <f2+0x31>
xor    %edi,%edi
call   1030 <f1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <f1@plt>
lea    0x1a(%rax),%ecx
test   %ebx,%ebx
cmovne %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @f1(i32 0)
%8 = add nsw i32 %7, 26
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = call i32 @f1(i32 0)
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = tail call i32 @f1(i32 0)
%4 = add nsw i32 %3, 26
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}