xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SNetMemFree(void *ptr) {
  free(ptr);
  ptr = NULL;
}


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

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

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

LLVM IR (-O2):
define void @SNetMemFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int const, char const *, size_t const);
void write_to_file(const int fd_target, const char *read_buf,
                   const size_t len) {
  write(fd_target, read_buf, len);
}


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

x86 assembly (clang, -O2):
<write_to_file>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @write_to_file(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret void
}
void pcp_def_net_ip_metrics(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void printUsage(FILE *stream) {
  fprintf(stream, "Usage: backly [options] <srcdir> <destdir>\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x2b,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: backly [options] <srcdir> <destdir>\0A\00"
define void @printUsage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Usage: backly [options] <srcdir> <destdir>\0A\00"
define void @printUsage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 43, i64 1, i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ isblank(char);
int poe_iswhitespace(char c) { return isblank(c) || c == '\n' || c == '\r'; }


x86 assembly (clang, -O0):
<poe_iswhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isblank@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1158 <poe_iswhitespace+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1158 <poe_iswhitespace+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poe_iswhitespace>:
push   %rbx
mov    %edi,%ebx
call   1030 <isblank@plt>
test   %rax,%rax
setne  %al
cmp    $0xa,%bl
sete   %cl
cmp    $0xd,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @poe_iswhitespace(i8 signext %0) {
%2 = tail call i64 @isblank(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 10
%5 = or i1 %4, %3
%6 = icmp eq i8 %0, 13
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ beginningz(float, float, float, float, int);
scalar_t__ powf(int /*<<< orphan*/, float);
float sin(float);
float sqrtf(scalar_t__);
float beginningy(float cosqr, float a, float alpha, float A, int r) {
  return sin(alpha) * sqrtf(1 - powf(beginningz(cosqr, a, alpha, A, r), 2.0f));
}


x86 assembly (clang, -O0):
<beginningy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <sin@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
mov    -0x14(%rbp),%edi
call   1030 <beginningz@plt>
mov    %eax,%edi
movss  0xe6c(%rip),%xmm0
call   1040 <powf@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1060 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beginningy>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movss  %xmm3,0x18(%rsp)
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
movaps %xmm2,%xmm0
call   1050 <sin@plt>
movss  %xmm0,0x1c(%rsp)
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
movss  0x18(%rsp),%xmm3
mov    %ebx,%edi
call   1030 <beginningz@plt>
movss  0xe6c(%rip),%xmm0
mov    %eax,%edi
call   1040 <powf@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1060 <sqrtf@plt>
mulss  0x1c(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @beginningy(float %0, float %1, float %2, float %3, i32 %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i32
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store i32 %4, i32* %10
%11 = load float, float* %8
%12 = call float @sin(float %11)
%13 = load float, float* %6
%14 = load float, float* %7
%15 = load float, float* %8
%16 = load float, float* %9
%17 = load i32, i32* %10
%18 = call i32 @beginningz(float %13, float %14, float %15, float %16, i32 %17)
%19 = call i64 @powf(i32 %18, float 2.000000e+00)
%20 = sub nsw i64 1, %19
%21 = call float @sqrtf(i64 %20)
%22 = fmul float %12, %21
ret float %22
}

LLVM IR (-O2):
define float @beginningy(float %0, float %1, float %2, float %3, i32 %4) {
%6 = tail call float @sin(float %2)
%7 = tail call i32 @beginningz(float %0, float %1, float %2, float %3, i32 %4)
%8 = tail call i64 @powf(i32 %7, float 2.000000e+00)
%9 = sub nsw i64 1, %8
%10 = tail call float @sqrtf(i64 %9)
%11 = fmul float %6, %10
ret float %11
}
double inverse(const double a) {
  if (a == 0)
    return 0;
  return 1.0 / a;
}


x86 assembly (clang, -O0):
<inverse>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112e <inverse+0x2e>
jp     112e <inverse+0x2e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1140 <inverse+0x40>
movsd  0xeca(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1111 <inverse+0x11>
jp     1111 <inverse+0x11>
ret
movsd  0xee7(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @inverse(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %3
%9 = fdiv double 1.000000e+00, %8
store double %9, double* %2
br label %10
10: ; preds = %7, %6
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @inverse(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = fdiv double 1.000000e+00, %0
%4 = select i1 %2, double 0.000000e+00, double %3
ret double %4
}
int ls_cost_nm8_n_in(void) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @ls_cost_nm8_n_in() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ off(int);
int /*<<< orphan*/ on(int);
void pulse(int pin) {
  on(pin);
  off(pin);
}


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

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

LLVM IR (-O0):
define void @pulse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @on(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @off(i32 %5)
ret void
}

LLVM IR (-O2):
define void @pulse(i32 %0) {
%2 = tail call i32 @on(i32 %0)
%3 = tail call i32 @off(i32 %0)
ret void
}
void setup_arch_fast_hash(struct fast_hash_ops *ops) {}


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

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

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

LLVM IR (-O2):
%struct.fast_hash_ops = type opaque
define void @setup_arch_fast_hash(%struct.fast_hash_ops* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m_buf(int);
int m_create(int /*<<< orphan*/, int);
int /*<<< orphan*/ m_len(int);
int /*<<< orphan*/ m_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int s_dub(int m) {
  int x = m_create(m_len(m), 1);
  m_write(x, 0, m_buf(m), m_len(m));
  return x;
}


x86 assembly (clang, -O0):
<s_dub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <m_len@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1050 <m_create@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <m_buf@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <m_len@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
xor    %esi,%esi
call   1060 <m_write@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_dub>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <m_len@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1050 <m_create@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <m_buf@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <m_len@plt>
mov    %ebp,%edi
xor    %esi,%esi
mov    %r14d,%edx
mov    %eax,%ecx
call   1060 <m_write@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @s_dub(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @m_len(i32 %4)
%6 = call i32 @m_create(i32 %5, i32 1)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @m_buf(i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @m_len(i32 %10)
%12 = call i32 @m_write(i32 %7, i32 0, i32 %9, i32 %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @s_dub(i32 %0) {
%2 = tail call i32 @m_len(i32 %0)
%3 = tail call i32 @m_create(i32 %2, i32 1)
%4 = tail call i32 @m_buf(i32 %0)
%5 = tail call i32 @m_len(i32 %0)
%6 = tail call i32 @m_write(i32 %3, i32 0, i32 %4, i32 %5)
ret i32 %3
}
long double add_ld(long double a, long double b) { return a + b; }


x86 assembly (clang, -O0):
<add_ld>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_ld>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @add_ld(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fadd x86_fp80 %5, %6
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @add_ld(x86_fp80 %0, x86_fp80 %1) {
%3 = fadd x86_fp80 %0, %1
ret x86_fp80 %3
}
double cos(double x) {
  __asm__("fcos" : "+t"(x));
  return x;
}


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
fldl   -0x10(%rbp)
fcos
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fcos
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double asm "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %3)
store double %4, double* %2
%5 = load double, double* %2
ret double %5
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = tail call double asm "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
float mycalc(float a, float b) {
  float c;
  c = a - b;
  return c;
}


x86 assembly (clang, -O0):
<mycalc>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycalc>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mycalc(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fsub float %6, %7
store float %8, float* %5
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @mycalc(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
uint8_t clampTo8(int32_t i) { return i < 0 ? 0 : (i > 255 ? 255 : i); }


x86 assembly (clang, -O0):
<clampTo8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <clampTo8+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <clampTo8+0x41>
cmpl   $0xff,-0x4(%rbp)
jle    1135 <clampTo8+0x35>
mov    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <clampTo8+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampTo8>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @clampTo8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 255
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 255, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi i32 [ 0, %5 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @clampTo8(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vscanf(char *, int /*<<< orphan*/);
void uninitvar_vscanf(void) {
  char *format;
  va_list arg;
  (void)vscanf(format, arg);
}


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

x86 assembly (clang, -O2):
<uninitvar_vscanf>:
jmp    1030 <vscanf@plt>

LLVM IR (-O0):
define void @uninitvar_vscanf() {
%1 = alloca i8*
%2 = alloca i32
%3 = load i8*, i8** %1
%4 = load i32, i32* %2
%5 = call i32 @vscanf(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_vscanf() {
%1 = tail call i32 @vscanf(i8* undef, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_XCHG();
void do0xEB() { _I8080_XCHG(); }


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

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

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

LLVM IR (-O2):
define void @do0xEB() {
%1 = tail call i32 (...) @_I8080_XCHG()
ret void
}
/* Variables and functions */
int check(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c[1000];
  int a;
  printf("Enter text:\n");
  scanf("%s", c);
  a = check(c);
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
call   1050 <check@plt>
mov    %eax,-0x3f4(%rbp)
mov    -0x3f4(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xea5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1060 <check@plt>
lea    0xe8e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Enter text:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%7 = call i32 @check(i8* %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [12 x i8] c"Enter text:\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @check(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
int Cin_OGM_Run(int time) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Cin_OGM_Run(i32 %0) {
ret i32 1
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _free_r(struct _reent *, void *);
void *_realloc_r(struct _reent *, void *, size_t);
void *_reallocf_r(struct _reent *reentptr, void *ptr, size_t size) {
  void *nptr;
  nptr = _realloc_r(reentptr, ptr, size);
  if (!nptr && ptr)
    _free_r(reentptr, ptr);
  return (nptr);
}


x86 assembly (clang, -O0):
<_reallocf_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <_realloc_r@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116c <_reallocf_r+0x4c>
cmpq   $0x0,-0x10(%rbp)
je     116c <_reallocf_r+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_free_r@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_reallocf_r>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <_realloc_r@plt>
mov    %rax,%r15
test   %rbx,%rbx
je     1148 <_reallocf_r+0x28>
test   %r15,%r15
jne    1148 <_reallocf_r+0x28>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <_free_r@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct._reent = type { i32 }
define i8* @_reallocf_r(%struct._reent* %0, i8* %1, i64 %2) {
%4 = alloca %struct._reent*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct._reent* %0, %struct._reent** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load %struct._reent*, %struct._reent** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @_realloc_r(%struct._reent* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %21, label %14
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load %struct._reent*, %struct._reent** %4
%19 = load i8*, i8** %5
%20 = call i32 @_free_r(%struct._reent* %18, i8* %19)
br label %21
21: ; preds = %17, %14, %3
%22 = load i8*, i8** %7
ret i8* %22
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i8* @_reallocf_r(%struct._reent* %0, i8* %1, i64 %2) {
%4 = tail call i8* @_realloc_r(%struct._reent* %0, i8* %1, i64 %2)
%5 = icmp eq i8* %4, null
%6 = icmp ne i8* %1, null
%7 = and i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @_free_r(%struct._reent* %0, i8* %1)
br label %10
10: ; preds = %8, %3
ret i8* %4
}
/* Variables and functions */
int getchar();
void read_into_array(char a[]) {
  int c = getchar();
  int i = 0;
  while (c != '\n') {
    a[i] = c;
    c = getchar();
    i++;
  }
}


x86 assembly (clang, -O0):
<read_into_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0xc(%rbp)
je     115f <read_into_array+0x4f>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <read_into_array+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_into_array>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1132 <read_into_array+0x22>
mov    %al,(%rbx)
xor    %eax,%eax
call   1030 <getchar@plt>
add    $0x1,%rbx
cmp    $0xa,%eax
jne    1120 <read_into_array+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @read_into_array(i8* nocapture writeonly %0) {
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 10
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i32 [ %9, %4 ], [ %2, %1 ]
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %7, i8* %8
%9 = tail call i32 (...) @getchar()
%10 = add nuw i64 %5, 1
%11 = icmp eq i32 %9, 10
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ ERR_peek_last_error();
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int /*<<< orphan*/ stderr;
void error_queue(const char *name, int pid) {
  if (ERR_peek_last_error()) {
    fprintf(stderr, "pid %d: %s generated errors:\n", pid, name);
    ERR_print_errors_fp(stderr);
  }
}


x86 assembly (clang, -O0):
<error_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <ERR_peek_last_error@plt>
cmp    $0x0,%rax
je     117a <error_queue+0x4a>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <ERR_print_errors_fp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_queue>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <ERR_peek_last_error@plt>
test   %rax,%rax
je     116c <error_queue+0x3c>
mov    0x2e94(%rip),%r14
mov    (%r14),%edi
lea    0xeaa(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
mov    (%r14),%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <ERR_print_errors_fp@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"pid %d: %s generated errors:\0A\00"
define void @error_queue(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i64 (...) @ERR_peek_last_error()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i32, i32* %4
%10 = load i8*, i8** %3
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
%12 = load i32, i32* @stderr
%13 = call i32 @ERR_print_errors_fp(i32 %12)
br label %14
14: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"pid %d: %s generated errors:\0A\00"
define void @error_queue(i8* %0, i32 %1) {
%3 = tail call i64 (...) @ERR_peek_last_error()
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%8 = load i32, i32* @stderr
%9 = tail call i32 @ERR_print_errors_fp(i32 %8)
br label %10
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  double s, t = 0;
  for (s = 1; s <= 100.0; s++) {
    t += 1 / s;
  }
  printf("%.2f\n", t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1175 <main+0x65>
movsd  0xeb1(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe9a(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1134 <main+0x24>
movsd  -0x18(%rbp),%xmm0
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm1
xorpd  %xmm0,%xmm0
mov    $0x2,%eax
movsd  0xede(%rip),%xmm2
movapd %xmm1,%xmm3
xchg   %ax,%ax
movapd %xmm1,%xmm4
divsd  %xmm3,%xmm4
addsd  %xmm0,%xmm4
xorps  %xmm5,%xmm5
cvtsi2sd %eax,%xmm5
movapd %xmm1,%xmm0
divsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
addsd  %xmm2,%xmm3
add    $0x2,%eax
cmp    $0x66,%eax
jne    1130 <main+0x20>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %3
store double 1.000000e+00, double* %2
br label %4
4: ; preds = %12, %0
%5 = load double, double* %2
%6 = fcmp ole double %5, 1.000000e+02
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load double, double* %2
%9 = fdiv double 1.000000e+00, %8
%10 = load double, double* %3
%11 = fadd double %10, %9
store double %11, double* %3
br label %12
12: ; preds = %7
%13 = load double, double* %2
%14 = fadd double %13, 1.000000e+00
store double %14, double* %2
br label %4
15: ; preds = %4
%16 = load double, double* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi double [ 0.000000e+00, %0 ], [ %10, %1 ]
%3 = phi i32 [ 1, %0 ], [ %11, %1 ]
%4 = sitofp i32 %3 to double
%5 = fdiv double 1.000000e+00, %4
%6 = fadd double %2, %5
%7 = add nuw nsw i32 %3, 1
%8 = sitofp i32 %7 to double
%9 = fdiv double 1.000000e+00, %8
%10 = fadd double %6, %9
%11 = add nuw nsw i32 %3, 2
%12 = icmp eq i32 %11, 101
br i1 %12, label %13, label %1
13: ; preds = %1
%14 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}
/* Variables and functions */
double log(int);
double ustar2(double u200, double z0m, double psim200) {
  return (0.41 * u200 / (log(200 / z0m) - psim200));
}


x86 assembly (clang, -O0):
<ustar2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed9(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xebf(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustar2>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
mulsd  0xede(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xed8(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
subsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ustar2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fmul double 4.100000e-01, %7
%9 = load double, double* %5
%10 = fdiv double 2.000000e+02, %9
%11 = fptosi double %10 to i32
%12 = call double @log(i32 %11)
%13 = load double, double* %6
%14 = fsub double %12, %13
%15 = fdiv double %8, %14
ret double %15
}

LLVM IR (-O2):
define double @ustar2(double %0, double %1, double %2) {
%4 = fmul double %0, 4.100000e-01
%5 = fdiv double 2.000000e+02, %1
%6 = fptosi double %5 to i32
%7 = tail call double @log(i32 %6)
%8 = fsub double %7, %2
%9 = fdiv double %4, %8
ret double %9
}
int main() {
  union {
    void *p0;
    struct {
      char c[2];
      int *p1;
      int *p2;
    } str;
  } data;
  data.p0 = malloc(37U);
  if (__VERIFIER_nondet_int()) {
    data.str.p2 = 20;
  } else {
    data.str.p2 = 30;
  }
  if (25 > data.str.p2) {
    data.str.c[1] = sizeof data.str.p1;
  }
  free(data.p0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x25,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     116b <main+0x3b>
mov    $0x14,%eax
mov    %rax,-0x10(%rbp)
jmp    1174 <main+0x44>
mov    $0x1e,%eax
mov    %rax,-0x10(%rbp)
mov    $0x19,%eax
cmp    -0x10(%rbp),%rax
jbe    1187 <main+0x57>
movb   $0x8,-0x1f(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x25,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %rbx,%rdi
and    $0xffffffffffff00ff,%rdi
or     $0x800,%rdi
test   %eax,%eax
cmove  %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%union.anon = type { %struct.anon }
%struct.anon = type { [2 x i8], i32*, i32* }
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = call i8* @malloc(i64 37)
%4 = bitcast %union.anon* %2 to i8**
store i8* %3, i8** %4
%5 = call i32 (...) @__VERIFIER_nondet_int()
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = bitcast %union.anon* %2 to %struct.anon*
%9 = getelementptr inbounds %struct.anon, %struct.anon* %8, i32 0, i32 2
store i32* inttoptr (i64 20 to i32*), i32** %9
br label %13
10: ; preds = %0
%11 = bitcast %union.anon* %2 to %struct.anon*
%12 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 2
store i32* inttoptr (i64 30 to i32*), i32** %12
br label %13
13: ; preds = %10, %7
%14 = bitcast %union.anon* %2 to %struct.anon*
%15 = getelementptr inbounds %struct.anon, %struct.anon* %14, i32 0, i32 2
%16 = load i32*, i32** %15
%17 = icmp ugt i32* inttoptr (i64 25 to i32*), %16
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = bitcast %union.anon* %2 to %struct.anon*
%20 = getelementptr inbounds %struct.anon, %struct.anon* %19, i32 0, i32 0
%21 = getelementptr inbounds [2 x i8], [2 x i8]* %20, i64 0, i64 1
store i8 8, i8* %21
br label %22
22: ; preds = %18, %13
%23 = bitcast %union.anon* %2 to i8**
%24 = load i8*, i8** %23
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(37) i8* @malloc(i64 37)
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, 0
%4 = ptrtoint i8* %1 to i64
%5 = and i64 %4, -65281
%6 = or i64 %5, 2048
%7 = inttoptr i64 %6 to i8*
%8 = select i1 %3, i8* %1, i8* %7
tail call void @free(i8* %8)
ret i32 0
}
void gtk_toolbar_set_orientation() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_set_orientation() {
ret void
}
int sys$cancel(unsigned short int chan) {
  return ({
    unsigned long resultvar;
    register long int _a1 asm("rdi") = (long)((int)chan);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(105), "r"(_a1)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$cancel>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x69,%rax
int    $0x81
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$cancel>:
mov    %edi,%edi
mov    $0x69,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$cancel"(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i16 %0, i16* %2
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 105, i64 %9)
store i64 %10, i64* %3
%11 = load i64, i64* %3
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @"sys$cancel"(i16 zeroext %0) {
%2 = zext i16 %0 to i64
%3 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 105, i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
void output(int i, double t) {}


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

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

LLVM IR (-O0):
define void @output(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
define void @output(i32 %0, double %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cg_queue_put(void *, void *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *cg_producer(void *queue) {
  for (long i = 0; i < 5000000; ++i)
    cg_queue_put(queue, (void *)1);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<cg_producer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x4c4b40,-0x18(%rbp)
jge    1161 <cg_producer+0x41>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <cg_queue_put@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <cg_producer+0x14>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cg_producer>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x4c4b40,%ebx
nopl   0x0(%rax)
mov    $0x1,%esi
mov    %r14,%rdi
call   1040 <cg_queue_put@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <cg_producer+0x10>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @cg_producer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 0, i64* %4
br label %5
5: ; preds = %11, %1
%6 = load i64, i64* %4
%7 = icmp slt i64 %6, 5000000
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = call i32 @cg_queue_put(i8* %9, i8* inttoptr (i64 1 to i8*))
br label %11
11: ; preds = %8
%12 = load i64, i64* %4
%13 = add nsw i64 %12, 1
store i64 %13, i64* %4
br label %5
14: ; preds = %5
%15 = call i32 @pthread_exit(i32* null)
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @cg_producer(i8* %0) {
br label %4
2: ; preds = %4
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %7, %4 ]
%6 = tail call i32 @cg_queue_put(i8* %0, i8* inttoptr (i64 1 to i8*))
%7 = add nuw nsw i64 %5, 1
%8 = icmp eq i64 %7, 5000000
br i1 %8, label %2, label %4
}
char *null(void) { return 0; }


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

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

LLVM IR (-O0):
define i8* @null() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @null() {
ret i8* null
}
void Default_Handler() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Default_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_Handler+0x9>
jmp    1109 <Default_Handler+0x9>

x86 assembly (clang, -O2):
<Default_Handler>:
jmp    1100 <Default_Handler>

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

LLVM IR (-O2):
define void @Default_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
float __infer_nondet_float();
float modff(float value, float *iptr) {
  *iptr = __infer_nondet_float();
  return __infer_nondet_float();
}


x86 assembly (clang, -O0):
<modff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modff>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__infer_nondet_float@plt>
movss  %xmm0,(%rbx)
xor    %eax,%eax
pop    %rbx
jmp    1030 <__infer_nondet_float@plt>

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

LLVM IR (-O2):
define float @modff(float %0, float* nocapture writeonly %1) {
%3 = tail call float (...) @__infer_nondet_float()
store float %3, float* %1
%4 = tail call float (...) @__infer_nondet_float()
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ genincrdecr(char *, int);
extern void genpop(int d) { genincrdecr("decr", d); }


x86 assembly (clang, -O0):
<genpop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <genincrdecr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genpop>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <genincrdecr@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"decr\00"
define void @genpop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @genincrdecr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"decr\00"
define void @genpop(i32 %0) {
%2 = tail call i32 @genincrdecr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t load_3(const unsigned char *in) {
  uint64_t result;
  result = (uint64_t)in[0];
  result |= ((uint64_t)in[1]) << 8;
  result |= ((uint64_t)in[2]) << 16;
  return result;
}


x86 assembly (clang, -O0):
<load_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_3>:
movzwl (%rdi),%ecx
movzbl 0x2(%rdi),%eax
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @load_3(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 16
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @load_3(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ z_streamp;

/* Variables and functions */
int inflate(int /*<<< orphan*/, int);
__attribute__((__visibility__("default"))) int kz_inflate(z_streamp strm,
                                                          int flush) {
  return inflate(strm, flush);
}


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

x86 assembly (clang, -O2):
<kz_inflate>:
jmp    1030 <inflate@plt>

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

LLVM IR (-O2):
define i32 @kz_inflate(i32 %0, i32 %1) {
%3 = tail call i32 @inflate(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
unsigned int atoi(char *);
char *cfg_get_str(char *, char *, char *);
unsigned int cfg_get_int(char *dname, char *sname, char *ename,
                         unsigned int def) {
  char *val;
  val = cfg_get_str(dname, sname, ename);
  if (NULL == val)
    return def;
  return atoi(val);
}


x86 assembly (clang, -O0):
<cfg_get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <cfg_get_str@plt>
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
cmp    -0x30(%rbp),%rax
jne    1163 <cfg_get_int+0x43>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <cfg_get_int+0x4f>
mov    -0x30(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_get_int>:
push   %rbx
mov    %ecx,%ebx
call   1030 <cfg_get_str@plt>
test   %rax,%rax
je     1136 <cfg_get_int+0x16>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cfg_get_int(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i8* @cfg_get_str(i8* %11, i8* %12, i8* %13)
store i8* %14, i8** %10
%15 = load i8*, i8** %10
%16 = icmp eq i8* null, %15
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = load i32, i32* %9
store i32 %18, i32* %5
br label %22
19: ; preds = %4
%20 = load i8*, i8** %10
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %5
br label %22
22: ; preds = %19, %17
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @cfg_get_int(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* @cfg_get_str(i8* %0, i8* %1, i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @atoi(i8* %5)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ %3, %4 ]
ret i32 %10
}
int error() {
  int p;
  if (p) {
  ERROR:
    goto ERROR;
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,-0x8(%rbp)
je     1118 <error+0x18>
jmp    1113 <error+0x13>
jmp    1113 <error+0x13>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @error() {
ret i32 undef
}