xunge/DecIR huggingface dataset:
int test_imm_14int64_highword_reg(long long val) {
  return ((val >> 32) & (0x14 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_14int64_highword_reg>:
movabs $0x1400000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_14int64_highword_reg(i64 %0) {
%2 = and i64 %0, 85899345920
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int isPrim(int);
int /*<<< orphan*/ printf(char *, int, int);
int reverse(int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  scanf("%d", &n);
  printf("%d\n%d\n", isPrim(n), reverse(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <isPrim@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <reverse@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <isPrim@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
call   1030 <reverse@plt>
lea    0xe92(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @isPrim(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @reverse(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}
void BJ_setBotAction(int id) {}


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

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

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

LLVM IR (-O2):
define void @BJ_setBotAction(i32 %0) {
ret void
}
void strfill(char *s, char c, int l) {
  int i;
  for (i = 0; i < l; i++)
    *s++ = c;
  *s = '\0';
}


x86 assembly (clang, -O0):
<strfill>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1146 <strfill+0x46>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <strfill+0x18>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strfill>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %edx,%edx
jle    1135 <strfill+0x25>
mov    %edx,%ebx
mov    %edx,%edx
movzbl %sil,%esi
mov    %r14,%rdi
call   1030 <memset@plt>
add    $0xffffffff,%ebx
add    %rbx,%r14
add    $0x1,%r14
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strfill(i8* nocapture writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = add nsw i32 %2, -1
%8 = zext i32 %7 to i64
%9 = add nuw nsw i64 %8, 1
%10 = getelementptr i8, i8* %0, i64 %9
br label %11
11: ; preds = %5, %3
%12 = phi i8* [ %0, %3 ], [ %10, %5 ]
store i8 0, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_call(int, int /*<<< orphan*/, int);
void changeToSehllEnvironment() { sys_call(8, 0, 4); }


x86 assembly (clang, -O0):
<changeToSehllEnvironment>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeToSehllEnvironment>:
mov    $0x8,%edi
xor    %esi,%esi
mov    $0x4,%edx
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define void @changeToSehllEnvironment() {
%1 = call i32 @sys_call(i32 8, i32 0, i32 4)
ret void
}

LLVM IR (-O2):
define void @changeToSehllEnvironment() {
%1 = tail call i32 @sys_call(i32 8, i32 0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wait(int *);
void handler(int signo) {
  int stato;
  wait(&stato);
}


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

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <wait@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
ret void
}
int gfx_get_screen_w(void) { return 320; }


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

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

LLVM IR (-O0):
define i32 @gfx_get_screen_w() {
ret i32 320
}

LLVM IR (-O2):
define i32 @gfx_get_screen_w() {
ret i32 320
}
__attribute__((noipa, optimize("Ofast"))) int f8(float x) {
  return __builtin_sqrtf(x) < 0x1.50cb62p-65f;
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111f <f8+0xf>
sqrtss %xmm0,%xmm0
jmp    1124 <f8+0x14>
call   1030 <sqrtf@plt>
movss  0xed4(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f8(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
%5 = fcmp olt float %4, 0x3BE50CB620000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f8(float %0) {
%2 = tail call float @sqrtf(float %0)
%3 = fcmp olt float %2, 0x3BE50CB620000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xreparent_y(void *_p) {
  return (int)((XEvent *)_p)->xreparent.y;
}


x86 assembly (clang, -O0):
<get_XEvent_xreparent_y>:
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_xreparent_y>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xreparent_y(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_xreparent_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *xcalloc(int, size_t);
void *xmalloc(size_t sz) { return (xcalloc(1, sz)); }


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

x86 assembly (clang, -O2):
<xmalloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <xcalloc@plt>

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

LLVM IR (-O2):
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @xcalloc(i32 1, i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mp2vpicx_get_fcode01(const uint8_t *p_mp2vpicx) {
  return (p_mp2vpicx[5] >> 4);
}


x86 assembly (clang, -O0):
<mp2vpicx_get_fcode01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
sar    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_get_fcode01>:
mov    0x14(%rdi),%eax
sar    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpicx_get_fcode01(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = ashr i32 %5, 4
ret i32 %6
}

LLVM IR (-O2):
define i32 @mp2vpicx_get_fcode01(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
ret i32 %4
}
int eval_op(int n1, int n2, char op) {
  switch (op) {
  case '+':
    return n1 + n2;
  case '*':
    return n1 * n2;
  case '/':
    return n1 / n2;
  }
}


x86 assembly (clang, -O0):
<eval_op>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x2a,%eax
je     1154 <eval_op+0x54>
jmp    1124 <eval_op+0x24>
mov    -0x14(%rbp),%eax
sub    $0x2b,%eax
je     1146 <eval_op+0x46>
jmp    1135 <eval_op+0x35>
mov    -0x14(%rbp),%eax
sub    $0x2f,%eax
je     1163 <eval_op+0x63>
jmp    116d <eval_op+0x6d>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <eval_op+0x6d>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <eval_op+0x6d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_op>:
cmp    $0x2a,%edx
je     1114 <eval_op+0x14>
cmp    $0x2f,%edx
je     111a <eval_op+0x1a>
cmp    $0x2b,%edx
jne    1121 <eval_op+0x21>
add    %edi,%esi
mov    %esi,%eax
ret
imul   %edi,%esi
mov    %esi,%eax
ret
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @eval_op(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8 %2, i8* %7
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
switch i32 %9, label %22 [
i32 43, label %10
i32 42, label %14
i32 47, label %18
]
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
store i32 %13, i32* %4
br label %22
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = mul nsw i32 %15, %16
store i32 %17, i32* %4
br label %22
18: ; preds = %3
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = sdiv i32 %19, %20
store i32 %21, i32* %4
br label %22
22: ; preds = %10, %14, %18, %3
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @eval_op(i32 %0, i32 %1, i8 signext %2) {
%4 = sext i8 %2 to i32
switch i32 %4, label %11 [
i32 43, label %5
i32 42, label %7
i32 47, label %9
]
5: ; preds = %3
%6 = add nsw i32 %1, %0
br label %11
7: ; preds = %3
%8 = mul nsw i32 %1, %0
br label %11
9: ; preds = %3
%10 = sdiv i32 %0, %1
br label %11
11: ; preds = %5, %7, %9, %3
%12 = phi i32 [ undef, %3 ], [ %10, %9 ], [ %8, %7 ], [ %6, %5 ]
ret i32 %12
}
long long f(long long a) { return (a << 32) >> 32; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x20,%rax
sar    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 32
%5 = ashr i64 %4, 32
ret i64 %5
}

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = shl i64 %0, 32
%3 = ashr exact i64 %2, 32
ret i64 %3
}
/* Variables and functions */
unsigned long readl(void *);
unsigned long mmiof_read(void *iomem, unsigned long offset) {
  void *addr;
  addr = iomem + offset;
  unsigned long read_data = readl(addr);
  return read_data;
}


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

x86 assembly (clang, -O2):
<mmiof_read>:
add    %rsi,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i64 @mmiof_read(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = getelementptr i8, i8* %7, i64 %8
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i64 @readl(i8* %10)
store i64 %11, i64* %6
%12 = load i64, i64* %6
ret i64 %12
}

LLVM IR (-O2):
define i64 @mmiof_read(i8* %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 %1
%4 = tail call i64 @readl(i8* %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void cmat_abort(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<cmat_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cmat_abort>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @cmat_abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @cmat_abort(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr)
    error(1, 0, "virtual memory exhausted");
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <xmalloc+0x37>
mov    $0x1,%edi
xor    %esi,%esi
lea    0xeae(%rip),%rdx
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <xmalloc+0x21>
lea    0xecb(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_store_si128(int /*<<< orphan*/ *, int /*<<< orphan*/);
void store(const void *p, __m128i x) { _mm_store_si128((__m128i *)p, x); }


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

x86 assembly (clang, -O2):
<store>:
jmp    1030 <_mm_store_si128@plt>

LLVM IR (-O0):
define void @store(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
%8 = call i32 @_mm_store_si128(i32* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @store(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @_mm_store_si128(i32* %3, i32 %1)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c;
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  c = 0;
  while ((x == y) && (x > 0)) {
    while (y > 0) {
      x = x - 1;
      y = y - 1;
      c = c + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    1155 <main+0x45>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1165 <main+0x55>
jmp    1199 <main+0x89>
jmp    116a <main+0x5a>
cmpl   $0x0,-0x10(%rbp)
jle    1194 <main+0x84>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <main+0x5a>
jmp    113a <main+0x2a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int *getPtr(void) {
  int *ptr = (int *)malloc(sizeof(int));
  *ptr = 12345;
  return ptr;
}


x86 assembly (clang, -O0):
<getPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3039,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPtr>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0x3039,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i32* @getPtr() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32 12345, i32* %4
%5 = load i32*, i32** %1
ret i32* %5
}

LLVM IR (-O2):
define i32* @getPtr() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 12345, i32* %2
ret i32* %2
}
__attribute__((always_)) unsigned short __readw(const volatile void *addr) {
  unsigned short ret;
  asm volatile("mov"
               "w"
               " %1,%0"
               : "=r"(ret)
               : "m"(*(volatile unsigned short *)addr));
  return ret;
}


x86 assembly (clang, -O0):
<__readw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readw>:
mov    (%rdi),%ax
ret

LLVM IR (-O0):
define zeroext i16 @__readw(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i16*
%6 = call i16 asm sideeffect "movw $1,$0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %5)
store i16 %6, i16* %3
%7 = load i16, i16* %3
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @__readw(i8* %0) {
%2 = bitcast i8* %0 to i16*
%3 = tail call i16 asm sideeffect "movw $1,$0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %2)
ret i16 %3
}
int test14() { return (&*test14)(); }


x86 assembly (clang, -O0):
<test14>:
push   %rbp
mov    %rsp,%rbp
call   1030 <test14@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test14() {
br label %1
1: ; preds = %1, %0
br label %1
}
void fn7(void) {}


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

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

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

LLVM IR (-O2):
define void @fn7() {
ret void
}
/* Variables and functions */
double erf(double);
double erfr(double x) { return 0.5 + 0.5 * erf(x); }


x86 assembly (clang, -O0):
<erfr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <erf@plt>
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erfr>:
push   %rax
call   1030 <erf@plt>
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @erfr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @erf(double %3)
%5 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %4, double 5.000000e-01)
ret double %5
}

LLVM IR (-O2):
define double @erfr(double %0) {
%2 = tail call double @erf(double %0)
%3 = tail call double @llvm.fmuladd.f64(double %2, double 5.000000e-01, double 5.000000e-01)
ret double %3
}
/* Variables and functions */
unsigned int strlen(char *);
int /*<<< orphan*/ strncat(char *, char const *, unsigned int);
void scat(char *dst, const char *src, unsigned int siz) {
  strncat(dst, src, siz - strlen(dst) - 1);
  dst[siz - 1] = '\0';
}


x86 assembly (clang, -O0):
<scat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
sub    %eax,%edx
sub    $0x1,%edx
call   1040 <strncat@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scat>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
not    %eax
lea    (%rax,%rbx,1),%edx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strncat@plt>
add    $0xffffffff,%ebx
movb   $0x0,(%r15,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @scat(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = sub i32 %9, %11
%13 = sub i32 %12, 1
%14 = call i32 @strncat(i8* %7, i8* %8, i32 %13)
%15 = load i8*, i8** %4
%16 = load i32, i32* %6
%17 = sub i32 %16, 1
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
ret void
}

LLVM IR (-O2):
define void @scat(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = xor i32 %4, -1
%6 = add i32 %5, %2
%7 = tail call i32 @strncat(i8* %0, i8* %1, i32 %6)
%8 = add i32 %2, -1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
void ieee80211_sta_debugfs_remove(struct sta_info *sta) {}


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

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

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

LLVM IR (-O2):
%struct.sta_info = type opaque
define void @ieee80211_sta_debugfs_remove(%struct.sta_info* nocapture %0) {
ret void
}
/* Variables and functions */
void OPENSSL_fork_child(void) {}


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

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

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

LLVM IR (-O2):
define void @OPENSSL_fork_child() {
ret void
}
const char *hello(void) { return "XXXHello, world!" + 3; }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"XXXHello, world!\00"
define i8* @hello() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 3)
}

LLVM IR (-O2):
@.str = [17 x i8] c"XXXHello, world!\00"
define i8* @hello() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 3)
}
/* Variables and functions */
int /*<<< orphan*/ USB_PHY1_DriverIRQHandler();
__attribute__((weak)) void USB_PHY1_IRQHandler(void) {
  USB_PHY1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @USB_PHY1_IRQHandler() {
%1 = call i32 (...) @USB_PHY1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @USB_PHY1_IRQHandler() {
%1 = tail call i32 (...) @USB_PHY1_DriverIRQHandler()
ret void
}
/* Variables and functions */
char *strdup(const char *s) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @strdup(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, unsigned int);
void f4(int size) {
  char src[12] = "helloworld";
  char dest[12];
  if (size > 0)
    memmove(dest, src, (unsigned)size);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1149 <f4+0x39>
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
sub    $0x18,%rsp
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
test   %edi,%edi
jle    113d <f4+0x2d>
mov    %edi,%edx
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <memmove@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f4.src = [12 x i8] c"helloworld\00\00"
define void @f4(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8]
%4 = alloca [12 x i8]
store i32 %0, i32* %2
%5 = bitcast [12 x i8]* %3 to i8*
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @memmove(i8* %9, i8* %10, i32 %11)
br label %13
13: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@__const.f4.src = [12 x i8] c"helloworld\00\00"
define void @f4(i32 %0) {
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @memmove(i8* %5, i8* %4, i32 %0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ ReadHexUint8(char const *, scalar_t__, int /*<<< orphan*/ *);
bool DecodeStatus(int32_t length, const uint8_t *data, uint8_t *status) {
  return ReadHexUint8((const char *)data, length, status) == length;
}


x86 assembly (clang, -O0):
<DecodeStatus>:
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    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <ReadHexUint8@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecodeStatus>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <ReadHexUint8@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @DecodeStatus(i64 %0, i32* %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32*
store i64 %0, i64* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %5
%8 = bitcast i32* %7 to i8*
%9 = load i64, i64* %4
%10 = load i32*, i32** %6
%11 = call i64 @ReadHexUint8(i8* %8, i64 %9, i32* %10)
%12 = load i64, i64* %4
%13 = icmp eq i64 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @DecodeStatus(i64 %0, i32* %1, i32* %2) {
%4 = bitcast i32* %1 to i8*
%5 = tail call i64 @ReadHexUint8(i8* %4, i64 %0, i32* %2)
%6 = icmp eq i64 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ListDrawAct();
int /*<<< orphan*/ ListMakeActive(int);
void ListEnd() {
  ListMakeActive(65535);
  ListDrawAct();
}


x86 assembly (clang, -O0):
<ListEnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffff,%edi
call   1040 <ListMakeActive@plt>
mov    $0x0,%al
call   1030 <ListDrawAct@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ListEnd>:
push   %rax
mov    $0xffff,%edi
call   1040 <ListMakeActive@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ListDrawAct@plt>

LLVM IR (-O0):
define void @ListEnd() {
%1 = call i32 @ListMakeActive(i32 65535)
%2 = call i32 (...) @ListDrawAct()
ret void
}

LLVM IR (-O2):
define void @ListEnd() {
%1 = tail call i32 @ListMakeActive(i32 65535)
%2 = tail call i32 (...) @ListDrawAct()
ret void
}
void init_compression() {}


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

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

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

LLVM IR (-O2):
define void @init_compression() {
ret void
}
unsigned xrop3_119_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D & S;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_119_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_119_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_119_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = and i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = xor i32 %24, -1
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = xor i32 %27, -1
%29 = and i32 %26, %28
%30 = load i32, i32* %7
%31 = xor i32 %30, -1
%32 = and i32 %29, %31
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = and i32 %33, %34
%36 = or i32 %32, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %7
%39 = and i32 %37, %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_119_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
int myfloor(float x) { return (int)x; }


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

x86 assembly (clang, -O2):
<myfloor>:
cvttss2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @myfloor(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
/* Variables and functions */
int errno;
int syscall(int, int, char const *, void *, size_t);
int raw_openat2(int dfd, const char *path, void *how, size_t size) {
  int ret = syscall(437, dfd, path, how, size);
  return ret >= 0 ? ret : -errno;
}


x86 assembly (clang, -O0):
<raw_openat2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x1b5,%edi
call   1030 <syscall@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1158 <raw_openat2+0x48>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    1166 <raw_openat2+0x56>
xor    %eax,%eax
mov    0x2e7f(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_openat2>:
push   %rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1b5,%edi
call   1030 <syscall@plt>
mov    0x2eb3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovs  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @raw_openat2(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i32 @syscall(i32 437, i32 %10, i8* %11, i8* %12, i64 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = load i32, i32* %9
br label %22
19: ; preds = %4
%20 = load i32, i32* @errno
%21 = sub nsw i32 0, %20
br label %22
22: ; preds = %19, %17
%23 = phi i32 [ %18, %17 ], [ %21, %19 ]
ret i32 %23
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @raw_openat2(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @syscall(i32 437, i32 %0, i8* %1, i8* %2, i64 %3)
%6 = icmp sgt i32 %5, -1
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = select i1 %6, i32 %5, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ nop();
char serial_getc(int);
char getDebugChar() {
  char c;
  while ((c = serial_getc(1 + 1)) < 0)
    nop();
  ;
  return c;
}


x86 assembly (clang, -O0):
<getDebugChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <serial_getc@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
jge    114d <getDebugChar+0x2d>
mov    $0x0,%al
call   1030 <nop@plt>
jmp    1128 <getDebugChar+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDebugChar>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
call   1040 <serial_getc@plt>
test   %al,%al
jns    1147 <getDebugChar+0x27>
xor    %eax,%eax
call   1030 <nop@plt>
jmp    1130 <getDebugChar+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @getDebugChar() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = call signext i8 @serial_getc(i32 2)
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 (...) @nop()
br label %2
8: ; preds = %2
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @getDebugChar() {
%1 = tail call signext i8 @serial_getc(i32 2)
%2 = icmp slt i8 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @nop()
%5 = tail call signext i8 @serial_getc(i32 2)
%6 = icmp slt i8 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
%8 = phi i8 [ %1, %0 ], [ %5, %3 ]
ret i8 %8
}
unsigned bi_reverse(unsigned code, int len) {
  register unsigned res = 0;
  do {
    res |= code & 1;
    code >>= 1;
    res <<= 1;
  } while (--len > 0);
  return res >> 1;
}


x86 assembly (clang, -O0):
<bi_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jg     1111 <bi_reverse+0x11>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bi_reverse>:
add    $0x1,%esi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%eax
and    $0x1,%eax
or     %ecx,%eax
shr    %edi
lea    (%rax,%rax,1),%ecx
add    $0xffffffff,%esi
cmp    $0x1,%esi
jg     1110 <bi_reverse+0x10>
and    $0x7fffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @bi_reverse(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %9, %3 ]
%5 = phi i32 [ %1, %2 ], [ %11, %3 ]
%6 = phi i32 [ 0, %2 ], [ %10, %3 ]
%7 = and i32 %4, 1
%8 = or i32 %6, %7
%9 = lshr i32 %4, 1
%10 = shl i32 %8, 1
%11 = add nsw i32 %5, -1
%12 = icmp sgt i32 %5, 1
br i1 %12, label %3, label %13
13: ; preds = %3
%14 = and i32 %8, 2147483647
ret i32 %14
}
int noCompare(void *s1, void *s2) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @noCompare(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void kprint(const char *msg) {
  write(1, msg, sizeof(msg));
  return;
}


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

x86 assembly (clang, -O2):
<kprint>:
mov    %rdi,%rsi
mov    $0x1,%edi
mov    $0x8,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @kprint(i8* nocapture %0) {
%2 = tail call i32 @write(i32 1, i8* %0, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(void **);
void lfree(void *l, size_t *len) {
  void ***pl;
  assert(l != NULL);
  pl = l;
  free(*pl);
  *pl = NULL;
  *len = 0;
}


x86 assembly (clang, -O0):
<lfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfree>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
movq   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @lfree(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i8***
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i8***
store i8*** %11, i8**** %5
%12 = load i8***, i8**** %5
%13 = load i8**, i8*** %12
%14 = call i32 @free(i8** %13)
%15 = load i8***, i8**** %5
store i8** null, i8*** %15
%16 = load i64*, i64** %4
store i64 0, i64* %16
ret void
}

LLVM IR (-O2):
define void @lfree(i8* %0, i64* nocapture writeonly %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = bitcast i8* %0 to i8***
%7 = load i8**, i8*** %6
%8 = tail call i32 @free(i8** %7)
store i8** null, i8*** %6
store i64 0, i64* %1
ret void
}
void Quit(exitStatus) int exitStatus;
{
  RemoveTmpFiles();
  exit(exitStatus);
}


x86 assembly (clang, -O0):
<Quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <RemoveTmpFiles@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Quit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <RemoveTmpFiles@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @RemoveTmpFiles()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @Quit(i32 %0) {
%2 = tail call i32 (...) @RemoveTmpFiles()
tail call void @exit(i32 %0)
unreachable
}