xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strcpy(char *dest, const char *src) {
  size_t i = 0;
  while ((dest[i] = src[i]) != '\0')
    ++i;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %0
}
int is_crlf(int bytes) {
  int result = (((13 << 8) | (10)) & bytes) == ((13 << 8) | (10));
  return result;
}


x86 assembly (clang, -O0):
<is_crlf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xd0a,%eax
cmp    $0xd0a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_crlf>:
not    %edi
xor    %eax,%eax
test   $0xd0a,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_crlf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 3338, %4
%6 = icmp eq i32 %5, 3338
%7 = zext i1 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_crlf(i32 %0) {
%2 = and i32 %0, 3338
%3 = icmp eq i32 %2, 3338
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFD;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ error(char *);
scalar_t__ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void fd_set_noclose_on_exec(int fd) {
  assert(fd >= 0);
  if (fcntl(fd, F_SETFD, 0) < 0)
    error("fcntl(F_SETFD) failed: %m");
  return;
}


x86 assembly (clang, -O0):
<fd_set_noclose_on_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    1175 <fd_set_noclose_on_exec+0x45>
lea    0xe90(%rip),%rdi
call   1050 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_set_noclose_on_exec>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %rax,%rax
js     1156 <fd_set_noclose_on_exec+0x26>
pop    %rbx
ret
lea    0xea3(%rip),%rdi
pop    %rbx
jmp    1050 <error@plt>

LLVM IR (-O0):
@F_SETFD = global i32 0
@.str = [26 x i8] c"fcntl(F_SETFD) failed: %m\00"
define void @fd_set_noclose_on_exec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFD
%9 = call i64 @fcntl(i32 %7, i32 %8, i32 0)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
@F_SETFD = global i32 0
@.str = [26 x i8] c"fcntl(F_SETFD) failed: %m\00"
define void @fd_set_noclose_on_exec(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* @F_SETFD
%6 = tail call i64 @fcntl(i32 %0, i32 %5, i32 0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void default_logfn(uint8_t loglevel, const char *file, const int line,
                   const char *fn, const char *format, va_list args) {}


x86 assembly (clang, -O0):
<default_logfn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @default_logfn(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @default_logfn(i32 %0, i8* nocapture %1, i32 %2, i8* nocapture %3, i8* nocapture %4, i32 %5) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void initialize_rng() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<initialize_rng>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_rng>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @initialize_rng() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @initialize_rng() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
int test_imm_EEint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xEE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EEint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 238
%7 = icmp ne i64 %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_EEint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15597568
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wait_states(struct __test_metadata *);
void wrapper_wait_states(struct __test_metadata *_metadata,
                         struct __fixture_variant_metadata *variant) {
  wait_states(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_wait_states>:
jmp    1030 <wait_states@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_wait_states(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @wait_states(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_wait_states(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @wait_states(%struct.__test_metadata* %0)
ret void
}
double f4_sum_pre_double_double_double_double_double_double_double_double_long(
    double v0, double v1, double v2, double v3, double v4, double v5, double v6,
    double v7, long v) {
  return v0 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_double_double_double_double_double_double_double_double_long>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
mov    %rdi,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
cvtsi2sdq -0x48(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_double_double_double_double_double_double_double_long>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm7,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %rdi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_double_double_double_double_double_double_double_long(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i64 %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca i64
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store i64 %8, i64* %18
%19 = load double, double* %10
%20 = load double, double* %11
%21 = fadd double %19, %20
%22 = load double, double* %12
%23 = fadd double %21, %22
%24 = load double, double* %13
%25 = fadd double %23, %24
%26 = load double, double* %14
%27 = fadd double %25, %26
%28 = load double, double* %15
%29 = fadd double %27, %28
%30 = load double, double* %16
%31 = fadd double %29, %30
%32 = load double, double* %17
%33 = fadd double %31, %32
%34 = load i64, i64* %18
%35 = sitofp i64 %34 to double
%36 = fadd double %33, %35
ret double %36
}

LLVM IR (-O2):
define double @f4_sum_pre_double_double_double_double_double_double_double_double_long(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i64 %8) {
%10 = fadd double %0, %1
%11 = fadd double %10, %2
%12 = fadd double %11, %3
%13 = fadd double %12, %4
%14 = fadd double %13, %5
%15 = fadd double %14, %6
%16 = fadd double %15, %7
%17 = sitofp i64 %8 to double
%18 = fadd double %16, %17
ret double %18
}
/* Variables and functions */
int /*<<< orphan*/ doentexp(int, int /*<<< orphan*/);
void pentry(void) { doentexp((1 << 0), 0); }


x86 assembly (clang, -O0):
<pentry>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <doentexp@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pentry() {
%1 = call i32 @doentexp(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @pentry() {
%1 = tail call i32 @doentexp(i32 1, i32 0)
ret void
}
int fstat(int fd, void *buf) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fstat(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
int hxd_v_rel(void) { return 0x20130412; }


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

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

LLVM IR (-O0):
define i32 @hxd_v_rel() {
ret i32 538117138
}

LLVM IR (-O2):
define i32 @hxd_v_rel() {
ret i32 538117138
}
int main(void) {
  int i = -1;
  int j = 30 * -1;
  int frames = 127;
  frames = ((frames + 15) & -16);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffe2,-0xc(%rbp)
movl   $0x7f,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0xf,%eax
and    $0xfffffff0,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
store i32 -30, i32* %3
store i32 127, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 15
%7 = and i32 %6, -16
store i32 %7, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const, int const, int const);
void divide_numbers(const int a, const int b) {
  ((void)0);
  ((void)0);
  if (b == 0) {
    ((void)0);
    return;
  }
  if ((a / b) == 777) {
    ((void)0);
  }
  printf("%d / %d = %d\n", a, b, a / b);
}


x86 assembly (clang, -O0):
<divide_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112d <divide_numbers+0x1d>
jmp    1165 <divide_numbers+0x55>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x309,%eax
jne    1144 <divide_numbers+0x34>
jmp    1144 <divide_numbers+0x34>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_numbers>:
mov    %esi,%ecx
test   %esi,%esi
je     112d <divide_numbers+0x1d>
mov    %edi,%esi
mov    %edi,%eax
cltd
idiv   %ecx
lea    0xedc(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d / %d = %d\0A\00"
define void @divide_numbers(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %5)
br label %7
7: ; preds = %2, %4
ret void
}
int a2(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @a2() {
ret i32 0
}
int search() {}


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

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

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

LLVM IR (-O2):
define i32 @search() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, int, char *, char *);
int /*<<< orphan*/ strstr(char *, char *);
void contains(int line, char *expected, char *got) {
  if (!strstr(got, expected))
    error("line %d: '%s' expected, but got '%s'", line, expected, got);
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%eax
jne    1160 <contains+0x40>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xea5(%rip),%rdi
call   1030 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1040 <strstr@plt>
test   %eax,%eax
je     113d <contains+0x1d>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xebc(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"line %d: '%s' expected, but got '%s'\00"
define void @contains(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %5
%9 = call i32 @strstr(i8* %7, i8* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13, i8* %14)
br label %16
16: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"line %d: '%s' expected, but got '%s'\00"
define void @contains(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @strstr(i8* %2, i8* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2)
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nrf_drv_radio802154_swi_init();
void nrf_drv_radio802154_notification_init(void) {
  nrf_drv_radio802154_swi_init();
}


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

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

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

LLVM IR (-O2):
define void @nrf_drv_radio802154_notification_init() {
%1 = tail call i32 (...) @nrf_drv_radio802154_swi_init()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int);
void textcolor(FILE *stream, int attr, int fg, int bg) {
  fprintf(stream, "%c[%d;%dm", 0x1B, attr, fg + 30);
}


x86 assembly (clang, -O0):
<textcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
add    $0x1e,%r8d
lea    0xec5(%rip),%rsi
mov    $0x1b,%edx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textcolor>:
mov    %esi,%ecx
lea    0x1e(%rdx),%r8d
lea    0xee3(%rip),%rsi
mov    $0x1b,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%c[%d;%dm\00"
define void @textcolor(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 30
%13 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %10, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%c[%d;%dm\00"
define void @textcolor(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, 30
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %1, i32 %5)
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *string_substring(char *text, int start, int length) {
  char *new_string = calloc(1, length + 1);
  strncpy(new_string, text + start, length);
  return new_string;
}


x86 assembly (clang, -O0):
<string_substring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_substring>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%rbx),%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <strncpy@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @string_substring(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
%10 = call i8* @calloc(i32 1, i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i32, i32* %6
%17 = call i32 @strncpy(i8* %11, i8* %15, i32 %16)
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
define i8* @string_substring(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i8* @calloc(i32 1, i32 %4)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i32 @strncpy(i8* %5, i8* %7, i32 %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ is_pow2(unsigned int);
unsigned int align(unsigned int x, unsigned int alignment) {
  assert(is_pow2(alignment));
  return (x + (alignment - 1)) & ~(alignment - 1);
}


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <is_pow2@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
mov    %esi,%edi
call   1040 <is_pow2@plt>
mov    %eax,%edi
call   1030 <assert@plt>
lea    (%r14,%rbx,1),%eax
add    $0xffffffff,%eax
neg    %ebx
and    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @align(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @is_pow2(i32 %5)
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 %9, 1
%11 = add i32 %8, %10
%12 = load i32, i32* %4
%13 = sub i32 %12, 1
%14 = xor i32 %13, -1
%15 = and i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @align(i32 %0, i32 %1) {
%3 = tail call i32 @is_pow2(i32 %1)
%4 = tail call i32 @assert(i32 %3)
%5 = add i32 %0, -1
%6 = add i32 %5, %1
%7 = sub i32 0, %1
%8 = and i32 %6, %7
ret i32 %8
}
double mixr2vapden(double mixr, double tkelvin, double press_mbar) {
  double vapden;
  double epsilon;
  epsilon = 287.04 / 461.50;
  vapden = ((1.0 + mixr) / (1.0 + (mixr / epsilon))) *
           (press_mbar / (287.04 * tkelvin));
  return (vapden);
}


x86 assembly (clang, -O0):
<mixr2vapden>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xee0(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
divsd  -0x28(%rbp),%xmm2
movsd  0xec9(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xeac(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixr2vapden>:
movsd  0xef8(%rip),%xmm3
movapd %xmm0,%xmm4
addsd  %xmm3,%xmm4
divsd  0xef0(%rip),%xmm0
unpcklpd %xmm1,%xmm1
addpd  %xmm3,%xmm0
mulpd  0xee8(%rip),%xmm1
movsd  %xmm0,%xmm1
unpcklpd %xmm2,%xmm4
divpd  %xmm1,%xmm4
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @mixr2vapden(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store double 0x3FE3E7317823C495, double* %8
%9 = load double, double* %4
%10 = fadd double 1.000000e+00, %9
%11 = load double, double* %4
%12 = load double, double* %8
%13 = fdiv double %11, %12
%14 = fadd double 1.000000e+00, %13
%15 = fdiv double %10, %14
%16 = load double, double* %6
%17 = load double, double* %5
%18 = fmul double 2.870400e+02, %17
%19 = fdiv double %16, %18
%20 = fmul double %15, %19
store double %20, double* %7
%21 = load double, double* %7
ret double %21
}

LLVM IR (-O2):
define double @mixr2vapden(double %0, double %1, double %2) {
%4 = fadd double %0, 1.000000e+00
%5 = fdiv double %0, 0x3FE3E7317823C495
%6 = insertelement <2 x double> poison, double %1, i64 1
%7 = insertelement <2 x double> %6, double %5, i64 0
%8 = fadd <2 x double> %7, <double 1.000000e+00, double poison>
%9 = fmul <2 x double> %7, <double poison, double 2.870400e+02>
%10 = shufflevector <2 x double> %8, <2 x double> %9, <2 x i32> <i32 0, i32 3>
%11 = insertelement <2 x double> poison, double %2, i64 1
%12 = insertelement <2 x double> %11, double %4, i64 0
%13 = fdiv <2 x double> %12, %10
%14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%15 = fmul <2 x double> %13, %14
%16 = extractelement <2 x double> %15, i64 0
ret double %16
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void populateTheArray(int *array, int arraySize) {
  for (int i = 1; i < arraySize; i++) {
    scanf("%d", &array[i]);
  }
}


x86 assembly (clang, -O0):
<populateTheArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <populateTheArray+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <populateTheArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<populateTheArray>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <populateTheArray+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
lea    0xed1(%rip),%r14
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <populateTheArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @populateTheArray(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 1, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @populateTheArray(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
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 [ 1, %4 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void fn2(void) {
  if (0)
    foo();
  else
    while (0)
      ;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fn2+0x9>
xor    %eax,%eax
test   $0x1,%al
jne    1118 <fn2+0x18>
jmp    111d <fn2+0x1d>
jmp    1109 <fn2+0x9>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fn2() {
br label %1
1: ; preds = %2, %0
br i1 false, label %2, label %3
2: ; preds = %1
br label %1
3: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @fn2() {
ret void
}
/* Variables and functions */
int _ioctl(int, char, int);
int tcflush(int fd, int what) { return _ioctl(fd, (('T' << 8) | 7), what); }


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

x86 assembly (clang, -O2):
<tcflush>:
mov    %esi,%edx
mov    $0x7,%esi
jmp    1030 <_ioctl@plt>

LLVM IR (-O0):
define i32 @tcflush(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 @_ioctl(i32 %5, i8 signext 7, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @tcflush(i32 %0, i32 %1) {
%3 = tail call i32 @_ioctl(i32 %0, i8 signext 7, i32 %1)
ret i32 %3
}
void int_enable() { __asm__("sti"); }


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

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

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

LLVM IR (-O2):
define void @int_enable() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *format_number(int number) {
  char *converted = (char *)malloc(10 + 1);
  sprintf(converted, "%d", number);
  return converted;
}


x86 assembly (clang, -O0):
<format_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xb,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_number>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xb,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @format_number(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 11)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @format_number(i32 %0) {
%2 = tail call i64 @malloc(i32 11)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %3
}
/* Variables and functions */
double contra_(int *, double *, double *, int *);
double ccontra(int i, double s, double *cont, int *lrc) {
  int I = i;
  double S = s;
  return contra_(&I, &S, cont, lrc);
}


x86 assembly (clang, -O0):
<ccontra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <contra_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccontra>:
sub    $0x18,%rsp
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <contra_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ccontra(i32 %0, double %1, double* %2, i32* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32* %3, i32** %8
%11 = load i32, i32* %5
store i32 %11, i32* %9
%12 = load double, double* %6
store double %12, double* %10
%13 = load double*, double** %7
%14 = load i32*, i32** %8
%15 = call double @contra_(i32* %9, double* %10, double* %13, i32* %14)
ret double %15
}

LLVM IR (-O2):
define double @ccontra(i32 %0, double %1, double* %2, i32* %3) {
%5 = alloca i32
%6 = alloca double
%7 = bitcast i32* %5 to i8*
store i32 %0, i32* %5
%8 = bitcast double* %6 to i8*
store double %1, double* %6
%9 = call double @contra_(i32* %5, double* %6, double* %2, i32* %3)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ clear();
void clearScreen(void) { clear(); }


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

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

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

LLVM IR (-O2):
define void @clearScreen() {
%1 = tail call i32 (...) @clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comb_recursive(int *, int);
void ft_print_comb(void) {
  int nb[3] = {0, 0, 0};
  int index = 0;
  comb_recursive(nb, index);
}


x86 assembly (clang, -O0):
<ft_print_comb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
movl   $0x0,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <comb_recursive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_comb>:
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <comb_recursive@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @ft_print_comb() {
%1 = alloca [3 x i32]
%2 = alloca i32
%3 = bitcast [3 x i32]* %1 to i8*
store i32 0, i32* %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @comb_recursive(i32* %4, i32 %5)
ret void
}

LLVM IR (-O2):
define void @ft_print_comb() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @comb_recursive(i32* %3, i32 0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XPropertyEvent;

/* Variables and functions */
void set_XPropertyEvent_serial(void *_p, unsigned long _v) {
  ((XPropertyEvent *)_p)->serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XPropertyEvent_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XPropertyEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XPropertyEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void g_date_is_first_of_month() {}


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

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

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

LLVM IR (-O2):
define void @g_date_is_first_of_month() {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
float dds_frequencyf(int32_t phase_rate) {
  return (float)phase_rate * (float)8000 / (65536.0f * 65536.0f);
}


x86 assembly (clang, -O0):
<dds_frequencyf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xeee(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xede(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dds_frequencyf>:
cvtsi2ss %rdi,%xmm0
mulss  0xef3(%rip),%xmm0
mulss  0xeef(%rip),%xmm0
ret

LLVM IR (-O0):
define float @dds_frequencyf(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = fmul float %4, 8.000000e+03
%6 = fdiv float %5, 0x41F0000000000000
ret float %6
}

LLVM IR (-O2):
define float @dds_frequencyf(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = fmul float %2, 8.000000e+03
%4 = fmul float %3, 0x3DF0000000000000
ret float %4
}
/* Variables and functions */
char *strstr(char *, char *);
void trim_crlf(char *str) {
  char *p;
  p = strstr(str, "\r\n");
  if (p != NULL) {
    *p = '\0';
  }
}


x86 assembly (clang, -O0):
<trim_crlf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1142 <trim_crlf+0x32>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_crlf>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     1125 <trim_crlf+0x15>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @trim_crlf(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @trim_crlf(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
long double pow(double, double);
__attribute__((weak)) long double powl(long double x, long double y) {
  return pow((double)x, (double)y);
}


x86 assembly (clang, -O0):
<powl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
call   1030 <pow@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powl>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define weak x86_fp80 @powl(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 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call x86_fp80 @pow(double %6, double %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define weak x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call x86_fp80 @pow(double %3, double %4)
ret x86_fp80 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rand();
int /*<<< orphan*/ seed_rng();
void randombytes(uint8_t *target, uint64_t n) {
  seed_rng();
  while (n--) {
    *target++ = rand();
  }
}


x86 assembly (clang, -O0):
<randombytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <seed_rng@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1169 <randombytes+0x49>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
jmp    1136 <randombytes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randombytes>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <seed_rng@plt>
test   %ebp,%ebp
je     1153 <randombytes+0x33>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1140 <randombytes+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @randombytes(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 (...) @seed_rng()
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %3
store i32 %11, i32* %12
br label %6
14: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @randombytes(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 (...) @seed_rng()
%4 = icmp eq i32 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %1, %2 ]
%7 = phi i32* [ %10, %5 ], [ %0, %2 ]
%8 = add nsw i32 %6, -1
%9 = tail call i32 (...) @rand()
%10 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %9, i32* %7
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
int rand(void) {
  static unsigned long next = 1;
  next = next * 1103515245 + 12345;
  return (unsigned int)(next / 65536) % 32768;
}


x86 assembly (clang, -O0):
<rand>:
push   %rbp
mov    %rsp,%rbp
imul   $0x41c64e6d,0x2f11(%rip),%rax
6d 4e c6 41
add    $0x3039,%rax
mov    %rax,0x2f04(%rip)
mov    0x2efd(%rip),%rax
shr    $0x10,%rax
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand>:
imul   $0x41c64e6d,0x2f15(%rip),%rax
6d 4e c6 41
add    $0x3039,%rax
mov    %rax,0x2f08(%rip)
shr    $0x10,%eax
and    $0x7fff,%eax
ret

LLVM IR (-O0):
@rand.next = internal global i64 1
define i32 @rand() {
%1 = load i64, i64* @rand.next
%2 = mul i64 %1, 1103515245
%3 = add i64 %2, 12345
store i64 %3, i64* @rand.next
%4 = load i64, i64* @rand.next
%5 = udiv i64 %4, 65536
%6 = trunc i64 %5 to i32
%7 = urem i32 %6, 32768
ret i32 %7
}

LLVM IR (-O2):
@rand.next = internal unnamed_addr global i64 1
define i32 @rand() {
%1 = load i64, i64* @rand.next
%2 = mul i64 %1, 1103515245
%3 = add i64 %2, 12345
store i64 %3, i64* @rand.next
%4 = trunc i64 %3 to i32
%5 = lshr i32 %4, 16
%6 = and i32 %5, 32767
ret i32 %6
}
int ascii_is_unsafe(unsigned char ch) { return !ch || ch == '\n' || ch == ':'; }


x86 assembly (clang, -O0):
<ascii_is_unsafe>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%al
cmpb   $0x0,-0x1(%rbp)
mov    %al,-0x2(%rbp)
je     1138 <ascii_is_unsafe+0x38>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1138 <ascii_is_unsafe+0x38>
movzbl -0x1(%rbp),%eax
cmp    $0x3a,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_is_unsafe>:
mov    $0x1,%eax
test   %edi,%edi
je     110f <ascii_is_unsafe+0xf>
cmp    $0xa,%dil
jne    1110 <ascii_is_unsafe+0x10>
ret
xor    %eax,%eax
cmp    $0x3a,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ascii_is_unsafe(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 10, label %5
i8 0, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 58
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
unsigned int prince_sbox_inv(unsigned int nibble) {
  const unsigned int sbox[] = {0xb, 0x7, 0x3, 0x2, 0xf, 0xd, 0x8, 0x9,
                               0xa, 0x6, 0x4, 0x0, 0x5, 0xe, 0xc, 0x1};
  return sbox[nibble & 0xF];
}


x86 assembly (clang, -O0):
<prince_sbox_inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    -0x50(%rbp,%rax,4),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prince_sbox_inv>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

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

LLVM IR (-O2):
@__const.prince_sbox_inv.sbox = [16 x i32] [i32 11, i32 7, i32 3, i32 2, i32 15, i32 13, i32 8, i32 9, i32 10, i32 6, i32 4, i32 0, i32 5, i32 14, i32 12, i32 1]
define i32 @prince_sbox_inv(i32 %0) {
%2 = and i32 %0, 15
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.prince_sbox_inv.sbox, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}