xunge/DecIR huggingface dataset:
int test_imm_EBuint8_mem(unsigned char *val) {
  return ((*val) & (0xEB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_EBuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -21
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void Sound_Play(uint32_t period) {
  if (period == 0) {
    (*((volatile uint32_t *)0xE000E014)) = 0;
  } else {
    (*((volatile uint32_t *)0xE000E014)) = period - 1;
  }
}


x86 assembly (clang, -O0):
<Sound_Play>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1124 <Sound_Play+0x24>
mov    $0xe000e014,%eax
movq   $0x0,(%rax)
jmp    1134 <Sound_Play+0x34>
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
mov    $0xe000e014,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sound_Play>:
xor    %eax,%eax
sub    $0x1,%rdi
cmovae %rdi,%rax
mov    $0xe000e014,%ecx
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @Sound_Play(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store volatile i64 0, i64* inttoptr (i64 3758153748 to i64*)
br label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = sub nsw i64 %7, 1
store volatile i64 %8, i64* inttoptr (i64 3758153748 to i64*)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @Sound_Play(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = add nsw i64 %0, -1
%4 = select i1 %2, i64 0, i64 %3
store volatile i64 %4, i64* inttoptr (i64 3758153748 to i64*)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
scalar_t__ reduce32(scalar_t__);
uint32_t freeze(uint32_t a) {
  a = reduce32(a);
  a -= 8380417U;
  a += ((int32_t)a >> 31) & 8380417U;
  return a;
}


x86 assembly (clang, -O0):
<freeze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reduce32@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x7fe001,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1f,%eax
and    $0x7fe001,%eax
mov    %eax,%eax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeze>:
push   %rax
call   1030 <reduce32@plt>
lea    -0x7fe001(%rax),%rcx
test   $0x80000000,%ecx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @freeze(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @reduce32(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = sub nsw i64 %5, 8380417
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
%9 = ashr i32 %8, 31
%10 = and i32 %9, 8380417
%11 = zext i32 %10 to i64
%12 = load i64, i64* %2
%13 = add nsw i64 %12, %11
store i64 %13, i64* %2
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
define i64 @freeze(i64 %0) {
%2 = tail call i64 @reduce32(i64 %0)
%3 = add nsw i64 %2, -8380417
%4 = and i64 %3, 2147483648
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i64 %3, i64 %2
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ glutSpaceballButtonFunc(void (*)(int, int));
void s2winSpaceballButtonFunc(void (*func)(int button, int state)) {
  glutSpaceballButtonFunc(func);
}


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

x86 assembly (clang, -O2):
<s2winSpaceballButtonFunc>:
jmp    1030 <glutSpaceballButtonFunc@plt>

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

LLVM IR (-O2):
define void @s2winSpaceballButtonFunc(void (i32, i32)* %0) {
%2 = tail call i32 @glutSpaceballButtonFunc(void (i32, i32)* %0)
ret void
}
/* Variables and functions */
scalar_t__ pow(int, int);
void linfo_se(int len, int info, int *value1, int *dummy) {
  int n;
  n = (int)pow(2, (len / 2)) + info - 1;
  *value1 = (n + 1) / 2;
  if ((n & 0x01) == 0)
    *value1 = -*value1;
}


x86 assembly (clang, -O0):
<linfo_se>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
add    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1179 <linfo_se+0x69>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
sub    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linfo_se>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %edi,%esi
shr    $0x1f,%esi
add    %edi,%esi
sar    %esi
mov    $0x2,%edi
call   1030 <pow@plt>
add    %ebp,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %ecx,%edx
neg    %edx
test   $0x1,%al
cmove  %ecx,%edx
mov    %edx,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @linfo_se(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 2
%12 = call i64 @pow(i32 2, i32 %11)
%13 = trunc i64 %12 to i32
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %9
%17 = load i32, i32* %9
%18 = add nsw i32 %17, 1
%19 = sdiv i32 %18, 2
%20 = load i32*, i32** %7
store i32 %19, i32* %20
%21 = load i32, i32* %9
%22 = and i32 %21, 1
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %4
%25 = load i32*, i32** %7
%26 = load i32, i32* %25
%27 = sub nsw i32 0, %26
%28 = load i32*, i32** %7
store i32 %27, i32* %28
br label %29
29: ; preds = %24, %4
ret void
}

LLVM IR (-O2):
define void @linfo_se(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture readnone %3) {
%5 = sdiv i32 %0, 2
%6 = tail call i64 @pow(i32 2, i32 %5)
%7 = trunc i64 %6 to i32
%8 = add nsw i32 %7, %1
%9 = sdiv i32 %8, 2
%10 = and i32 %8, 1
%11 = icmp eq i32 %10, 0
%12 = sub nsw i32 0, %9
%13 = select i1 %11, i32 %9, i32 %12
store i32 %13, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Wreg(int);
int /*<<< orphan*/ Ws(char *);
int /*<<< orphan*/ Wx(int, int);
int Winst3(int i, int code) {
  Ws("cpi   ");
  Wreg(((code >> 4) & 0xF) + 16);
  Ws(", $");
  Wx(((code >> 4) & 0xF0) | (code & 0x0F), 1);
  return 0;
}


x86 assembly (clang, -O0):
<Winst3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
call   1030 <Ws@plt>
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
and    $0xf,%edi
add    $0x10,%edi
call   1050 <Wreg@plt>
lea    0xea5(%rip),%rdi
call   1030 <Ws@plt>
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
and    $0xf0,%edi
mov    -0x8(%rbp),%eax
and    $0xf,%eax
or     %eax,%edi
mov    $0x1,%esi
call   1040 <Wx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Winst3>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
lea    0xec4(%rip),%rdi
call   1030 <Ws@plt>
mov    %ebx,%ebp
sar    $0x4,%ebp
mov    %ebp,%edi
and    $0xf,%edi
or     $0x10,%edi
call   1050 <Wreg@plt>
lea    0xead(%rip),%rdi
call   1030 <Ws@plt>
and    $0xf0,%ebp
and    $0xf,%ebx
or     %ebp,%ebx
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <Wx@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"cpi \00"
@.str.1 = [4 x i8] c", $\00"
define i32 @Winst3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @Ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
%7 = ashr i32 %6, 4
%8 = and i32 %7, 15
%9 = add nsw i32 %8, 16
%10 = call i32 @Wreg(i32 %9)
%11 = call i32 @Ws(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %4
%13 = ashr i32 %12, 4
%14 = and i32 %13, 240
%15 = load i32, i32* %4
%16 = and i32 %15, 15
%17 = or i32 %14, %16
%18 = call i32 @Wx(i32 %17, i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"cpi \00"
@.str.1 = [4 x i8] c", $\00"
define i32 @Winst3(i32 %0, i32 %1) {
%3 = tail call i32 @Ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = ashr i32 %1, 4
%5 = and i32 %4, 15
%6 = or i32 %5, 16
%7 = tail call i32 @Wreg(i32 %6)
%8 = tail call i32 @Ws(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = and i32 %4, 240
%10 = and i32 %1, 15
%11 = or i32 %9, %10
%12 = tail call i32 @Wx(i32 %11, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "id"
        " [-Ggu][-nr] [user]\n  -G	Output all different group IDs\n  "
        "-g	Output only the effective group ID\n  -u	Output only "
        "the effective user ID\n  -n	Output the name as a string\n  "
        "-r	Output the real ID instead of the effective ID\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [230 x i8] c"Usage: id [-Ggu][-nr] [user]\0A -G\09Output all different group IDs\0A -g\09Output only the effective group ID\0A -u\09Output only the effective user ID\0A -n\09Output the name as a string\0A -r\09Output the real ID instead of the effective ID\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [230 x i8] c"Usage: id [-Ggu][-nr] [user]\0A -G\09Output all different group IDs\0A -g\09Output only the effective group ID\0A -u\09Output only the effective user ID\0A -n\09Output the name as a string\0A -r\09Output the real ID instead of the effective ID\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
int blStrLen(const char *string) {
  int i = 0;
  for (; *string++; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<blStrLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     113a <blStrLen+0x3a>
jmp    112c <blStrLen+0x2c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <blStrLen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blStrLen>:
cmpb   $0x0,(%rdi)
je     111c <blStrLen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <blStrLen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @blStrLen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  sleep(1);
  int a = 2;
  printf("%lx %d\n", &a, a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <sleep@plt>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xebd(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
movl   $0x2,0x4(%rsp)
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x2,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%lx %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @sleep(i32 1)
%3 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1, i32 2)
ret i32 0
}
int BTIC4B_Pred_HalfLin(int a, int b, int c) {
  return ((3 * a + 3 * b - 2 * c) >> 2);
}


x86 assembly (clang, -O0):
<BTIC4B_Pred_HalfLin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x3,-0x4(%rbp),%eax
imul   $0x3,-0x8(%rbp),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BTIC4B_Pred_HalfLin>:
add    %esi,%edi
lea    (%rdi,%rdi,2),%eax
add    %edx,%edx
sub    %edx,%eax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @BTIC4B_Pred_HalfLin(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 3, %7
%9 = load i32, i32* %5
%10 = mul nsw i32 3, %9
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 2, %12
%14 = sub nsw i32 %11, %13
%15 = ashr i32 %14, 2
ret i32 %15
}

LLVM IR (-O2):
define i32 @BTIC4B_Pred_HalfLin(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, %0
%5 = mul i32 %4, 3
%6 = mul i32 %2, -2
%7 = add i32 %6, %5
%8 = ashr i32 %7, 2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ perrordie(char *);
void *realloc(void *, size_t);
void *safe_realloc(void *ptr, size_t s) {
  ptr = realloc(ptr, s);
  if (ptr == NULL)
    perrordie("malloc");
  return ptr;
}


x86 assembly (clang, -O0):
<safe_realloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1158 <safe_realloc+0x38>
lea    0xead(%rip),%rdi
call   1030 <perrordie@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <safe_realloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <perrordie@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perrordie(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int ssize_t;

/* Variables and functions */
int stat(char const *, struct stat *);
ssize_t fs_size(const char *filename) {
  struct stat sb;
  int ret;
  ret = stat(filename, &sb);
  if (ret == 0)
    return (ssize_t)sb.st_size;
  return -1;
}


x86 assembly (clang, -O0):
<fs_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1141 <fs_size+0x31>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <fs_size+0x38>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %eax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fs_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fs_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
void bf_flip(unsigned char *data, int index) {
  int byte_index = (int)(index / 8);
  unsigned char bit_mask = 0x01 << (index % 8);
  unsigned char value = ~(data[byte_index] & bit_mask) & bit_mask;
  data[byte_index] = (data[byte_index] & ~bit_mask) | value;
}


x86 assembly (clang, -O0):
<bf_flip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
movzbl -0x11(%rbp),%ecx
and    %ecx,%eax
xor    $0xffffffff,%eax
movzbl -0x11(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
movzbl -0x11(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0x12(%rbp),%ecx
or     %ecx,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_flip>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
cltq
xor    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @bf_flip(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = srem i32 %10, 8
%12 = shl i32 1, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %6
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = and i32 %19, %21
%23 = xor i32 %22, -1
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8*, i8** %3
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = load i8, i8* %7
%39 = zext i8 %38 to i32
%40 = or i32 %37, %39
%41 = trunc i32 %40 to i8
%42 = load i8*, i8** %3
%43 = load i32, i32* %5
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
store i8 %41, i8* %45
ret void
}

LLVM IR (-O2):
define void @bf_flip(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = and i32 %1, 7
%5 = shl nuw nsw i32 1, %4
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %5 to i8
%10 = xor i8 %8, %9
store i8 %10, i8* %7
ret void
}
void X509V3_EXT_add_list(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_add_list() {
ret void
}
void prcmdebug_dump(int flags) {}


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

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

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

LLVM IR (-O2):
define void @prcmdebug_dump(i32 %0) {
ret void
}
/* Variables and functions */
double __math_check_uflow(double);
double check_uflow(double x) { return 1 ? __math_check_uflow(x) : x; }


x86 assembly (clang, -O0):
<check_uflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__math_check_uflow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_uflow>:
jmp    1030 <__math_check_uflow@plt>

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

LLVM IR (-O2):
define double @check_uflow(double %0) {
%2 = tail call double @__math_check_uflow(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ isns_error(char *, char const *, unsigned int, char const *);
void isns_assert_failed(const char *condition, const char *file,
                        unsigned int line) {
  isns_error("Assertion failed (%s:%d): %s\n", file, line, condition);
  abort();
}


x86 assembly (clang, -O0):
<isns_assert_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xebb(%rip),%rdi
call   1040 <isns_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<isns_assert_failed>:
push   %rax
mov    %rdi,%rcx
lea    0xed5(%rip),%rdi
call   1040 <isns_error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Assertion failed (%s:%d): %s\0A\00"
define void @isns_assert_failed(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** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @isns_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [30 x i8] c"Assertion failed (%s:%d): %s\0A\00"
define void @isns_assert_failed(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @isns_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%5 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PEMU_getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ RLIMIT_CPU;
int init_main() {
  struct rlimit rl;
  PEMU_getrlimit(RLIMIT_CPU, &rl);
  return 0;
}


x86 assembly (clang, -O0):
<init_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <PEMU_getrlimit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <PEMU_getrlimit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_CPU = global i32 0
define i32 @init_main() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_CPU
%3 = call i32 @PEMU_getrlimit(i32 %2, %struct.rlimit* %1)
ret i32 0
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_CPU = global i32 0
define i32 @init_main() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_CPU
%4 = call i32 @PEMU_getrlimit(i32 %3, %struct.rlimit* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(void *, void *);
int cmp_cb(void *src, void *param) {
  int res = 0;
  if (strcmp(src, param) == 0)
    return res;
  return -1;
}


x86 assembly (clang, -O0):
<cmp_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1149 <cmp_cb+0x39>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <cmp_cb+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_cb>:
push   %rax
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmp_cb(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i64 @strcmp(i8* %7, i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %6
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp_cb(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
R0AX1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (r0 <= (((short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movswl -0x6(%rbp),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1144 <R0AX1+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <R0AX1+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0AX1>:
movswl %di,%edx
movslq %ecx,%rax
movswl 0xa98ac7(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    %ecx,%edx
setle  %al
ret

LLVM IR (-O0):
define i32 @R0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %8
%17 = sext i16 %16 to i32
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %19
%21 = load i16, i16* %20
%22 = sext i16 %21 to i32
%23 = icmp sle i32 %17, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @R0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = shl i32 %0, 16
%8 = ashr exact i32 %7, 16
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %9
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = icmp sle i32 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpngt_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpngt_sd(__m128d __a, __m128d __b) {
  return _mm_cmpngt_sd(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpngt_sd>:
jmp    1030 <_mm_cmpngt_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpngt_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpngt_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
void *memcpy(void *, void *, size_t);
void *xalloc(size_t);
void *memdup(void *mem, size_t len) {
  void *ret;
  if (!mem)
    return NULL;
  ret = xalloc(len);
  return memcpy(ret, mem, len);
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <memdup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    116a <memdup+0x4a>
mov    -0x18(%rbp),%rdi
call   1040 <xalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     114b <memdup+0x2b>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <xalloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
jmp    114e <memdup+0x2e>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @memdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i8* null, i8** %3
br label %17
10: ; preds = %2
%11 = load i64, i64* %5
%12 = call i8* @xalloc(i64 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = call i8* @memcpy(i8* %13, i8* %14, i64 %15)
store i8* %16, i8** %3
br label %17
17: ; preds = %10, %9
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @xalloc(i64 %1)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 %0, i64 %1, i1 false)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %7
}
int main() {
  int c;
  c = 0;
  do
    ;
  while (0);
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    1117 <main+0x17>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0
br label %4
4: ; preds = %3
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
char *str_cpy(char *begin, size_t len, char buffer[len + 1]) {
  memcpy(buffer, begin, len);
  buffer[len] = '\0';
  return buffer;
}


x86 assembly (clang, -O0):
<str_cpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    %r14,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @str_cpy(i8* %0, i64 %1, i8* returned %2) {
%4 = tail call i32 @memcpy(i8* %2, i8* %0, i64 %1)
%5 = getelementptr inbounds i8, i8* %2, i64 %1
store i8 0, i8* %5
ret i8* %2
}
/* Variables and functions */
int num_jewels_in_stones(char const *, char const *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  const char *J = "aA";
  const char *S = "aAAbbbb";
  int result = num_jewels_in_stones(J, S);
  printf("%d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <num_jewels_in_stones@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <num_jewels_in_stones@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"aA\00"
@.str.1 = [8 x i8] c"aAAbbbb\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @num_jewels_in_stones(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 0
}
void flip() { asm volatile("movl $0xE, %%eax; int $0x80" : : : "eax"); }


x86 assembly (clang, -O0):
<flip>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%eax
int    $0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip>:
mov    $0xe,%eax
int    $0x80
ret

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

LLVM IR (-O2):
define void @flip() {
tail call void asm sideeffect "movl $$0xE, %eax; int $$0x80", "~{eax},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matNd_mult_vecNd_new(double *, double const *,
                                        double const *, int);
void mat3d_mult_vec3d_new(double result[3], const double m[9],
                          const double v[3]) {
  matNd_mult_vecNd_new(result, m, v, 3);
}


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

x86 assembly (clang, -O2):
<mat3d_mult_vec3d_new>:
mov    $0x3,%ecx
jmp    1030 <matNd_mult_vecNd_new@plt>

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

LLVM IR (-O2):
define void @mat3d_mult_vec3d_new(double* %0, double* %1, double* %2) {
%4 = tail call i32 @matNd_mult_vecNd_new(double* %0, double* %1, double* %2, i32 3)
ret void
}
void PendSV_Handler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @PendSV_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ free;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int const, void *);
void debug_free(void *ptr, const char *file, const int line) {
  printf("%s:%d: free(%p)\n", file, line, ptr);
  (free)(ptr);
}


x86 assembly (clang, -O0):
<debug_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_free>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s:%d: free(%p)\0A\00"
define void @debug_free(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** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = load i8*, i8** %4
%12 = ptrtoint i8* %11 to i32
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s:%d: free(%p)\0A\00"
define void @debug_free(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
void **vvector(long nl, long nh) {
  void **v;
  v = (void **)malloc((size_t)((nh - nl + 1 + 0) * sizeof(void *)));
  if (!v)
    nrerror("allocation failure in vvector()");
  return v - nl + 0;
}


x86 assembly (clang, -O0):
<vvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x0,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <vvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <vvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in vvector()\00"
define i8** @vvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8**
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 0
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8**
store i8** %13, i8*** %5
%14 = load i8**, i8*** %5
%15 = icmp ne i8** %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i8**, i8*** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = getelementptr inbounds i8*, i8** %22, i64 0
ret i8** %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in vvector()\00"
define i8** @vvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i8**
%12 = sub i64 0, %0
%13 = getelementptr inbounds i8*, i8** %11, i64 %12
ret i8** %13
}
/* Variables and functions */
int /*<<< orphan*/ __you_should_not_divide_ll_in_debugger_sw();
long long __moddi3(long long A, long long B) {
  __you_should_not_divide_ll_in_debugger_sw();
  return 0;
}


x86 assembly (clang, -O0):
<__moddi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__you_should_not_divide_ll_in_debugger_sw@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @__moddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 (...) @__you_should_not_divide_ll_in_debugger_sw()
ret i64 0
}

LLVM IR (-O2):
define i64 @__moddi3(i64 %0, i64 %1) {
%3 = tail call i32 (...) @__you_should_not_divide_ll_in_debugger_sw()
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ func_4(int /*<<< orphan*/);
void testTortureExecute(void) {
  func_4(0);
  return;
}


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

x86 assembly (clang, -O2):
<testTortureExecute>:
xor    %edi,%edi
jmp    1030 <func_4@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @func_4(i32 0)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @func_4(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Lut_N(double *, double *, int);
void Lut_13(double *out, double *in) { Lut_N(out, in, 13); }


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

x86 assembly (clang, -O2):
<Lut_13>:
mov    $0xd,%edx
jmp    1030 <Lut_N@plt>

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

LLVM IR (-O2):
define void @Lut_13(double* %0, double* %1) {
%3 = tail call i32 @Lut_N(double* %0, double* %1, i32 13)
ret void
}
/* Variables and functions */
int abs(int);
int sign(int);
int MaxForce(int Max, int Val) {
  if (abs(Max) > abs(Val)) {
    return Val;
  } else {
    return abs(Max) * sign(Val);
  }
}


x86 assembly (clang, -O0):
<MaxForce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jle    1159 <MaxForce+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <MaxForce+0x57>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <sign@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MaxForce>:
push   %rbx
mov    %esi,%eax
mov    %edi,%ebx
neg    %ebx
cmovs  %edi,%ebx
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
cmp    %ecx,%ebx
ja     112f <MaxForce+0x1f>
mov    %eax,%edi
call   1030 <sign@plt>
imul   %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @MaxForce(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%5 = icmp ugt i32 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @sign(i32 %1)
%8 = mul nsw i32 %7, %3
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ %1, %2 ]
ret i32 %10
}
int do_118() { return 118; }


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

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

LLVM IR (-O0):
define i32 @do_118() {
ret i32 118
}

LLVM IR (-O2):
define i32 @do_118() {
ret i32 118
}