xunge/DecIR huggingface dataset:
void GetRandomFileName(Prefix, F) char *Prefix;
char *F;
{
  strcpy(F, Prefix);
  strcat(F, "XXXXXX");
  mktemp(F);
}


x86 assembly (clang, -O0):
<GetRandomFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <mktemp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRandomFileName>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
movl   $0x58585858,(%rbx,%rax,1)
movl   $0x585858,0x3(%rbx,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1050 <mktemp@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"XXXXXX\00"
define void @GetRandomFileName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %4
%9 = call i8* @strcat(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @mktemp to i32 (i8*, ...)*)(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"XXXXXX\00"
define void @GetRandomFileName(i8* nocapture %0, i8* %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = getelementptr i8, i8* %1, i64 %4
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(7) %5, i8* align 1 dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 7, i1 false)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mktemp to i32 (i8*, ...)*)(i8* %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmap_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xmap.serial = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xmap_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_XEvent_xmap_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xmap_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_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmap_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
long complementBit_fun_long(long x, unsigned i) { return x ^ 1 << i; }


x86 assembly (clang, -O0):
<complementBit_fun_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complementBit_fun_long>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @complementBit_fun_long(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = xor i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @complementBit_fun_long(i64 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sext i32 %3 to i64
%5 = xor i64 %4, %0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ expecti(int, int);
void test() {
  int a = 0;
  int i = 0;
  do {
    a = a + i++;
  } while (i <= 100);
  expecti(a, 5050);
  i = 5;
  do {
    i = i + a;
  } while (0);
  expecti(i, 5055);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x64,-0x8(%rbp)
jle    1126 <test+0x16>
mov    -0x4(%rbp),%edi
mov    $0x13ba,%esi
call   1030 <expecti@plt>
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x13bf,%esi
call   1030 <expecti@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x13ba,%edi
mov    $0x13ba,%esi
call   1030 <expecti@plt>
mov    $0x13bf,%edi
mov    $0x13bf,%esi
pop    %rax
jmp    1030 <expecti@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = add nsw i32 %4, %5
store i32 %7, i32* %1
br label %8
8: ; preds = %3
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 100
br i1 %10, label %3, label %11
11: ; preds = %8
%12 = load i32, i32* %1
%13 = call i32 @expecti(i32 %12, i32 5050)
store i32 5, i32* %2
br label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = load i32, i32* %1
%17 = add nsw i32 %15, %16
store i32 %17, i32* %2
br label %18
18: ; preds = %14
%19 = load i32, i32* %2
%20 = call i32 @expecti(i32 %19, i32 5055)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @expecti(i32 5050, i32 5050)
%2 = tail call i32 @expecti(i32 5055, i32 5055)
ret void
}
/* Variables and functions */
unsigned long gfx_ind(int);
int /*<<< orphan*/ gfx_outd(int, unsigned long);
void Dorado9211SetCS(void) {
  unsigned long value;
  value = gfx_ind(0x6400 + 0x04);
  gfx_outd(0x6400 + 0x00, value | 0x00000200);
}


x86 assembly (clang, -O0):
<Dorado9211SetCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6404,%edi
call   1040 <gfx_ind@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
or     $0x200,%rsi
mov    $0x6400,%edi
call   1030 <gfx_outd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dorado9211SetCS>:
push   %rax
mov    $0x6404,%edi
call   1040 <gfx_ind@plt>
or     $0x200,%rax
mov    $0x6400,%edi
mov    %rax,%rsi
pop    %rax
jmp    1030 <gfx_outd@plt>

LLVM IR (-O0):
define void @Dorado9211SetCS() {
%1 = alloca i64
%2 = call i64 @gfx_ind(i32 25604)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = or i64 %3, 512
%5 = call i32 @gfx_outd(i32 25600, i64 %4)
ret void
}

LLVM IR (-O2):
define void @Dorado9211SetCS() {
%1 = tail call i64 @gfx_ind(i32 25604)
%2 = or i64 %1, 512
%3 = tail call i32 @gfx_outd(i32 25600, i64 %2)
ret void
}
/* Variables and functions */
scalar_t__ gpioRead(int);
int /*<<< orphan*/ gpioWrite(int, int);
void gpioToggle(int pinno) {
  gpioRead(pinno) ? gpioWrite(pinno, 0) : gpioWrite(pinno, 1);
}


x86 assembly (clang, -O0):
<gpioToggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <gpioRead@plt>
cmp    $0x0,%rax
je     114c <gpioToggle+0x2c>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <gpioWrite@plt>
jmp    1159 <gpioToggle+0x39>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <gpioWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpioToggle>:
push   %rbx
mov    %edi,%ebx
call   1030 <gpioRead@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
mov    %ebx,%edi
pop    %rbx
jmp    1040 <gpioWrite@plt>

LLVM IR (-O0):
define void @gpioToggle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @gpioRead(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @gpioWrite(i32 %7, i32 0)
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @gpioWrite(i32 %10, i32 1)
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %8, %6 ], [ %11, %9 ]
ret void
}

LLVM IR (-O2):
define void @gpioToggle(i32 %0) {
%2 = tail call i64 @gpioRead(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @gpioWrite(i32 %0, i32 %4)
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ xerrf(char *);
int filesize(int fd) {
  struct stat st;
  if (fstat(fd, &st) < 0)
    xerrf("stat failed:");
  return st.st_size;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
jge    114d <filesize+0x2d>
lea    0xeb8(%rip),%rdi
call   1030 <xerrf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
test   %rax,%rax
jns    113a <filesize+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <xerrf@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [13 x i8] c"stat failed:\00"
define i32 @filesize(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @fstat(i32 %4, %struct.stat* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @xerrf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [13 x i8] c"stat failed:\00"
define i32 @filesize(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @xerrf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ testTree();
int main(int argc, char *argv[]) {
  testTree();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <testTree@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <testTree@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @testTree()
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testTree()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int test_017(int a, int b, int c, int d) { return a + a + (a & 1); }


x86 assembly (clang, -O0):
<test_017>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_017>:
mov    %edi,%eax
and    $0x1,%eax
lea    (%rax,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @test_017(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* %5
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = and i32 %12, 1
%14 = add nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_017(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 %0, 1
%6 = and i32 %0, 1
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test(int M) {
  if (M >= 0) {
    { hash(1); };
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112f <test+0x1f>
mov    $0x1,%edi
call   1030 <hash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %edi,%edi
js     111e <test+0xe>
mov    $0x1,%edi
jmp    1030 <hash@plt>
ret

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

LLVM IR (-O2):
define void @test(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @hash(i32 1)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int M_PI;
double p_acimut(double x) { return (double)1 / (2 * M_PI); }


x86 assembly (clang, -O0):
<p_acimut>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ed8(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xedf(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_acimut>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee9(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @p_acimut(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @M_PI
%4 = mul nsw i32 2, %3
%5 = sitofp i32 %4 to double
%6 = fdiv double 1.000000e+00, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @p_acimut(double %0) {
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = sitofp i32 %3 to double
%5 = fdiv double 1.000000e+00, %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
void accept_graft(u_int32_t src, u_int32_t dst, char *p, int datalen) {}


x86 assembly (clang, -O0):
<accept_graft>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @accept_graft(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @accept_graft(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
scalar_t__ nearbyint(double);
float nearbyintf(float x) { return (float)nearbyint((double)x); }


x86 assembly (clang, -O0):
<nearbyintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <nearbyint@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearbyintf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <nearbyint@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @nearbyintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @nearbyint(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @nearbyintf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @nearbyint(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
long double foo(long double a, long double b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jbe    1130 <foo+0x30>
jmp    1125 <foo+0x25>
fldt   -0x10(%rbp)
fstpt  -0x2c(%rbp)
jmp    1136 <foo+0x36>
fldt   -0x20(%rbp)
fstpt  -0x2c(%rbp)
fldt   -0x2c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fucomi %st(1),%st
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @foo(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 = fcmp olt x86_fp80 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load x86_fp80, x86_fp80* %3
br label %12
10: ; preds = %2
%11 = load x86_fp80, x86_fp80* %4
br label %12
12: ; preds = %10, %8
%13 = phi x86_fp80 [ %9, %8 ], [ %11, %10 ]
ret x86_fp80 %13
}

LLVM IR (-O2):
define x86_fp80 @foo(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp olt x86_fp80 %0, %1
%4 = select i1 %3, x86_fp80 %0, x86_fp80 %1
ret x86_fp80 %4
}
/* Variables and functions */
int EOF;
int getchar();
void clean() {
  int c;
  do {
    c = getchar();
  } while (c != EOF && c != '\n');
}


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    0x2eba(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1143 <clean+0x33>
cmpl   $0xa,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1118 <clean+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <clean+0x20>
cmp    (%rbx),%eax
jne    1120 <clean+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @clean() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp ne i32 %2, %3
%5 = icmp ne i32 %2, 10
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
const char *ZSTD_versionString(void) { return "1.3.1"; }


x86 assembly (clang, -O0):
<ZSTD_versionString>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZSTD_versionString>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.3.1\00"
define i8* @ZSTD_versionString() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.3.1\00"
define i8* @ZSTD_versionString() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, oldx;
  x = __VERIFIER_nondet_int();
  while (x > 1 && x >= 2 * oldx) {
    oldx = x;
    x = __VERIFIER_nondet_int();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jle    1149 <main+0x39>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1159 <main+0x49>
jmp    116e <main+0x5e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x2,%eax
jl     1134 <main+0x24>
mov    %eax,%ebx
nop
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x2,%eax
jl     1134 <main+0x24>
add    %ebx,%ebx
cmp    %ebx,%eax
mov    %eax,%ebx
jge    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = mul nsw i32 2, %10
%12 = icmp sge i32 %9, %11
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32, i32* %2
store i32 %16, i32* %3
%17 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %17, i32* %2
br label %5
18: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %5, %3 ], [ %1, %0 ]
%5 = tail call i32 (...) @__VERIFIER_nondet_int()
%6 = icmp sgt i32 %5, 1
%7 = shl nuw nsw i32 %4, 1
%8 = icmp sge i32 %5, %7
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %3, label %10
10: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(unsigned char);
int /*<<< orphan*/ puts(char *);
void printpass(unsigned char *arr, size_t length) {
  for (size_t i = 0; i < length; i++) {
    putchar(arr[i]);
  }
  puts("");
}


x86 assembly (clang, -O0):
<printpass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1168 <printpass+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <printpass+0x18>
lea    0xe91(%rip),%rdi
call   1040 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printpass>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <printpass+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printpass+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @printpass(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @putchar(i8 zeroext %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printpass(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @putchar(i8 zeroext %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M118_f(char *s) {
  debug("M118_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M118_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M118_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M118_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M118_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M118_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M118_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int sd_zbc_init(void) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/
Cyc_InsertChecks_insert_checks(struct Cyc_List_List *,
                               struct Cyc_JumpAnalysis_Jump_Anal_Result *);
int Cyc_do_insert_checks(struct Cyc_JumpAnalysis_Jump_Anal_Result *tables,
                         struct Cyc_List_List *tds) {
  ({ Cyc_InsertChecks_insert_checks(tds, tables); });
  return 1;
}


x86 assembly (clang, -O0):
<Cyc_do_insert_checks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <Cyc_InsertChecks_insert_checks@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_do_insert_checks>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <Cyc_InsertChecks_insert_checks@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_JumpAnalysis_Jump_Anal_Result = type { i32 }
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_do_insert_checks(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_List_List* %1) {
%3 = alloca %struct.Cyc_JumpAnalysis_Jump_Anal_Result*
%4 = alloca %struct.Cyc_List_List*
%5 = alloca i32
store %struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_JumpAnalysis_Jump_Anal_Result** %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%7 = load %struct.Cyc_JumpAnalysis_Jump_Anal_Result*, %struct.Cyc_JumpAnalysis_Jump_Anal_Result** %3
%8 = call i32 @Cyc_InsertChecks_insert_checks(%struct.Cyc_List_List* %6, %struct.Cyc_JumpAnalysis_Jump_Anal_Result* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 1
}

LLVM IR (-O2):
%struct.Cyc_JumpAnalysis_Jump_Anal_Result = type { i32 }
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_do_insert_checks(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_List_List* %1) {
%3 = tail call i32 @Cyc_InsertChecks_insert_checks(%struct.Cyc_List_List* %1, %struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0)
ret i32 1
}
/* Variables and functions */
int U_WMRCORE_RECSAFE_get(char const *, int);
int U_WMREOF_get(const char *contents) {
  return (U_WMRCORE_RECSAFE_get(contents, (6)));
}


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

x86 assembly (clang, -O2):
<U_WMREOF_get>:
mov    $0x6,%esi
jmp    1030 <U_WMRCORE_RECSAFE_get@plt>

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

LLVM IR (-O2):
define i32 @U_WMREOF_get(i8* %0) {
%2 = tail call i32 @U_WMRCORE_RECSAFE_get(i8* %0, i32 6)
ret i32 %2
}
void SCB_ScbModePostEnable(void) {}


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

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

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

LLVM IR (-O2):
define void @SCB_ScbModePostEnable() {
ret void
}
/* Variables and functions */
scalar_t__ sbsock_receive_tcp(void *, unsigned char *, int);
int sbsock_flush_tcp(void *_data) {
  unsigned char trash[32];
  while (sbsock_receive_tcp(_data, trash, 32) > 0)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<sbsock_flush_tcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x20,%edx
call   1030 <sbsock_receive_tcp@plt>
cmp    $0x0,%rax
jle    113d <sbsock_flush_tcp+0x2d>
jmp    111c <sbsock_flush_tcp+0xc>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbsock_flush_tcp>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
nopl   (%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   1030 <sbsock_receive_tcp@plt>
test   %rax,%rax
jg     1120 <sbsock_flush_tcp+0x10>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @sbsock_flush_tcp(i8* %0) {
%2 = alloca i8*
%3 = alloca [32 x i8]
store i8* %0, i8** %2
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%7 = call i64 @sbsock_receive_tcp(i8* %5, i8* %6, i32 32)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @sbsock_flush_tcp(i8* %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = call i64 @sbsock_receive_tcp(i8* %0, i8* %3, i32 32)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
ret i32 0
}
/* Variables and functions */
int _pack2(unsigned int, unsigned int);
unsigned short magnitude_fun_complexOf_ushort(unsigned int);
unsigned signum_fun_complexOf_ushort(unsigned a) {
  unsigned short m;
  if (a == 0) {
    return a;
  } else {
    m = magnitude_fun_complexOf_ushort(a);
    return _pack2((a >> 16) / m, (a & 0x0000ffff) / m);
  }
}


x86 assembly (clang, -O0):
<signum_fun_complexOf_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1140 <signum_fun_complexOf_ushort+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <signum_fun_complexOf_ushort+0x56>
mov    -0x8(%rbp),%edi
call   1040 <magnitude_fun_complexOf_ushort@plt>
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
movzwl -0xa(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
movzwl -0xa(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%esi
call   1030 <_pack2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_complexOf_ushort>:
test   %edi,%edi
je     114b <signum_fun_complexOf_ushort+0x2b>
push   %rbx
mov    %edi,%ebx
call   1040 <magnitude_fun_complexOf_ushort@plt>
mov    %eax,%ecx
mov    %ebx,%eax
shr    $0x10,%eax
xor    %edx,%edx
div    %cx
movzwl %ax,%edi
mov    %ebx,%eax
xor    %edx,%edx
div    %cx
movzwl %ax,%esi
pop    %rbx
jmp    1030 <_pack2@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @signum_fun_complexOf_ushort(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %23
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call zeroext i16 @magnitude_fun_complexOf_ushort(i32 %10)
store i16 %11, i16* %4
%12 = load i32, i32* %3
%13 = lshr i32 %12, 16
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = udiv i32 %13, %15
%17 = load i32, i32* %3
%18 = and i32 %17, 65535
%19 = load i16, i16* %4
%20 = zext i16 %19 to i32
%21 = udiv i32 %18, %20
%22 = call i32 @_pack2(i32 %16, i32 %21)
store i32 %22, i32* %2
br label %23
23: ; preds = %9, %7
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @signum_fun_complexOf_ushort(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call zeroext i16 @magnitude_fun_complexOf_ushort(i32 %0)
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i16
%7 = udiv i16 %6, %4
%8 = zext i16 %7 to i32
%9 = trunc i32 %0 to i16
%10 = udiv i16 %9, %4
%11 = zext i16 %10 to i32
%12 = tail call i32 @_pack2(i32 %8, i32 %11)
br label %13
13: ; preds = %1, %3
%14 = phi i32 [ %12, %3 ], [ 0, %1 ]
ret i32 %14
}
/* Variables and functions */
int MDM_which(char *, char const *, char *);
int MFwhich(char *fullname, char *name, const char *suffix) {
  return (MDM_which(name, suffix, fullname));
}


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

x86 assembly (clang, -O2):
<MFwhich>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <MDM_which@plt>

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

LLVM IR (-O2):
define i32 @MFwhich(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @MDM_which(i8* %1, i8* %2, i8* %0)
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int strcmp2(const char *s1, const char *s2) { return strcmp(s1, s2) == 0; }


x86 assembly (clang, -O0):
<strcmp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp2>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @strcmp2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @strcmp2(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ x;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xmotion_x(void *_p) { return (int)((XEvent *)_p)->xmotion.x; }


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

x86 assembly (clang, -O2):
<get_XEvent_xmotion_x>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XEvent_xmotion_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void start_monitor() {}


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

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

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

LLVM IR (-O2):
define void @start_monitor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CLR_DEBUG_VALID();
int /*<<< orphan*/ SET_DEBUG_LEVEL(int);
int /*<<< orphan*/ SET_DEBUG_VALID();
void output_debug_level(int data) {
  SET_DEBUG_LEVEL(data);
  SET_DEBUG_VALID();
  CLR_DEBUG_VALID();
}


x86 assembly (clang, -O0):
<output_debug_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <SET_DEBUG_LEVEL@plt>
mov    $0x0,%al
call   1040 <SET_DEBUG_VALID@plt>
mov    $0x0,%al
call   1030 <CLR_DEBUG_VALID@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_debug_level>:
push   %rax
call   1050 <SET_DEBUG_LEVEL@plt>
xor    %eax,%eax
call   1040 <SET_DEBUG_VALID@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CLR_DEBUG_VALID@plt>

LLVM IR (-O0):
define void @output_debug_level(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @SET_DEBUG_LEVEL(i32 %3)
%5 = call i32 (...) @SET_DEBUG_VALID()
%6 = call i32 (...) @CLR_DEBUG_VALID()
ret void
}

LLVM IR (-O2):
define void @output_debug_level(i32 %0) {
%2 = tail call i32 @SET_DEBUG_LEVEL(i32 %0)
%3 = tail call i32 (...) @SET_DEBUG_VALID()
%4 = tail call i32 (...) @CLR_DEBUG_VALID()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ framebuf_put_char(char);
void output_fb(char c, void *buf) { framebuf_put_char(c); }


x86 assembly (clang, -O0):
<output_fb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <framebuf_put_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_fb>:
jmp    1030 <framebuf_put_char@plt>

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

LLVM IR (-O2):
define void @output_fb(i8 signext %0, i8* nocapture readnone %1) {
%3 = tail call i32 @framebuf_put_char(i8 signext %0)
ret void
}
void check_negative_sized_VLA_10_sub(int x) { int vla[x]; }


x86 assembly (clang, -O0):
<check_negative_sized_VLA_10_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @check_negative_sized_VLA_10_sub(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @check_negative_sized_VLA_10_sub(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World!\\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello World!\\n\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void bc_2R_none(struct grid *g, struct parList *par) {}


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

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

LLVM IR (-O0):
%struct.grid = type opaque
%struct.parList = type opaque
define void @bc_2R_none(%struct.grid* %0, %struct.parList* %1) {
%3 = alloca %struct.grid*
%4 = alloca %struct.parList*
store %struct.grid* %0, %struct.grid** %3
store %struct.parList* %1, %struct.parList** %4
ret void
}

LLVM IR (-O2):
%struct.grid = type opaque
%struct.parList = type opaque
define void @bc_2R_none(%struct.grid* nocapture %0, %struct.parList* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fill();
int /*<<< orphan*/ read();
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ write();
int main(int argc, char *argv[]) {
  uint32_t i;
  srand(1);
  fill();
  write();
  read();
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1060 <fill@plt>
mov    $0x0,%al
call   1030 <write@plt>
mov    $0x0,%al
call   1040 <read@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1060 <fill@plt>
xor    %eax,%eax
call   1030 <write@plt>
xor    %eax,%eax
call   1040 <read@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @srand(i32 1)
%8 = call i32 (...) @fill()
%9 = call i32 (...) @write()
%10 = call i32 (...) @read()
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srand(i32 1)
%4 = tail call i32 (...) @fill()
%5 = tail call i32 (...) @write()
%6 = tail call i32 (...) @read()
%7 = tail call i32 @exit(i32 0)
unreachable
}
int TKMM_SizeToFxiU(int sz) {
  int fr, ex;
  int i;
  fr = sz;
  ex = 0;
  while (fr >= 16) {
    fr = (fr + 1) >> 1;
    ex++;
  }
  i = (fr & 7) | (ex << 3);
  return (i);
}


x86 assembly (clang, -O0):
<TKMM_SizeToFxiU>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0x8(%rbp)
jl     1138 <TKMM_SizeToFxiU+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <TKMM_SizeToFxiU+0x14>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TKMM_SizeToFxiU>:
xor    %ecx,%ecx
cmp    $0x10,%edi
jl     1121 <TKMM_SizeToFxiU+0x21>
xor    %ecx,%ecx
nopl   0x0(%rax)
lea    0x1(%rdi),%eax
shr    %eax
add    $0x8,%ecx
cmp    $0x1e,%edi
mov    %eax,%edi
ja     1110 <TKMM_SizeToFxiU+0x10>
jmp    1123 <TKMM_SizeToFxiU+0x23>
mov    %edi,%eax
and    $0x7,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @TKMM_SizeToFxiU(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %10, %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 16
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = ashr i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %7
16: ; preds = %7
%17 = load i32, i32* %3
%18 = and i32 %17, 7
%19 = load i32, i32* %4
%20 = shl i32 %19, 3
%21 = or i32 %18, %20
store i32 %21, i32* %5
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @TKMM_SizeToFxiU(i32 %0) {
%2 = icmp sgt i32 %0, 15
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %6, 1
%8 = add nuw nsw i32 %5, 1
%9 = icmp ugt i32 %4, 30
br i1 %9, label %3, label %10
10: ; preds = %3
%11 = shl i32 %8, 3
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
%14 = phi i32 [ %0, %1 ], [ %7, %10 ]
%15 = and i32 %14, 7
%16 = or i32 %15, %13
ret i32 %16
}
lobyte(i) int i;
{ return (i & 0xFF); }


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

x86 assembly (clang, -O2):
<lobyte>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @lobyte(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
struct pthread *__pthread_self() {
  struct pthread *self;
  __asm__("movq %%fs:0,%0" : "=r"(self));
  return self;
}


x86 assembly (clang, -O0):
<__pthread_self>:
push   %rbp
mov    %rsp,%rbp
mov    %fs:0x0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pthread_self>:
mov    %fs:0x0,%rax
ret

LLVM IR (-O0):
%struct.pthread = type opaque
define %struct.pthread* @__pthread_self() {
%1 = alloca %struct.pthread*
%2 = call %struct.pthread* asm "movq %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store %struct.pthread* %2, %struct.pthread** %1
%3 = load %struct.pthread*, %struct.pthread** %1
ret %struct.pthread* %3
}

LLVM IR (-O2):
%struct.pthread = type opaque
define %struct.pthread* @__pthread_self() {
%1 = tail call %struct.pthread* asm "movq %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret %struct.pthread* %1
}
void plcolor(color) int color;
{}


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

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

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

LLVM IR (-O2):
define void @plcolor(i32 %0) {
ret void
}
int machine_little_endian() {
  static long int x = 0x1;
  static char *px = (char *)&x;
  return (px[0] == 0) ? 0 : 1;
}


x86 assembly (clang, -O0):
<machine_little_endian>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1d(%rip),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@machine_little_endian.x = internal global i64 1
@machine_little_endian.px = internal global i8* bitcast (i64* @machine_little_endian.x to i8*)
define i32 @machine_little_endian() {
%1 = load i8*, i8** @machine_little_endian.px
%2 = getelementptr inbounds i8, i8* %1, i64 0
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @machine_little_endian() {
ret i32 1
}