xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
void skip_to_eol(FILE *file) {
  int i;
  while ((i = getc(file)) != EOF)
    if (i == '\n')
      break;
}


x86 assembly (clang, -O0):
<skip_to_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%eax
je     114b <skip_to_eol+0x3b>
cmpl   $0xa,-0xc(%rbp)
jne    1146 <skip_to_eol+0x36>
jmp    114b <skip_to_eol+0x3b>
jmp    111c <skip_to_eol+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_to_eol>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
je     1132 <skip_to_eol+0x22>
cmp    (%r14),%eax
jne    1120 <skip_to_eol+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_to_eol(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
%6 = icmp eq i32 %3, 10
%7 = or i1 %6, %5
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rul__mem_free(void *);
void rul__cvt_free(void *ext_pointer) {
  rul__mem_free(ext_pointer);
  return;
}


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

x86 assembly (clang, -O2):
<rul__cvt_free>:
jmp    1030 <rul__mem_free@plt>

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

LLVM IR (-O2):
define void @rul__cvt_free(i8* %0) {
%2 = tail call i32 @rul__mem_free(i8* %0)
ret void
}
/* Variables and functions */
int mysnprintf(char *, size_t, char *, float);
int float2str(float value, char *buf, size_t len) {
  return mysnprintf(buf, len, "%f", value);
}


x86 assembly (clang, -O0):
<float2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movss  -0x4(%rbp),%xmm0
lea    0xec7(%rip),%rdx
call   1030 <mysnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float2str>:
lea    0xee9(%rip),%rdx
jmp    1030 <mysnprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @float2str(float %0, i8* %1, i64 %2) {
%4 = alloca float
%5 = alloca i8*
%6 = alloca i64
store float %0, float* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load float, float* %4
%10 = call i32 @mysnprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @float2str(float %0, i8* %1, i64 %2) {
%4 = tail call i32 @mysnprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret i32 %4
}
int test_imm_6Cint64_lowword_reg(long long val) {
  return ((val) & (0x6C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Cint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 108
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t hash(const char *id) {
  size_t h = 0;
  for (; *id; ++id)
    h = 2113 * h + (unsigned char)*id;
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <hash+0x44>
imul   $0x841,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <hash+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x841,%rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %15, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i64, i64* %3
%10 = mul i64 2113, %9
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = add i64 %10, %13
store i64 %14, i64* %3
br label %15
15: ; preds = %8
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %4
18: ; preds = %4
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 2113
%9 = zext i8 %5 to i64
%10 = add i64 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %15
}
void test_max_with_positive_numbers(void) {
  do {
    seatest_assert_int_equal(193775235, ({
                               typeof(146719) _a = (146719);
                               typeof(193775235) _b = (193775235);
                               (_a > _b) ? _a : _b;
                             }),
                             __FUNCTION__, 46);
  } while (0);
}


x86 assembly (clang, -O0):
<test_max_with_positive_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x23d1f,-0x4(%rbp)
movl   $0xb8cc683,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113d <test_max_with_positive_numbers+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <test_max_with_positive_numbers+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0xb8cc683,%edi
lea    0xea8(%rip),%rdx
mov    $0x2e,%ecx
mov    $0x0,%al
call   1030 <seatest_assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_max_with_positive_numbers>:
lea    0xee9(%rip),%rdx
mov    $0xb8cc683,%edi
mov    $0xb8cc683,%esi
mov    $0x2e,%ecx
xor    %eax,%eax
jmp    1030 <seatest_assert_int_equal@plt>

LLVM IR (-O0):
@__FUNCTION__.test_max_with_positive_numbers = [31 x i8] c"test_max_with_positive_numbers\00"
define void @test_max_with_positive_numbers() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0
store i32 146719, i32* %1
store i32 193775235, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load i32, i32* %1
br label %12
10: ; preds = %4
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 193775235, i32 %14, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @__FUNCTION__.test_max_with_positive_numbers, i64 0, i64 0), i32 46)
br label %16
16: ; preds = %12
ret void
}

LLVM IR (-O2):
@__FUNCTION__.test_max_with_positive_numbers = [31 x i8] c"test_max_with_positive_numbers\00"
define void @test_max_with_positive_numbers() {
%1 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 193775235, i32 193775235, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @__FUNCTION__.test_max_with_positive_numbers, i64 0, i64 0), i32 46)
ret void
}
/* Variables and functions */
void *calloc(int, int);
void *gl_zalloc(int size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<gl_zalloc>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @gl_zalloc(i32 %0) {
%2 = tail call i8* @calloc(i32 1, i32 %0)
ret i8* %2
}
int test_imm_5Dint8_reg(signed char val) {
  return ((val) & (-0x5D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Dint8_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, -93
%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_5Dint8_reg(i8 signext %0) {
%2 = and i8 %0, -93
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float sqrt(float);
float fpow34(float x) { return (float)sqrt(x * sqrt(x)); }


x86 assembly (clang, -O0):
<fpow34>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpow34>:
movaps %xmm0,%xmm1
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jb     1124 <fpow34+0x14>
xorps  %xmm0,%xmm0
sqrtss %xmm1,%xmm0
jmp    1140 <fpow34+0x30>
push   %rax
movaps %xmm1,%xmm0
movss  %xmm1,0x4(%rsp)
call   1030 <sqrt@plt>
xorps  %xmm2,%xmm2
movss  0x4(%rsp),%xmm1
add    $0x8,%rsp
mulss  %xmm1,%xmm0
ucomiss %xmm2,%xmm0
jb     114e <fpow34+0x3e>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @fpow34(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @sqrt(float %4)
%6 = fmul float %3, %5
%7 = call float @sqrt(float %6)
ret float %7
}

LLVM IR (-O2):
define float @fpow34(float %0) {
%2 = tail call float @sqrt(float %0)
%3 = fmul float %2, %0
%4 = tail call float @sqrt(float %3)
ret float %4
}
void make_bones(void) {}


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

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

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

LLVM IR (-O2):
define void @make_bones() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test02_head() {
  do {
    printf("test02");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test02_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test02_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test02_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test02\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test02_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test02\00"
define void @test02_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int rand();
int getNextCard(int min, int max) {
  max -= min;
  return (rand() % max) + min;
}


x86 assembly (clang, -O0):
<getNextCard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextCard>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
sub    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getNextCard(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 = sub nsw i32 %6, %5
store i32 %7, i32* %4
%8 = call i32 (...) @rand()
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @getNextCard(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %3
%6 = add nsw i32 %5, %0
ret i32 %6
}
int areas_overlap(unsigned area_0_start, unsigned area_0_length,
                  unsigned area_1_start, unsigned area_1_length) {
  unsigned area_0_end, area_1_end;
  area_0_end = area_0_start + area_0_length - 1;
  area_1_end = area_1_start + area_1_length - 1;
  return ((area_1_start <= area_0_end) && (area_0_start <= area_1_end));
}


x86 assembly (clang, -O0):
<areas_overlap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x19(%rbp)
ja     1145 <areas_overlap+0x45>
mov    -0x4(%rbp),%eax
cmp    -0x18(%rbp),%eax
setbe  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<areas_overlap>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
add    %edx,%ecx
add    $0xffffffff,%ecx
cmp    %edx,%eax
setae  %al
cmp    %edi,%ecx
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @areas_overlap(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add i32 %11, %12
%14 = sub i32 %13, 1
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = add i32 %15, %16
%18 = sub i32 %17, 1
store i32 %18, i32* %10
%19 = load i32, i32* %7
%20 = load i32, i32* %9
%21 = icmp ule i32 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %4
%23 = load i32, i32* %5
%24 = load i32, i32* %10
%25 = icmp ule i32 %23, %24
br label %26
26: ; preds = %22, %4
%27 = phi i1 [ false, %4 ], [ %25, %22 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @areas_overlap(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %0, -1
%6 = add i32 %5, %1
%7 = add i32 %2, -1
%8 = add i32 %7, %3
%9 = icmp uge i32 %6, %2
%10 = icmp uge i32 %8, %0
%11 = and i1 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
void d2i_PKCS7_ENCRYPT(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_PKCS7_ENCRYPT() {
ret void
}
int util_mkdir(const char *path) {}


x86 assembly (clang, -O0):
<util_mkdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @util_mkdir(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fill_socket_name(char *, int, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
void _xprobes_unlink_socket(uid_t uid, pid_t pid) {
  char file[92];
  fill_socket_name(file, 92, uid, pid);
  unlink(file);
}


x86 assembly (clang, -O0):
<_xprobes_unlink_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x5c,%esi
call   1040 <fill_socket_name@plt>
lea    -0x70(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xprobes_unlink_socket>:
push   %rbx
sub    $0x60,%rsp
mov    %esi,%ecx
mov    %edi,%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1040 <fill_socket_name@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @_xprobes_unlink_socket(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [92 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [92 x i8], [92 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @fill_socket_name(i8* %6, i32 92, i32 %7, i32 %8)
%10 = getelementptr inbounds [92 x i8], [92 x i8]* %5, i64 0, i64 0
%11 = call i32 @unlink(i8* %10)
ret void
}

LLVM IR (-O2):
define void @_xprobes_unlink_socket(i32 %0, i32 %1) {
%3 = alloca [92 x i8]
%4 = getelementptr inbounds [92 x i8], [92 x i8]* %3, i64 0, i64 0
%5 = call i32 @fill_socket_name(i8* %4, i32 92, i32 %0, i32 %1)
%6 = call i32 @unlink(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello,  world!\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"hello, world!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_apply(int /*<<< orphan*/ (*)(int),
                                   int /*<<< orphan*/, int);
int /*<<< orphan*/ __builtin_apply_args();
int /*<<< orphan*/ foo(int);
void bar(int arg) {
  foo(arg);
  __builtin_apply(foo, __builtin_apply_args(), 16);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <foo@plt>
mov    $0x0,%al
call   1030 <__builtin_apply_args@plt>
mov    %eax,%esi
mov    0x2ea5(%rip),%rdi
mov    $0x10,%edx
call   1040 <__builtin_apply@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
call   1050 <foo@plt>
mov    0x2ebb(%rip),%rbx
xor    %eax,%eax
call   1030 <__builtin_apply_args@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x10,%edx
pop    %rbx
jmp    1040 <__builtin_apply@plt>

LLVM IR (-O0):
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo(i32 %3)
%5 = call i32 (...) @__builtin_apply_args()
%6 = call i32 @__builtin_apply(i32 (i32)* @foo, i32 %5, i32 16)
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
%3 = tail call i32 (...) @__builtin_apply_args()
%4 = tail call i32 @__builtin_apply(i32 (i32)* @foo, i32 %3, i32 16)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ analyze_32(int /*<<< orphan*/ *);
int /*<<< orphan*/ analyze_64(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
void analyze_elf(FILE *fp) {
  int class;
  class = getc(fp);
  if (class == 0x01) {
    analyze_32(fp);
  } else if (class == 0x02) {
    analyze_64(fp);
  }
}


x86 assembly (clang, -O0):
<analyze_elf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1160 <analyze_elf+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <analyze_32@plt>
jmp    1178 <analyze_elf+0x48>
cmpl   $0x2,-0xc(%rbp)
jne    1173 <analyze_elf+0x43>
mov    -0x8(%rbp),%rdi
call   1040 <analyze_64@plt>
jmp    1178 <analyze_elf+0x48>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<analyze_elf>:
push   %rbx
mov    %rdi,%rbx
call   1050 <getc@plt>
cmp    $0x2,%eax
je     114c <analyze_elf+0x1c>
cmp    $0x1,%eax
jne    1155 <analyze_elf+0x25>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <analyze_32@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <analyze_64@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @analyze_elf(i32* %0) {
%2 = tail call i32 @getc(i32* %0)
switch i32 %2, label %7 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %1
%4 = tail call i32 @analyze_32(i32* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @analyze_64(i32* %0)
br label %7
7: ; preds = %1, %5, %3
ret void
}
int pxm_to_node(int pxm) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pxm_to_node(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ seg(int *, int);
int main(void) {
  int a[10] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1};
  seg(a, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <seg@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movaps 0xed9(%rip),%xmm0
movups %xmm0,0x18(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <seg@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = bitcast i8* %3 to [10 x i32]*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 6
store i32 1, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 7
store i32 1, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 8
store i32 1, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 9
store i32 1, i32* %8
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i32 @seg(i32* %9, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %4
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @seg(i32* %5, i32 10)
ret i32 0
}
/* Variables and functions */
char *escape_string(char *);
int /*<<< orphan*/ s_internal(char *, char *, char *, int);
char *s_escape_string(char *str) {
  char *r = escape_string(str);
  (s_internal(str, "str",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/guicho271828/roswell/refs/heads/"
              "master/src/util_string.c",
              183));
  return r;
}


x86 assembly (clang, -O0):
<s_escape_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <escape_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
lea    0xeb9(%rip),%rdx
mov    $0xb7,%ecx
call   1030 <s_internal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_escape_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <escape_string@plt>
mov    %rax,%r14
lea    0xeca(%rip),%rsi
lea    0xec7(%rip),%rdx
mov    %rbx,%rdi
mov    $0xb7,%ecx
call   1030 <s_internal@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"str\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/guicho271828/roswell/refs/heads/master/src/util_string.c\00"
define i8* @s_escape_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @escape_string(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @s_internal(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 183)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"str\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/guicho271828/roswell/refs/heads/master/src/util_string.c\00"
define i8* @s_escape_string(i8* %0) {
%2 = tail call i8* @escape_string(i8* %0)
%3 = tail call i32 @s_internal(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 183)
ret i8* %2
}
/* Variables and functions */
double regexp(char *, char *, int);
int /*<<< orphan*/ tintoi(char *);
double tineval(char *left, char *right) {
  switch (left[0]) {
  case '"':
    return regexp(left, right, 1);
  default:
    return tintoi(left) == tintoi(right);
  }
}


x86 assembly (clang, -O0):
<tineval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
sub    $0x22,%al
jne    115f <tineval+0x3f>
jmp    1143 <tineval+0x23>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1040 <regexp@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    118c <tineval+0x6c>
mov    -0x10(%rbp),%rdi
call   1030 <tintoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <tintoi@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tineval>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
cmpb   $0x22,(%rdi)
jne    113e <tineval+0x1e>
mov    %rbx,%rsi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <regexp@plt>
call   1030 <tintoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <tintoi@plt>
cmp    %eax,%ebp
je     1156 <tineval+0x36>
xorps  %xmm0,%xmm0
jmp    115e <tineval+0x3e>
movsd  0xea2(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @tineval(i8* %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
switch i32 %9, label %14 [
i32 34, label %10
]
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call double @regexp(i8* %11, i8* %12, i32 1)
store double %13, double* %3
br label %22
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = call i32 @tintoi(i8* %15)
%17 = load i8*, i8** %5
%18 = call i32 @tintoi(i8* %17)
%19 = icmp eq i32 %16, %18
%20 = zext i1 %19 to i32
%21 = sitofp i32 %20 to double
store double %21, double* %3
br label %22
22: ; preds = %14, %10
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @tineval(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 34
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call double @regexp(i8* %0, i8* %1, i32 1)
br label %12
7: ; preds = %2
%8 = tail call i32 @tintoi(i8* %0)
%9 = tail call i32 @tintoi(i8* %1)
%10 = icmp eq i32 %8, %9
%11 = uitofp i1 %10 to double
br label %12
12: ; preds = %7, %5
%13 = phi double [ %6, %5 ], [ %11, %7 ]
ret double %13
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void Pthread_mutex_unlock(pthread_mutex_t *m) {
  int rc = pthread_mutex_unlock(m);
  assert(rc == 0);
}


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

x86 assembly (clang, -O2):
<Pthread_mutex_unlock>:
push   %rax
call   1040 <pthread_mutex_unlock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @Pthread_mutex_unlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_unlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}

LLVM IR (-O2):
define void @Pthread_mutex_unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
int verifyInputNumber(int x, int *tgt) {
  if (x <= 1000 && x >= -1000) {
    *tgt = x;
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<verifyInputNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jg     113a <verifyInputNumber+0x3a>
cmpl   $0xfffffc18,-0x8(%rbp)
jl     113a <verifyInputNumber+0x3a>
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1141 <verifyInputNumber+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifyInputNumber>:
lea    0x3e8(%rdi),%ecx
xor    %eax,%eax
cmp    $0x7d0,%ecx
ja     1117 <verifyInputNumber+0x17>
mov    %edi,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @verifyInputNumber(i32 %0, i32* nocapture writeonly %1) {
%3 = add i32 %0, 1000
%4 = icmp ult i32 %3, 2001
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 %0, i32* %1
br label %6
6: ; preds = %2, %5
%7 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ do_kill();
void handler_sig_int(int sig) { do_kill(); }


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

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

LLVM IR (-O0):
define void @handler_sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @do_kill()
ret void
}

LLVM IR (-O2):
define void @handler_sig_int(i32 %0) {
%2 = tail call i32 (...) @do_kill()
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int initialize_quaddobl_homotopy(int fixed_gamma, double regamma,
                                 double imgamma) {
  int fail, *b;
  double c[2];
  c[0] = regamma;
  c[1] = imgamma;
  fail = _ada_use_c2phc4c(502, &fixed_gamma, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<initialize_quaddobl_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0x1f6,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_quaddobl_homotopy>:
sub    $0x28,%rsp
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x18(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rcx
mov    $0x1f6,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @initialize_quaddobl_homotopy(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32*
%9 = alloca [2 x double]
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%10 = load double, double* %5
%11 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
store double %10, double* %11
%12 = load double, double* %6
%13 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
store double %12, double* %13
%14 = load i32*, i32** %8
%15 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%16 = call i32 @_ada_use_c2phc4c(i32 502, i32* %4, i32* %14, double* %15, i32 0)
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @initialize_quaddobl_homotopy(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca [2 x double]
store i32 %0, i32* %4
%6 = bitcast [2 x double]* %5 to i8*
%7 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
store double %1, double* %7
%8 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
store double %2, double* %8
%9 = call i32 @_ada_use_c2phc4c(i32 502, i32* %4, i32* undef, double* %7, i32 0)
ret i32 %9
}
char *scanpast(char *mptr, int c) {
  if (!(mptr))
    return (mptr);
  while (*mptr) {
    if (*mptr == c) {
      *(mptr++) = 0;
      break;
    } else
      mptr++;
  }
  return (mptr);
}


x86 assembly (clang, -O0):
<scanpast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <scanpast+0x23>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <scanpast+0x75>
jmp    1128 <scanpast+0x28>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <scanpast+0x6d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    115c <scanpast+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
jmp    116d <scanpast+0x6d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1128 <scanpast+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanpast>:
test   %rdi,%rdi
je     1136 <scanpast+0x36>
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1135 <scanpast+0x35>
add    $0x1,%rax
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rdx,%rax
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1139 <scanpast+0x39>
movzbl (%rax),%ecx
lea    0x1(%rax),%rdx
test   %cl,%cl
jne    1120 <scanpast+0x20>
ret
xor    %eax,%eax
ret
movb   $0x0,-0x1(%rax)
ret

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

LLVM IR (-O2):
define i8* @scanpast(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4, %14
%8 = phi i8 [ %15, %14 ], [ %5, %4 ]
%9 = phi i8* [ %12, %14 ], [ %0, %4 ]
%10 = sext i8 %8 to i32
%11 = icmp eq i32 %10, %1
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %14
13: ; preds = %7
store i8 0, i8* %9
br label %17
14: ; preds = %7
%15 = load i8, i8* %12
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %14, %4, %13, %2
%18 = phi i8* [ null, %2 ], [ %12, %13 ], [ %0, %4 ], [ %12, %14 ]
ret i8* %18
}
void USB_Class_Periodic_Task(void) {}


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

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

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

LLVM IR (-O2):
define void @USB_Class_Periodic_Task() {
ret void
}
void __attribute__((noreturn)) panic(void) {
  asm volatile("cli; hlt");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
cli
hlt
jmp    1106 <panic+0x6>

x86 assembly (clang, -O2):
<panic>:
cli
hlt
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1110 <panic+0x10>

LLVM IR (-O0):
define void @panic() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @panic() {
tail call void asm sideeffect "cli; hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %1
1: ; preds = %1, %0
br label %1
}
int h1(int n) {
  if (n == 0) {
    return (0);
  }
  printf(n);
  n = n - 1;
  h1(n);
}


x86 assembly (clang, -O0):
<h1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <h1+0x21>
movl   $0x0,-0x4(%rbp)
jmp    115d <h1+0x3d>
movslq -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <h1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h1>:
push   %rbx
test   %edi,%edi
je     1132 <h1+0x22>
movslq %edi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
test   %ebx,%ebx
jne    1120 <h1+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @h1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 (i8*, ...) @printf(i8* %10)
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @h1(i32 %14)
br label %16
16: ; preds = %7, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @h1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = sext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %9, %5 ]
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 (i8*, ...) @printf(i8* %7)
%9 = add nsw i64 %6, -1
%10 = trunc i64 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("I am going to exec an 'ls' program in current process\n");
  execlp("./fork2", "./fork2", 0);
  printf("I execed 'ls' program\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf00(%rip),%rsi
xor    %edx,%edx
mov    %rsi,%rdi
call   1040 <execlp@plt>
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1040 <execlp@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"I am going to exec an 'ls' program in current process\0A\00"
@.str.1 = [8 x i8] c"./fork2\00"
@.str.2 = [23 x i8] c"I execed 'ls' program\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @execlp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"./fork2\00"
@str = [54 x i8] c"I am going to exec an 'ls' program in current process\00"
@str.3 = [22 x i8] c"I execed 'ls' program\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @execlp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int get_mdterm();
void md_draw_line_blue(int x1, int y1, int x2, int y2, int width) {
  switch (get_mdterm()) {}
}


x86 assembly (clang, -O0):
<md_draw_line_blue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
xor    %eax,%eax
call   1030 <get_mdterm@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @md_draw_line_blue(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = call i32 (...) @get_mdterm()
switch i32 %11, label %12 [
]
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @md_draw_line_blue(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (...) @get_mdterm()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ vafunction(char *, int, int, int, int, int, int, int, int,
                              int);
int main(void) {
  vafunction("", 1, 2, 3, 4, 5, 6, 7, 8, 9);
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
movl   $0x6,(%rsp)
movl   $0x7,0x8(%rsp)
movl   $0x8,0x10(%rsp)
movl   $0x9,0x18(%rsp)
call   1030 <vafunction@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
push   $0x9
push   $0x8
push   $0x7
push   $0x6
call   1030 <vafunction@plt>
add    $0x20,%rsp
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @vafunction(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @vafunction(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
%2 = tail call i32 @exit(i32 0)
unreachable
}
void fspath_print(const char path[]) {}


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

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

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

LLVM IR (-O2):
define void @fspath_print(i8* nocapture %0) {
ret void
}