xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int value = 123;
  printf("value"
         " is equal to %d.\n",
         value);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x7b,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%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    $0x7b,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"value is equal to %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 123)
ret i32 0
}
int ODC2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ODC2() {
ret i32 0
}
float my_exper2(float base, int exp) {
  if (exp == 0)
    return 1;
  return my_exper2(base, exp - 1) * base;
}


x86 assembly (clang, -O0):
<my_exper2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113c <my_exper2+0x2c>
movss  0xece(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1156 <my_exper2+0x46>
movss  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <my_exper2@plt>
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_exper2>:
push   %rax
test   %edi,%edi
je     112b <my_exper2+0x1b>
add    $0xffffffff,%edi
movss  %xmm0,0x4(%rsp)
call   1030 <my_exper2@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret
movss  0xecd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @my_exper2(float %0, i32 %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store float 1.000000e+00, float* %3
br label %16
9: ; preds = %2
%10 = load float, float* %4
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = call float @my_exper2(float %10, i32 %12)
%14 = load float, float* %4
%15 = fmul float %13, %14
store float %15, float* %3
br label %16
16: ; preds = %9, %8
%17 = load float, float* %3
ret float %17
}

LLVM IR (-O2):
define float @my_exper2(float %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi float [ %9, %6 ], [ 1.000000e+00, %2 ]
ret float %5
6: ; preds = %2
%7 = add nsw i32 %1, -1
%8 = tail call float @my_exper2(float %0, i32 %7)
%9 = fmul float %8, %0
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *lp) {
  if (lp != NULL) {
    free(lp);
  }
}


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

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int getW1Graph(int sizeGraph) {
  assert(sizeGraph <= 14);
  return sizeGraph * sizeGraph;
}


x86 assembly (clang, -O0):
<getW1Graph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xe,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getW1Graph>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0xf,%ebx
setl   %dil
call   1030 <assert@plt>
imul   %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getW1Graph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 14
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getW1Graph(i32 %0) {
%2 = icmp slt i32 %0, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = mul nsw i32 %0, %0
ret i32 %5
}
void lh_insert(void) {}


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

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

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

LLVM IR (-O2):
define void @lh_insert() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int ***);
int /*<<< orphan*/ free_int_mat(int **, int);
void free_int_mat3(int ***matrix, int dim1, int dim2) {
  int i;
  for (i = 0; i < dim1; i++)
    free_int_mat(matrix[i], dim2);
  free(matrix);
}


x86 assembly (clang, -O0):
<free_int_mat3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <free_int_mat3+0x47>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%esi
call   1040 <free_int_mat@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <free_int_mat3+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_int_mat3>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
test   %esi,%esi
jle    1155 <free_int_mat3+0x35>
mov    %edx,%r14d
mov    %esi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,8),%rdi
mov    %r14d,%esi
call   1040 <free_int_mat@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <free_int_mat3+0x20>
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_int_mat3(i32*** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32**, i32*** %0, i64 %8
%10 = load i32**, i32*** %9
%11 = tail call i32 @free_int_mat(i32** %10, i32 %2)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = tail call i32 @free(i32*** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_sql_block_comment() {
  test_parser_verify_parse(test_parser_sourcefile("sql", " {sql}"), "sql", "",
                           "{sql}", 0);
}


x86 assembly (clang, -O0):
<test_sql_block_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebc(%rip),%rdx
lea    0xeb7(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sql_block_comment>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec5(%rip),%rdx
lea    0xec0(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sql\00"
@.str.1 = [7 x i8] c" {sql}\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [6 x i8] c"{sql}\00"
define void @test_sql_block_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"sql\00"
@.str.1 = [7 x i8] c" {sql}\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [6 x i8] c"{sql}\00"
define void @test_sql_block_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
void switch_io_bitmap(struct tss_struct *tss, struct task_struct *prev_p,
                      struct task_struct *next_p) {}


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

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

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

LLVM IR (-O2):
%struct.tss_struct = type opaque
%struct.task_struct = type opaque
define void @switch_io_bitmap(%struct.tss_struct* nocapture %0, %struct.task_struct* nocapture %1, %struct.task_struct* nocapture %2) {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int natural(double);
int sqrt(int);
int pentagonal(uint64_t x) {
  double p = (sqrt(24 * x + 1) + 1) / 6;
  return natural(p);
}


x86 assembly (clang, -O0):
<pentagonal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x18,-0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <sqrt@plt>
add    $0x1,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <natural@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pentagonal>:
push   %rax
shl    $0x3,%edi
lea    (%rdi,%rdi,2),%edi
or     $0x1,%edi
call   1030 <sqrt@plt>
add    $0x1,%eax
cltq
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rax
jmp    1040 <natural@plt>

LLVM IR (-O0):
define i32 @pentagonal(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 24, %4
%6 = add nsw i32 %5, 1
%7 = call i32 @sqrt(i32 %6)
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %8, 6
%10 = sitofp i32 %9 to double
store double %10, double* %3
%11 = load double, double* %3
%12 = call i32 @natural(double %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @pentagonal(i32 %0) {
%2 = mul nsw i32 %0, 24
%3 = or i32 %2, 1
%4 = tail call i32 @sqrt(i32 %3)
%5 = add nsw i32 %4, 1
%6 = sdiv i32 %5, 6
%7 = sitofp i32 %6 to double
%8 = tail call i32 @natural(double %7)
ret i32 %8
}
void option_unset2option_unset_unit() {}


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

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

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

LLVM IR (-O2):
define void @option_unset2option_unset_unit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_print(char *);
int socket(int, int, int);
int common_socket(int family, int type, int protocol) {
  int fd = socket(family, type, protocol);
  if (fd < 0)
    error_print("socket error\n");
  return fd;
}


x86 assembly (clang, -O0):
<common_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1158 <common_socket+0x38>
lea    0xead(%rip),%rdi
call   1030 <error_print@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<common_socket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <common_socket+0x18>
lea    0xecd(%rip),%rdi
call   1030 <error_print@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"socket error\0A\00"
define i32 @common_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error_print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
size_t terra_pos(size_t area_max_x, size_t y, size_t x) {
  return y * area_max_x + x;
}


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

x86 assembly (clang, -O2):
<terra_pos>:
imul   %rsi,%rdi
lea    (%rdi,%rdx,1),%rax
ret

LLVM IR (-O0):
define i64 @terra_pos(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
%10 = load i64, i64* %6
%11 = add i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @terra_pos(i64 %0, i64 %1, i64 %2) {
%4 = mul i64 %1, %0
%5 = add i64 %4, %2
ret i64 %5
}
int isupper(int a) { return (int)(((unsigned)(a) - (unsigned)'A') < 26U); }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
cmp    $0x1a,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 65
%5 = icmp ult i32 %4, 26
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int using_aes_asm() { return 0; }


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

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

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

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

/* Variables and functions */
size_t vmbuf_wlocpos(struct vmbuf *);
size_t vmbuf_size(struct vmbuf *vmbuf) { return vmbuf_wlocpos(vmbuf); }


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

x86 assembly (clang, -O2):
<vmbuf_size>:
jmp    1030 <vmbuf_wlocpos@plt>

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define i64 @vmbuf_size(%struct.vmbuf* %0) {
%2 = alloca %struct.vmbuf*
store %struct.vmbuf* %0, %struct.vmbuf** %2
%3 = load %struct.vmbuf*, %struct.vmbuf** %2
%4 = call i64 @vmbuf_wlocpos(%struct.vmbuf* %3)
ret i64 %4
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define i64 @vmbuf_size(%struct.vmbuf* %0) {
%2 = tail call i64 @vmbuf_wlocpos(%struct.vmbuf* %0)
ret i64 %2
}
/* Variables and functions */
int main_ssh_all(int, char **);
int main(int argc, char **argv) {
  int istat = main_ssh_all(argc, argv);
  return istat;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main_ssh_all@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main_ssh_all@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_ssh_all(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ borderless_sand(unsigned char *);
void dispatch_terrain_sand(unsigned char *pic) { borderless_sand(pic); }


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

x86 assembly (clang, -O2):
<dispatch_terrain_sand>:
jmp    1030 <borderless_sand@plt>

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

LLVM IR (-O2):
define void @dispatch_terrain_sand(i8* %0) {
%2 = tail call i32 @borderless_sand(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(double);
int main(void) {
  print(0.0);
  print(0.5);
  print(1.0);
  print(-1.0);
  print(100.0);
  print(1000.0);
  print(10000.0);
  print(12345.0);
  print(100000.0);
  print(123456.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
call   1030 <print@plt>
movsd  0xf11(%rip),%xmm0
call   1030 <print@plt>
movsd  0xefc(%rip),%xmm0
call   1030 <print@plt>
movsd  0xee7(%rip),%xmm0
call   1030 <print@plt>
movsd  0xed2(%rip),%xmm0
call   1030 <print@plt>
movsd  0xebd(%rip),%xmm0
call   1030 <print@plt>
movsd  0xea8(%rip),%xmm0
call   1030 <print@plt>
movsd  0xe93(%rip),%xmm0
call   1030 <print@plt>
movsd  0xe7e(%rip),%xmm0
call   1030 <print@plt>
movsd  0xe69(%rip),%xmm0
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xorps  %xmm0,%xmm0
call   1030 <print@plt>
movsd  0xedf(%rip),%xmm0
call   1030 <print@plt>
movsd  0xeda(%rip),%xmm0
call   1030 <print@plt>
movsd  0xed5(%rip),%xmm0
call   1030 <print@plt>
movsd  0xed0(%rip),%xmm0
call   1030 <print@plt>
movsd  0xecb(%rip),%xmm0
call   1030 <print@plt>
movsd  0xec6(%rip),%xmm0
call   1030 <print@plt>
movsd  0xec1(%rip),%xmm0
call   1030 <print@plt>
movsd  0xebc(%rip),%xmm0
call   1030 <print@plt>
movsd  0xeb7(%rip),%xmm0
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(double 0.000000e+00)
%3 = call i32 @print(double 5.000000e-01)
%4 = call i32 @print(double 1.000000e+00)
%5 = call i32 @print(double -1.000000e+00)
%6 = call i32 @print(double 1.000000e+02)
%7 = call i32 @print(double 1.000000e+03)
%8 = call i32 @print(double 1.000000e+04)
%9 = call i32 @print(double 1.234500e+04)
%10 = call i32 @print(double 1.000000e+05)
%11 = call i32 @print(double 1.234560e+05)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print(double 0.000000e+00)
%2 = tail call i32 @print(double 5.000000e-01)
%3 = tail call i32 @print(double 1.000000e+00)
%4 = tail call i32 @print(double -1.000000e+00)
%5 = tail call i32 @print(double 1.000000e+02)
%6 = tail call i32 @print(double 1.000000e+03)
%7 = tail call i32 @print(double 1.000000e+04)
%8 = tail call i32 @print(double 1.234500e+04)
%9 = tail call i32 @print(double 1.000000e+05)
%10 = tail call i32 @print(double 1.234560e+05)
ret i32 0
}
void foo_2_1_2_1_2_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_2_2_1_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vlistCopy(int, int);
int vlistCreate();
int vlistDuplicate(int vlistID) {
  int vlistIDnew = vlistCreate();
  vlistCopy(vlistIDnew, vlistID);
  return (vlistIDnew);
}


x86 assembly (clang, -O0):
<vlistDuplicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <vlistCreate@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <vlistCopy@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlistDuplicate>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <vlistCreate@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <vlistCopy@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vlistDuplicate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @vlistCreate()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @vlistCopy(i32 %5, i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @vlistDuplicate(i32 %0) {
%2 = tail call i32 (...) @vlistCreate()
%3 = tail call i32 @vlistCopy(i32 %2, i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;
struct pcg_state_setseq_64 {
  int dummy;
};

/* Variables and functions */
int pcg_setseq_64_xsh_rr_32_random_r(struct pcg_state_setseq_64 *);
uint32_t pcg_setseq_64_xsh_rr_32_boundedrand_r(struct pcg_state_setseq_64 *rng,
                                               uint32_t bound) {
  uint32_t threshold = -bound % bound;
  for (;;) {
    uint32_t r = pcg_setseq_64_xsh_rr_32_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_setseq_64_xsh_rr_32_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_setseq_64_xsh_rr_32_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_setseq_64_xsh_rr_32_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_setseq_64_xsh_rr_32_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_setseq_64_xsh_rr_32_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_setseq_64_xsh_rr_32_random_r@plt>
test   %eax,%eax
js     1120 <pcg_setseq_64_xsh_rr_32_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_setseq_64 = type { i32 }
define i32 @pcg_setseq_64_xsh_rr_32_boundedrand_r(%struct.pcg_state_setseq_64* %0, i32 %1) {
%3 = alloca %struct.pcg_state_setseq_64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_setseq_64* %0, %struct.pcg_state_setseq_64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_setseq_64*, %struct.pcg_state_setseq_64** %3
%13 = call i32 @pcg_setseq_64_xsh_rr_32_random_r(%struct.pcg_state_setseq_64* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_setseq_64 = type { i32 }
define i32 @pcg_setseq_64_xsh_rr_32_boundedrand_r(%struct.pcg_state_setseq_64* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_setseq_64_xsh_rr_32_random_r(%struct.pcg_state_setseq_64* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int id(int);
void main() {
  int input = 5;
  int result = id(input);
  if (result == 5) {
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <id@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    114b <main+0x2b>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <id@plt>
cmp    $0x5,%eax
jne    1138 <main+0x18>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__VERIFIER_error@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @id(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @__VERIFIER_error()
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @id(i32 5)
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret void
}
void c_calhc(int n, double *x, int ind, int *hcrow, int *hccol, double *hcval,
             int *hcnnz, int lim, _Bool *lmem, int *flag) {
  *flag = 0;
  *lmem = 0;
  *hcnnz = 0;
  return;
}


x86 assembly (clang, -O0):
<c_calhc>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_calhc>:
mov    0x8(%rsp),%rax
mov    0x18(%rsp),%rcx
mov    0x20(%rsp),%rdx
movl   $0x0,(%rdx)
movb   $0x0,(%rcx)
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @c_calhc(i32 %0, double* %1, i32 %2, i32* %3, i32* %4, double* %5, i32* %6, i32 %7, i8* %8, i32* %9) {
%11 = alloca i32
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca double*
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i32*
store i32 %0, i32* %11
store double* %1, double** %12
store i32 %2, i32* %13
store i32* %3, i32** %14
store i32* %4, i32** %15
store double* %5, double** %16
store i32* %6, i32** %17
store i32 %7, i32* %18
store i8* %8, i8** %19
store i32* %9, i32** %20
%21 = load i32*, i32** %20
store i32 0, i32* %21
%22 = load i8*, i8** %19
store i8 0, i8* %22
%23 = load i32*, i32** %17
store i32 0, i32* %23
ret void
}

LLVM IR (-O2):
define void @c_calhc(i32 %0, double* nocapture readnone %1, i32 %2, i32* nocapture readnone %3, i32* nocapture readnone %4, double* nocapture readnone %5, i32* nocapture writeonly %6, i32 %7, i8* nocapture writeonly %8, i32* nocapture writeonly %9) {
store i32 0, i32* %9
store i8 0, i8* %8
store i32 0, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void Signup_Cache(void) { trap_R_RegisterShaderNoMip("menu/art/cut_frame"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"menu/art/cut_frame\00"
define void @Signup_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"menu/art/cut_frame\00"
define void @Signup_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sqrt(double);
int /*<<< orphan*/ sqrtf(float);
int /*<<< orphan*/ sqrtl(long double);
void uninitvar_sqrt(void) {
  float f;
  (void)sqrtf(f);
  double d;
  (void)sqrt(d);
  long double ld;
  (void)sqrtl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1040 <sqrtf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sqrtl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_sqrt>:
sub    $0x18,%rsp
call   1040 <sqrtf@plt>
call   1050 <sqrt@plt>
call   1030 <sqrtl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_sqrt() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @sqrtf(float %4)
%6 = load double, double* %2
%7 = call i32 @sqrt(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @sqrtl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_sqrt() {
%1 = tail call i32 @sqrtf(float undef)
%2 = tail call i32 @sqrt(double undef)
%3 = tail call i32 @sqrtl(x86_fp80 undef)
ret void
}
/* Variables and functions */
double atan2(double, int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(int);
double asin(double x) { return atan2(x, sqrt(1 - x * x)); }


x86 assembly (clang, -O0):
<asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe9c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
mov    %eax,%edi
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asin>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeca(%rip),%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @asin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fneg double %4
%7 = call double @llvm.fmuladd.f64(double %6, double %5, double 1.000000e+00)
%8 = fptosi double %7 to i32
%9 = call i32 @sqrt(i32 %8)
%10 = call double @atan2(double %3, i32 %9)
ret double %10
}

LLVM IR (-O2):
define double @asin(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call i32 @sqrt(i32 %4)
%6 = tail call double @atan2(double %0, i32 %5)
ret double %6
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *gosh_alloc_size(size_t size) {
  void *ptr = malloc(size);
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<gosh_alloc_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gosh_alloc_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @gosh_alloc_size(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ memmove(int *, int *, int);
void memmove_good1() {
  int arr1[10];
  int arr2[20];
  memmove(arr2, arr1, 40);
}


x86 assembly (clang, -O0):
<memmove_good1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x28,%edx
call   1030 <memmove@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove_good1>:
sub    $0x88,%rsp
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x28,%edx
call   1030 <memmove@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @memmove_good1() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @memmove(i32* %3, i32* %4, i32 40)
ret void
}

LLVM IR (-O2):
define void @memmove_good1() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @memmove(i32* %5, i32* %6, i32 40)
ret void
}
/* Variables and functions */
int tolower(int);
void test_tolower_concrete(int v) {
  int ret = tolower(256);
  (void)ret;
}


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

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

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

LLVM IR (-O2):
define void @test_tolower_concrete(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CMasterBaseValid(unsigned long);
void I2CMasterIntEnableEx(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(I2CMasterBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000010))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<I2CMasterIntEnableEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntEnableEx>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
or     %r14,0x10(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2CMasterIntEnableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @I2CMasterBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = add i64 %9, 16
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntEnableEx(i64 %0, i64 %1) {
%3 = tail call i32 @I2CMasterBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 16
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = or i64 %7, %1
store volatile i64 %8, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ndsctl_print(char *);
void ndsctl_status(void) { ndsctl_print("status"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"status\00"
define void @ndsctl_status() {
%1 = call i32 @ndsctl_print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"status\00"
define void @ndsctl_status() {
%1 = tail call i32 @ndsctl_print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_inverse(float *, float *);
__attribute__((always_)) struct vec2 *psvec2_inverse(struct vec2 *result,
                                                     struct vec2 *a) {
  vec2_inverse((float *)result, (float *)a);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2_inverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_inverse@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_inverse(%struct.vec2* %0, %struct.vec2* %1) {
%3 = alloca %struct.vec2*
%4 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %3
store %struct.vec2* %1, %struct.vec2** %4
%5 = load %struct.vec2*, %struct.vec2** %3
%6 = bitcast %struct.vec2* %5 to float*
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = call i32 @vec2_inverse(float* %6, float* %8)
%10 = load %struct.vec2*, %struct.vec2** %3
ret %struct.vec2* %10
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_inverse(%struct.vec2* returned %0, %struct.vec2* %1) {
%3 = bitcast %struct.vec2* %0 to float*
%4 = bitcast %struct.vec2* %1 to float*
%5 = tail call i32 @vec2_inverse(float* %3, float* %4)
ret %struct.vec2* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char func_c();
char __attribute__((visibility("default"))) func_b(void) {
  if (func_c() != 'c') {
    exit(3);
  }
  return 'b';
}


x86 assembly (clang, -O0):
<func_b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func_c@plt>
movsbl %al,%eax
cmp    $0x63,%eax
je     1141 <func_b+0x21>
mov    $0x3,%edi
call   1040 <exit@plt>
mov    $0x62,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_b>:
push   %rax
xor    %eax,%eax
call   1030 <func_c@plt>
cmp    $0x63,%al
jne    1130 <func_b+0x10>
mov    $0x62,%al
pop    %rcx
ret
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define signext i8 @func_b() {
%1 = call signext i8 (...) @func_c()
%2 = sext i8 %1 to i32
%3 = icmp ne i32 %2, 99
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @exit(i32 3)
unreachable
6: ; preds = %0
ret i8 98
}

LLVM IR (-O2):
define signext i8 @func_b() {
%1 = tail call signext i8 (...) @func_c()
%2 = icmp eq i8 %1, 99
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @exit(i32 3)
unreachable
5: ; preds = %0
ret i8 98
}
void turnonled() {}


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

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

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

LLVM IR (-O2):
define void @turnonled() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ write_word_data(int, int, int /*<<< orphan*/);
void io_set_bus_direction(uint16_t direction) {
  write_word_data(0x20, 0x00, direction);
}


x86 assembly (clang, -O0):
<io_set_bus_direction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <write_word_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_set_bus_direction>:
mov    %edi,%edx
mov    $0x20,%edi
xor    %esi,%esi
jmp    1030 <write_word_data@plt>

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

LLVM IR (-O2):
define void @io_set_bus_direction(i32 %0) {
%2 = tail call i32 @write_word_data(i32 32, i32 0, i32 %0)
ret void
}
int d_ne_mr1(double *a1, double a2) { return (((*a1) != (a2))); }


x86 assembly (clang, -O0):
<d_ne_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ne_mr1>:
cmpneqsd (%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_ne_mr1(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp une double %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_ne_mr1(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp une double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int snprintf(char *, int, char *, unsigned char, unsigned char);
int MQTTStringFormat_connack(char *strbuf, int strbuflen,
                             unsigned char connack_rc,
                             unsigned char sessionPresent) {
  int strindex =
      snprintf(strbuf, strbuflen, "CONNACK session present %d, rc %d",
               sessionPresent, connack_rc);
  return strindex;
}


x86 assembly (clang, -O0):
<MQTTStringFormat_connack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %cl,-0xd(%rbp)
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xe(%rbp),%al
lea    0xec6(%rip),%rdx
movzbl %al,%ecx
movzbl -0xd(%rbp),%r8d
call   1030 <snprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MQTTStringFormat_connack>:
mov    %edx,%r8d
lea    0xee6(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"CONNACK session present %d, rc %d\00"
define i32 @MQTTStringFormat_connack(i8* %0, i32 %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8, i8* %8
%13 = load i8, i8* %7
%14 = call i32 @snprintf(i8* %10, i32 %11, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %12, i8 zeroext %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
@.str = [34 x i8] c"CONNACK session present %d, rc %d\00"
define i32 @MQTTStringFormat_connack(i8* %0, i32 %1, i8 zeroext %2, i8 zeroext %3) {
%5 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %3, i8 zeroext %2)
ret i32 %5
}
/* Variables and functions */
double atoll(char *);
int /*<<< orphan*/ better_sleep(double);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  double sleep_time = atoll(argv[1]);
  printf("sleep for %lf\n", sleep_time);
  better_sleep(sleep_time);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoll@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1040 <better_sleep@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoll@plt>
movsd  %xmm0,(%rsp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <better_sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"sleep for %lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call double @atoll(i8* %9)
store double %10, double* %6
%11 = load double, double* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %11)
%13 = load double, double* %6
%14 = call i32 @better_sleep(double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"sleep for %lf\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call double @atoll(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %5)
%7 = tail call i32 @better_sleep(double %5)
ret i32 0
}
__attribute__((always_)) void ltr(int tr) {
  __asm__ __volatile__("ltr %0" : : "m"(tr));
}


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

x86 assembly (clang, -O2):
<ltr>:
mov    %edi,-0x4(%rsp)
ltr    -0x4(%rsp)
ret

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

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