xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  double tv_usec;
  double tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
void get_time__(double *sec) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  *sec = tv.tv_usec / 1000000.0 + tv.tv_sec;
}


x86 assembly (clang, -O0):
<get_time__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time__>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  (%rsp),%xmm0
divsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define void @get_time__(double* %0) {
%2 = alloca double*
%3 = alloca %struct.timeval
store double* %0, double** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%9 = load double, double* %8
%10 = fadd double %7, %9
%11 = load double*, double** %2
store double %10, double* %11
ret void
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define void @get_time__(double* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load double, double* %8
%10 = fadd double %7, %9
store double %10, double* %0
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int ext_flags;
};
typedef TYPE_1__ X509V3_EXT_METHOD;

/* Variables and functions */
int X509V3_EXT_DYNAMIC;
int /*<<< orphan*/ free(TYPE_1__ *);
void ext_list_free(X509V3_EXT_METHOD *ext) {
  if (ext->ext_flags & X509V3_EXT_DYNAMIC)
    free(ext);
}


x86 assembly (clang, -O0):
<ext_list_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2eaf(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     113d <ext_list_free+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext_list_free>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
test   %eax,(%rdi)
je     1122 <ext_list_free+0x12>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
@X509V3_EXT_DYNAMIC = global i32 0
define void @ext_list_free(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @X509V3_EXT_DYNAMIC
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%11 = call i32 @free(%struct.TYPE_4__* %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
@X509V3_EXT_DYNAMIC = global i32 0
define void @ext_list_free(%struct.TYPE_4__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @X509V3_EXT_DYNAMIC
%5 = and i32 %4, %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @free(%struct.TYPE_4__* %0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(int, char *, char *, int /*<<< orphan*/ *);
int rename(char *, char *);
void RENAME(char *x, char *y) {
  if (rename(x, y) == -1)
    fatal(1, "Cannot rename to %s", y, NULL);
}


x86 assembly (clang, -O0):
<RENAME>:
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 <rename@plt>
cmp    $0xffffffff,%eax
jne    115f <RENAME+0x3f>
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
lea    0xeaa(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RENAME>:
push   %rbx
mov    %rsi,%rbx
call   1030 <rename@plt>
cmp    $0xffffffff,%eax
je     1130 <RENAME+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
xor    %ecx,%ecx
pop    %rbx
jmp    1040 <fatal@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"Cannot rename to %s\00"
define void @RENAME(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %1, i32* null)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
unsigned int odroid_xu_gpio_read_26() {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 0;
  return (exynos_5410_gpio_read(bank_offset) >> bit_index) & 0x1;
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_read_26>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc40,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exynos_5410_gpio_read@plt>
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_read_26>:
push   %rax
mov    $0xc40,%edi
call   1030 <exynos_5410_gpio_read@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @odroid_xu_gpio_read_26() {
%1 = alloca i32
%2 = alloca i32
store i32 3136, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @exynos_5410_gpio_read(i32 %3)
%5 = load i32, i32* %2
%6 = lshr i32 %4, %5
%7 = and i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @odroid_xu_gpio_read_26() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3136)
%2 = and i32 %1, 1
ret i32 %2
}
int sign(float num) {
  if (num >= 0)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1126 <sign+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <sign+0x2d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @sign(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @sign(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = select i1 %2, i32 -1, i32 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ my_printf(char *);
int main(void) {
  my_printf("Hello World\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <my_printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @my_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = tail call i32 @my_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ StopLsof();
void LTlibClean() { (void)StopLsof(); }


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

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

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

LLVM IR (-O2):
define void @LTlibClean() {
%1 = tail call i32 (...) @StopLsof()
ret void
}
double power7n(double a, double b) { return __builtin_copysign(a, b); }


x86 assembly (clang, -O0):
<power7n>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power7n>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @power7n(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* %4
%7 = call double @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @power7n(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
__attribute__((swiftcall)) void
context_2(void *arg0, __attribute__((swift_context)) void *self) {}


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

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

LLVM IR (-O0):
define swiftcc void @context_2(i8* %0, i8* swiftself %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define swiftcc void @context_2(i8* nocapture %0, i8* nocapture swiftself %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c4(int);
void c3(int n) { c4(n); }


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

x86 assembly (clang, -O2):
<c3>:
jmp    1030 <c4@plt>

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

LLVM IR (-O2):
define void @c3(i32 %0) {
%2 = tail call i32 @c4(i32 %0)
ret void
}
void gtk_accel_map_foreach_unfiltered() {}


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

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

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

LLVM IR (-O2):
define void @gtk_accel_map_foreach_unfiltered() {
ret void
}
/* Variables and functions */
float fmaxf(float, float);
float distance_intersection(float d1, float d2) { return fmaxf(d1, d2); }


x86 assembly (clang, -O0):
<distance_intersection>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_intersection>:
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
maxss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @distance_intersection(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.maxnum.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @distance_intersection(float %0, float %1) {
%3 = tail call float @llvm.maxnum.f32(float %0, float %1)
ret float %3
}
int fun873() { return 873; }


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

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

LLVM IR (-O0):
define i32 @fun873() {
ret i32 873
}

LLVM IR (-O2):
define i32 @fun873() {
ret i32 873
}
int close(int file) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
ret i32 -1
}
long long GetN() { return 10000LL; }


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

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

LLVM IR (-O0):
define i64 @GetN() {
ret i64 10000
}

LLVM IR (-O2):
define i64 @GetN() {
ret i64 10000
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int write(int, char *, int);
void close_connection(int request) {
  if ((write(request, "Connection: close\n", sizeof("Connection: close\n"))) ==
      -1) {
    printf("Failed to send Connection: close");
  } else {
    printf("Close connection.");
  }
}


x86 assembly (clang, -O0):
<close_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
mov    $0x13,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1159 <close_connection+0x39>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
jmp    1165 <close_connection+0x45>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_connection>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x13,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
lea    0xed7(%rip),%rax
lea    0xef1(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Connection: close\0A\00"
@.str.1 = [33 x i8] c"Failed to send Connection: close\00"
@.str.2 = [18 x i8] c"Close connection.\00"
define void @close_connection(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 19)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Connection: close\0A\00"
@.str.1 = [33 x i8] c"Failed to send Connection: close\00"
@.str.2 = [18 x i8] c"Close connection.\00"
define void @close_connection(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 19)
%3 = icmp eq i32 %2, -1
%4 = select i1 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_nextPut(char);
void console_nextPutAll(char *s) {
  char ch;
  while ((ch = *(s++)) != 0) {
    console_nextPut(ch);
  }
  return;
}


x86 assembly (clang, -O0):
<console_nextPutAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114a <console_nextPutAll+0x3a>
movsbl -0x9(%rbp),%edi
call   1030 <console_nextPut@plt>
jmp    111c <console_nextPutAll+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_nextPutAll>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <console_nextPutAll+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <console_nextPut@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <console_nextPutAll+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @console_nextPutAll(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @console_nextPut(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
unsigned long getSoftDataLimit(void) { return ((unsigned long)67108864); }


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

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

LLVM IR (-O0):
define i64 @getSoftDataLimit() {
ret i64 67108864
}

LLVM IR (-O2):
define i64 @getSoftDataLimit() {
ret i64 67108864
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Looping\n");
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [9 x i8] c"Looping\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@str = [8 x i8] c"Looping\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ console_buffer_open();
int /*<<< orphan*/ editor_disable_raw_mode();
int /*<<< orphan*/ editor_enable_raw_mode();
int /*<<< orphan*/ editor_refresh_screen();
void editor_handle_sigcont(int unused __attribute__((unused))) {
  editor_disable_raw_mode();
  console_buffer_open();
  editor_enable_raw_mode();
  editor_refresh_screen();
}


x86 assembly (clang, -O0):
<editor_handle_sigcont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <editor_disable_raw_mode@plt>
mov    $0x0,%al
call   1050 <console_buffer_open@plt>
mov    $0x0,%al
call   1040 <editor_enable_raw_mode@plt>
mov    $0x0,%al
call   1030 <editor_refresh_screen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<editor_handle_sigcont>:
push   %rax
xor    %eax,%eax
call   1060 <editor_disable_raw_mode@plt>
xor    %eax,%eax
call   1050 <console_buffer_open@plt>
xor    %eax,%eax
call   1040 <editor_enable_raw_mode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <editor_refresh_screen@plt>

LLVM IR (-O0):
define void @editor_handle_sigcont(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @editor_disable_raw_mode()
%4 = call i32 (...) @console_buffer_open()
%5 = call i32 (...) @editor_enable_raw_mode()
%6 = call i32 (...) @editor_refresh_screen()
ret void
}

LLVM IR (-O2):
define void @editor_handle_sigcont(i32 %0) {
%2 = tail call i32 (...) @editor_disable_raw_mode()
%3 = tail call i32 (...) @console_buffer_open()
%4 = tail call i32 (...) @editor_enable_raw_mode()
%5 = tail call i32 (...) @editor_refresh_screen()
ret void
}
/* Variables and functions */
int getuid();
geteuid() { return ((getuid() >> 8) & 0377); }


x86 assembly (clang, -O0):
<geteuid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getuid@plt>
sar    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<geteuid>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
movzbl %ah,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @geteuid() {
%1 = call i32 (...) @getuid()
%2 = ashr i32 %1, 8
%3 = and i32 %2, 255
ret i32 %3
}

LLVM IR (-O2):
define i32 @geteuid() {
%1 = tail call i32 (...) @getuid()
%2 = lshr i32 %1, 8
%3 = and i32 %2, 255
ret i32 %3
}
void window_map_emptysub() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @av_bsf_alloc() {
ret void
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  unsigned long long flags;
  int /*<<< orphan*/ value;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_UPDATE_ELEM;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_update_elem(int fd, void *key, void *value, unsigned long long flags) {
  union bpf_attr attr = {
      .map_fd = fd,
      .key = ptr_to_u64(key),
      .value = ptr_to_u64(value),
      .flags = flags,
  };
  return syscall(321, BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_update_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x28(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_update_elem>:
push   %rax
mov    %rcx,(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x141,%edi
mov    $0x8,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i64 }
@BPF_MAP_UPDATE_ELEM = global i32 0
define i32 @bpf_update_elem(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca %union.bpf_attr
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = bitcast %union.bpf_attr* %9 to i64*
%11 = load i64, i64* %8
store i64 %11, i64* %10
%12 = load i32, i32* @BPF_MAP_UPDATE_ELEM
%13 = call i32 @syscall(i32 321, i32 %12, %union.bpf_attr* %9, i32 8)
ret i32 %13
}

LLVM IR (-O2):
%union.bpf_attr = type { i64 }
@BPF_MAP_UPDATE_ELEM = global i32 0
define i32 @bpf_update_elem(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
%5 = alloca %union.bpf_attr
%6 = bitcast %union.bpf_attr* %5 to i8*
%7 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %5, i64 0, i32 0
store i64 %3, i64* %7
%8 = load i32, i32* @BPF_MAP_UPDATE_ELEM
%9 = call i32 @syscall(i32 321, i32 %8, %union.bpf_attr* %5, i32 8)
ret i32 %9
}
/* Variables and functions */
int dr_get_worker_id_by_pthread_key();
int dr_tbb_get_worker() { return dr_get_worker_id_by_pthread_key(); }


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

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

LLVM IR (-O0):
define i32 @dr_tbb_get_worker() {
%1 = call i32 (...) @dr_get_worker_id_by_pthread_key()
ret i32 %1
}

LLVM IR (-O2):
define i32 @dr_tbb_get_worker() {
%1 = tail call i32 (...) @dr_get_worker_id_by_pthread_key()
ret i32 %1
}
int test_imm_B5uint8_mem(unsigned char *val) {
  return ((*val) & (-0xB5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B5uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 75
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int isSpecial(int c) {
  int p;
  extern char *SPECIAL_CHARS;
  for (p = 0; SPECIAL_CHARS[p] != '\0'; ++p) {
    if (SPECIAL_CHARS[p] == c)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isSpecial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1163 <isSpecial+0x63>
mov    0x2eb0(%rip),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0x8(%rbp),%eax
jne    1150 <isSpecial+0x50>
movl   $0x1,-0x4(%rbp)
jmp    116a <isSpecial+0x6a>
jmp    1155 <isSpecial+0x55>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isSpecial+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSpecial>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rcx
mov    (%rcx),%dl
xor    %eax,%eax
test   %dl,%dl
je     1132 <isSpecial+0x32>
add    $0x1,%rcx
cs nopw 0x0(%rax,%rax,1)
movsbl %dl,%edx
cmp    %edi,%edx
je     1133 <isSpecial+0x33>
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <isSpecial+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
@SPECIAL_CHARS = external global i8*
define i32 @isSpecial(i32 %0) {
%2 = load i8*, i8** @SPECIAL_CHARS
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %2, i64 %14
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %1, %5
%10 = phi i64 [ %14, %5 ], [ 0, %1 ]
%11 = phi i8 [ %7, %5 ], [ %3, %1 ]
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, %0
%14 = add nuw i64 %10, 1
br i1 %13, label %15, label %5
15: ; preds = %9, %5, %1
%16 = phi i32 [ 0, %1 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putchar_fd(char c, int fd) { write(fd, &c, sizeof(char)); }


x86 assembly (clang, -O0):
<ft_putchar_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar_fd>:
push   %rax
mov    %esi,%eax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ft_putchar_fd(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @write(i32 %5, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @ft_putchar_fd(i8 signext %0, i32 %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @write(i32 %1, i8* %3, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
void read_til_crnl(FILE *fp) {
  char buf[1024];
  while (fgets(buf, 1024, fp) != NULL && strcmp(buf, "\r\n") != 0)
    continue;
}


x86 assembly (clang, -O0):
<read_til_crnl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1030 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x411(%rbp)
je     1179 <read_til_crnl+0x59>
lea    -0x410(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x411(%rbp)
mov    -0x411(%rbp),%al
test   $0x1,%al
jne    118c <read_til_crnl+0x6c>
jmp    1191 <read_til_crnl+0x71>
jmp    112f <read_til_crnl+0xf>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_til_crnl>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
lea    0xec7(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     1165 <read_til_crnl+0x45>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1140 <read_til_crnl+0x20>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @read_til_crnl(i32* %0) {
%2 = alloca i32*
%3 = alloca [1024 x i8]
store i32* %0, i32** %2
br label %4
4: ; preds = %15, %1
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = load i32*, i32** %2
%7 = call i32* @fgets(i8* %5, i32 1024, i32* %6)
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %9, %4
%14 = phi i1 [ false, %4 ], [ %12, %9 ]
br i1 %14, label %15, label %16
15: ; preds = %13
br label %4
16: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @read_til_crnl(i32* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %7, %1
%5 = call i32* @fgets(i8* %3, i32 1024, i32* %0)
%6 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UI_MainMenu();
void UI_BotSelectMenu_MainMenuEvent(void *ptr, int event) {
  if (event != 3) {
    return;
  }
  UI_MainMenu();
}


x86 assembly (clang, -O0):
<UI_BotSelectMenu_MainMenuEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
je     112e <UI_BotSelectMenu_MainMenuEvent+0x1e>
jmp    1135 <UI_BotSelectMenu_MainMenuEvent+0x25>
mov    $0x0,%al
call   1030 <UI_MainMenu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_BotSelectMenu_MainMenuEvent>:
cmp    $0x3,%esi
jne    111c <UI_BotSelectMenu_MainMenuEvent+0xc>
xor    %eax,%eax
jmp    1030 <UI_MainMenu@plt>
ret

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

LLVM IR (-O2):
define void @UI_BotSelectMenu_MainMenuEvent(i8* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @UI_MainMenu()
br label %6
6: ; preds = %2, %4
ret void
}
int readLabelingSettings() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @readLabelingSettings() {
ret i32 0
}
int leap_year_p(y)
long y;
{ return ((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0); }


x86 assembly (clang, -O0):
<leap_year_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    113d <leap_year_p+0x3d>
mov    -0x8(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    $0x1,%al
cmp    $0x0,%rdx
mov    %al,-0x9(%rbp)
jne    1155 <leap_year_p+0x55>
mov    -0x8(%rbp),%rax
mov    $0x190,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leap_year_p>:
movabs $0xa3d70a3d70a3d70b,%rcx
0a d7 a3
mov    %rdi,%rax
imul   %rcx
test   $0x3,%dil
jne    1139 <leap_year_p+0x39>
add    %rdi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x6,%rdx
add    %rax,%rdx
imul   $0x64,%rdx,%rcx
mov    %rdi,%rdx
mov    $0x1,%eax
sub    %rcx,%rdx
je     1139 <leap_year_p+0x39>
ret
movabs $0x8f5c28f5c28f5c29,%rax
28 5c 8f
imul   %rax,%rdi
movabs $0x51eb851eb851eb0,%rcx
b8 1e 05
add    %rdi,%rcx
ror    $0x4,%rcx
movabs $0xa3d70a3d70a3d7,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
setb   %al
ret

LLVM IR (-O0):
define i32 @leap_year_p(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = srem i64 %3, 4
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %2
%8 = srem i64 %7, 100
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i64, i64* %2
%12 = srem i64 %11, 400
%13 = icmp eq i64 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @leap_year_p(i64 %0) {
%2 = and i64 %0, 3
%3 = icmp ne i64 %2, 0
%4 = srem i64 %0, 100
%5 = icmp eq i64 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i64 %0, 400
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int ar[], int size) {
  for (int i = 0; i < size; i++) {
    printf("%d ", ar[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(void) {
  printf(
      "Usage:\t%s [options] <command> [<args>]\nOptions:\n\t-h\tPrints the "
      "help synopsis.\n\t-v\tPrints the version "
      "number.\n\nCommands:\n\tget\tExtract a field from a data "
      "file.\n\tngrams\tCompute token n-gram frequencies.\n\tscan\tDetermine "
      "the schema of a data file.\n\tsentences\tSegment text into "
      "sentences.\n\ttokens\tSegment text into tokens.\n",
      "corpus");
}


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

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

LLVM IR (-O0):
@.str = [319 x i8] c"Usage:\09%s [options] <command> [<args>]\0AOptions:\0A\09-h\09Prints the help synopsis.\0A\09-v\09Prints the version number.\0A\0ACommands:\0A\09get\09Extract a field from a data file.\0A\09ngrams\09Compute token n-gram frequencies.\0A\09scan\09Determine the schema of a data file.\0A\09sentences\09Segment text into sentences.\0A\09tokens\09Segment text into tokens.\0A\00"
@.str.1 = [7 x i8] c"corpus\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([319 x i8], [319 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [319 x i8] c"Usage:\09%s [options] <command> [<args>]\0AOptions:\0A\09-h\09Prints the help synopsis.\0A\09-v\09Prints the version number.\0A\0ACommands:\0A\09get\09Extract a field from a data file.\0A\09ngrams\09Compute token n-gram frequencies.\0A\09scan\09Determine the schema of a data file.\0A\09sentences\09Segment text into sentences.\0A\09tokens\09Segment text into tokens.\0A\00"
@.str.1 = [7 x i8] c"corpus\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([319 x i8], [319 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i = 32;
  while (i < 127) {
    printf("%3d = %c\n", i, i);
    ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x20,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x7f,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%3d = %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 32, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 127
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%3d = %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 32, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 127
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int cycle_is_check_border_r(unsigned int flags, int csel) {
  if (flags & 0x40000000) {
    return (flags & 0x20000000) ? csel : !csel;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cycle_is_check_border_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x40000000,%eax
cmp    $0x0,%eax
je     1153 <cycle_is_check_border_r+0x53>
mov    -0x8(%rbp),%eax
and    $0x20000000,%eax
cmp    $0x0,%eax
je     1137 <cycle_is_check_border_r+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <cycle_is_check_border_r+0x48>
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <cycle_is_check_border_r+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_is_check_border_r>:
xor    %eax,%eax
test   $0x40000000,%edi
je     111a <cycle_is_check_border_r+0x1a>
xor    %eax,%eax
test   %esi,%esi
sete   %al
test   $0x20000000,%edi
cmovne %esi,%eax
ret

LLVM IR (-O0):
define i32 @cycle_is_check_border_r(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 = and i32 %6, 1073741824
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %2
%10 = load i32, i32* %4
%11 = and i32 %10, 536870912
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i32, i32* %5
br label %20
15: ; preds = %9
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %15, %13
%21 = phi i32 [ %14, %13 ], [ %19, %15 ]
store i32 %21, i32* %3
br label %23
22: ; preds = %2
store i32 0, i32* %3
br label %23
23: ; preds = %22, %20
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @cycle_is_check_border_r(i32 %0, i32 %1) {
%3 = and i32 %0, 1073741824
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = and i32 %0, 536870912
%7 = icmp eq i32 %6, 0
%8 = icmp eq i32 %1, 0
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 %9, i32 %1
br label %11
11: ; preds = %2, %5
%12 = phi i32 [ %10, %5 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main() {
  char *p;
  p = (char *)malloc(19);
  p = (char *)malloc(12);
  free(p);
  p = (char *)malloc(16);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x13,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x13,%edi
call   1040 <malloc@plt>
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    $0x10,%edi
call   1040 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 19)
%2 = tail call i64 @malloc(i32 12)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @free(i8* %3)
%5 = tail call i64 @malloc(i32 16)
ret i32 0
}
/* Variables and functions */
int close(int);
int xattrkv_close(int db) { return close(db); }


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

x86 assembly (clang, -O2):
<xattrkv_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @xattrkv_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int small_strlen(const char *str) {
  const char *p = str;
  while (*p)
    p++;
  return p - str;
}


x86 assembly (clang, -O0):
<small_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <small_strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <small_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<small_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <small_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @small_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}