xunge/DecIR huggingface dataset:
/* Variables and functions */
int A_BOLD;
int A_NORMAL;
int COLOR_PAIR(int /*<<< orphan*/);
int /*<<< orphan*/ player_color(int);
int player_style(int p) {
  if (p != 0)
    return A_BOLD | COLOR_PAIR(player_color(p));
  else
    return A_NORMAL | COLOR_PAIR(player_color(p));
}


x86 assembly (clang, -O0):
<player_style>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115f <player_style+0x3f>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <player_color@plt>
mov    %eax,%edi
call   1030 <COLOR_PAIR@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <player_style+0x64>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <player_color@plt>
mov    %eax,%edi
call   1030 <COLOR_PAIR@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<player_style>:
push   %rbx
test   %edi,%edi
jne    112e <player_style+0xe>
mov    0x2ebc(%rip),%rax
jmp    1135 <player_style+0x15>
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebx
call   1040 <player_color@plt>
mov    %eax,%edi
call   1030 <COLOR_PAIR@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@A_BOLD = global i32 0
@A_NORMAL = global i32 0
define i32 @player_style(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* @A_BOLD
%8 = load i32, i32* %3
%9 = call i32 @player_color(i32 %8)
%10 = call i32 @COLOR_PAIR(i32 %9)
%11 = or i32 %7, %10
store i32 %11, i32* %2
br label %18
12: ; preds = %1
%13 = load i32, i32* @A_NORMAL
%14 = load i32, i32* %3
%15 = call i32 @player_color(i32 %14)
%16 = call i32 @COLOR_PAIR(i32 %15)
%17 = or i32 %13, %16
store i32 %17, i32* %2
br label %18
18: ; preds = %12, %6
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@A_BOLD = global i32 0
@A_NORMAL = global i32 0
define i32 @player_style(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @A_NORMAL
%4 = load i32, i32* @A_BOLD
%5 = select i1 %2, i32 %3, i32 %4
%6 = tail call i32 @player_color(i32 %0)
%7 = tail call i32 @COLOR_PAIR(i32 %6)
%8 = or i32 %7, %5
ret i32 %8
}
int test_imm_8Aint16_mem(short *val) {
  return ((*val) & (-0x8A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Aint16_mem>:
movzwl (%rdi),%eax
test   $0xff76,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Aint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -138
%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_8Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -138
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void main(int foo) {
  float k;
  int i;
  float j;
  { j++; }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  0xef1(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %2
%6 = load float, float* %5
%7 = fadd float %6, 1.000000e+00
store float %7, float* %5
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
ret void
}
unsigned int f76(unsigned int x, int y __attribute__((unused))) {
  return (x << ((-1) & (8 * sizeof(unsigned int) - 1))) + (x >> 1);
}


x86 assembly (clang, -O0):
<f76>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f76>:
mov    %edi,%eax
ror    %eax
ret

LLVM IR (-O0):
define i32 @f76(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 = shl i32 %5, 31
%7 = load i32, i32* %3
%8 = lshr i32 %7, 1
%9 = add i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f76(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

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


x86 assembly (clang, -O0):
<test_mm_cmpeq_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_cmpeq_sd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_cmpeq_sd>:
jmp    1030 <_mm_cmpeq_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_cmpeq_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_cmpeq_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmpeq_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_sd(i32 %0, i32 %1)
ret i32 %3
}
void XtAppAddBlockHook() {}


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

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

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

LLVM IR (-O2):
define void @XtAppAddBlockHook() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR(int);
int RND();
int /*<<< orphan*/ draw_circle(int, int, int);
void main() {
  while (1) {
    COLOR(RND());
    draw_circle(RND() & 0xff, RND() & 0xff, (RND() & 0x1f) + 16);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    113d <main+0xd>
mov    $0x0,%al
call   1040 <RND@plt>
mov    %eax,%edi
call   1050 <COLOR@plt>
mov    $0x0,%al
call   1040 <RND@plt>
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <RND@plt>
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <RND@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
and    $0x1f,%edx
mov    %edx,-0x8(%rbp)
add    $0x10,%edx
mov    %edx,-0x4(%rbp)
call   1030 <draw_circle@plt>
jmp    113d <main+0xd>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <RND@plt>
mov    %eax,%edi
call   1050 <COLOR@plt>
xor    %eax,%eax
call   1040 <RND@plt>
movzbl %al,%ebx
xor    %eax,%eax
call   1040 <RND@plt>
movzbl %al,%ebp
xor    %eax,%eax
call   1040 <RND@plt>
and    $0x1f,%eax
lea    0x10(%rax),%edx
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <draw_circle@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @RND()
%3 = call i32 @COLOR(i32 %2)
%4 = call i32 (...) @RND()
%5 = and i32 %4, 255
%6 = call i32 (...) @RND()
%7 = and i32 %6, 255
%8 = call i32 (...) @RND()
%9 = and i32 %8, 31
%10 = add nsw i32 %9, 16
%11 = call i32 @draw_circle(i32 %5, i32 %7, i32 %10)
br label %1
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @RND()
%3 = tail call i32 @COLOR(i32 %2)
%4 = tail call i32 (...) @RND()
%5 = and i32 %4, 255
%6 = tail call i32 (...) @RND()
%7 = and i32 %6, 255
%8 = tail call i32 (...) @RND()
%9 = and i32 %8, 31
%10 = add nuw nsw i32 %9, 16
%11 = tail call i32 @draw_circle(i32 %5, i32 %7, i32 %10)
br label %1
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *week_based_year(char *buf, char *end, int n, const struct tm *t) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @week_based_year(i8* %0, i8* %1, i32 %2, %struct.tm* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.tm*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.tm* %3, %struct.tm** %8
ret i8* null
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define noalias i8* @week_based_year(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, %struct.tm* nocapture readnone %3) {
ret i8* null
}
/* Variables and functions */
scalar_t__ sys_double_time();
float sys_float_time() { return (float)sys_double_time(); }


x86 assembly (clang, -O0):
<sys_float_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sys_double_time@plt>
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_float_time>:
push   %rax
xor    %eax,%eax
call   1030 <sys_double_time@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sys_float_time() {
%1 = call i64 (...) @sys_double_time()
%2 = sitofp i64 %1 to float
ret float %2
}

LLVM IR (-O2):
define float @sys_float_time() {
%1 = tail call i64 (...) @sys_double_time()
%2 = sitofp i64 %1 to float
ret float %2
}
int ChkDesCtxLen(unsigned long len) {
  return len != 0 && len != (8) != 0 ? (0) : (1);
}


x86 assembly (clang, -O0):
<ChkDesCtxLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     112e <ChkDesCtxLen+0x2e>
cmpq   $0x8,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChkDesCtxLen>:
xor    %eax,%eax
test   $0xfffffffffffffff7,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ChkDesCtxLen(i64 %0) {
%2 = and i64 %0, -9
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ progNew();
void progExit(void) { progNew(); }


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

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

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

LLVM IR (-O2):
define void @progExit() {
%1 = tail call i32 (...) @progNew()
ret void
}
void Vector_Add(float vectorOut[3], float vectorIn1[3], float vectorIn2[3]) {
  int c = 0;
  while (c < 3) {
    vectorOut[c] = vectorIn1[c] + vectorIn2[c];
    c++;
  }
}


x86 assembly (clang, -O0):
<Vector_Add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1156 <Vector_Add+0x56>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <Vector_Add+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector_Add>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
addss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @Vector_Add(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int p3n(long n) {
  printf("\n***%d\n", n);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"\0A***%d\0A\00"
define i32 @p3n(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 0
}
void glwin_destroy(void *voidhandle) { return; }


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

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

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

LLVM IR (-O2):
define void @glwin_destroy(i8* nocapture %0) {
ret void
}
int long_float_lt_xxxx(long a, long b) {
  if (a < 0) {
    a = 0x8000000000000000lu - a;
  }
  if (b < 0) {
    b = 0x8000000000000000lu - b;
  }
  return a < b;
}


x86 assembly (clang, -O0):
<long_float_lt_xxxx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1129 <long_float_lt_xxxx+0x29>
movabs $0x8000000000000000,%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1146 <long_float_lt_xxxx+0x46>
movabs $0x8000000000000000,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_float_lt_xxxx>:
movabs $0x8000000000000000,%rcx
mov    %rcx,%rdx
sub    %rdi,%rdx
test   %rdi,%rdi
cmovns %rdi,%rdx
sub    %rsi,%rcx
test   %rsi,%rsi
cmovns %rsi,%rcx
xor    %eax,%eax
cmp    %rcx,%rdx
setl   %al
ret

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

LLVM IR (-O2):
define i32 @long_float_lt_xxxx(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, 0
%4 = sub i64 -9223372036854775808, %0
%5 = select i1 %3, i64 %4, i64 %0
%6 = icmp slt i64 %1, 0
%7 = sub i64 -9223372036854775808, %1
%8 = select i1 %6, i64 %7, i64 %1
%9 = icmp slt i64 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int *, int /*<<< orphan*/);
void wait4children(int signo) {
  int status;
  while (waitpid(-1, &status, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<wait4children>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <wait4children+0x31>
jmp    111b <wait4children+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait4children>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
lea    0x4(%rsp),%rbx
mov    (%r14),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <wait4children+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @wait4children(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* @WNOHANG
%6 = call i64 @waitpid(i32 -1, i32* %3, i32 %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @wait4children(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = load i32, i32* @WNOHANG
%6 = call i64 @waitpid(i32 -1, i32* %2, i32 %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
unsigned long long memory_patient_next_id() {
  ;
  static unsigned long long id = 0;
  id++;
  return id;
}


x86 assembly (clang, -O0):
<memory_patient_next_id>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1d(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f12(%rip)
mov    0x2f0b(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_patient_next_id>:
mov    0x2f21(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f16(%rip)
ret

LLVM IR (-O0):
@memory_patient_next_id.id = internal global i64 0
define i64 @memory_patient_next_id() {
%1 = load i64, i64* @memory_patient_next_id.id
%2 = add i64 %1, 1
store i64 %2, i64* @memory_patient_next_id.id
%3 = load i64, i64* @memory_patient_next_id.id
ret i64 %3
}

LLVM IR (-O2):
@memory_patient_next_id.id = internal unnamed_addr global i64 0
define i64 @memory_patient_next_id() {
%1 = load i64, i64* @memory_patient_next_id.id
%2 = add i64 %1, 1
store i64 %2, i64* @memory_patient_next_id.id
ret i64 %2
}
float foo006(float a, double b, double c) { return (a - b * c); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
cvtss2sd %xmm0,%xmm0
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @foo006(float %0, double %1, double %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca double
store float %0, float* %4
store double %1, double* %5
store double %2, double* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fneg double %9
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double %8)
%13 = fptrunc double %12 to float
ret float %13
}

LLVM IR (-O2):
define float @foo006(float %0, double %1, double %2) {
%4 = fpext float %0 to double
%5 = fneg double %1
%6 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %4)
%7 = fptrunc double %6 to float
ret float %7
}
int test_imm_2Duint32_mem(unsigned int *val) {
  return ((*val) & (0x2D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Duint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 45
%6 = icmp ne i32 %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_2Duint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 45
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bufoverflow();
int main() {
  bufoverflow();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bufoverflow()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
time_t getFileModTime(const char *filename) {
  struct stat st;
  if (!stat(filename, &st))
    return st.st_mtime;
  else
    return 0;
}


x86 assembly (clang, -O0):
<getFileModTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
jne    113d <getFileModTime+0x2d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <getFileModTime+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileModTime>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    1124 <getFileModTime+0x14>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @getFileModTime(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 0
ret i32 %8
}
mnem_call(sname) char *sname;
{
  ot("CALL ");
  outstr(sname);
  nl();
}


x86 assembly (clang, -O0):
<mnem_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outstr@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mnem_call>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outstr@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"CALL \00"
define i32 @mnem_call(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %5)
%7 = call i32 (...) @nl()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"CALL \00"
define i32 @mnem_call(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (...) @nl()
ret i32 undef
}
int fun_1(int i, short *a) { return a[0] + a[100] + a[1]; }


x86 assembly (clang, -O0):
<fun_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
mov    -0x10(%rbp),%rcx
movswl 0xc8(%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movswl 0x2(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_1>:
movswl (%rsi),%eax
movswl 0xc8(%rsi),%ecx
add    %eax,%ecx
movswl 0x2(%rsi),%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fun_1(i32 %0, i16* nocapture %1) {
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = getelementptr inbounds i16, i16* %1, i64 100
%6 = load i16, i16* %5
%7 = sext i16 %6 to i32
%8 = add nsw i32 %7, %4
%9 = getelementptr inbounds i16, i16* %1, i64 1
%10 = load i16, i16* %9
%11 = sext i16 %10 to i32
%12 = add nsw i32 %8, %11
ret i32 %12
}
void DBGFR3OSRegister(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3OSRegister() {
ret void
}
void po_hash_error(char *s) {}


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

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

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

LLVM IR (-O2):
define void @po_hash_error(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, short *);
short getPasswordLengthInput(void) {
  printf("\nEnter a password length between 1 to 32 inclusive. 0 to go back: ");
  short input;
  scanf("%hi", &input);
  return input;
}


x86 assembly (clang, -O0):
<getPasswordLengthInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
lea    -0x2(%rbp),%rsi
call   1040 <scanf@plt>
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPasswordLengthInput>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
lea    0x6(%rsp),%rsi
call   1040 <scanf@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [67 x i8] c"\0AEnter a password length between 1 to 32 inclusive. 0 to go back: \00"
@.str.1 = [4 x i8] c"%hi\00"
define signext i16 @getPasswordLengthInput() {
%1 = alloca i16
%2 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i16* %1)
%4 = load i16, i16* %1
ret i16 %4
}

LLVM IR (-O2):
@.str = [67 x i8] c"\0AEnter a password length between 1 to 32 inclusive. 0 to go back: \00"
@.str.1 = [4 x i8] c"%hi\00"
define signext i16 @getPasswordLengthInput() {
%1 = alloca i16
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i16* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i16* %1)
%5 = load i16, i16* %1
ret i16 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ update_crc_ne(int /*<<< orphan*/, int, void *, int, int,
                                 int);
uint32_t f_update_crc_ne(uint32_t *old_crc, int *crclen, void *data,
                         int *datasiz, int *datalen, int *mode) {
  return update_crc_ne(*old_crc, *crclen, data, *datasiz, *datalen, *mode);
}


x86 assembly (clang, -O0):
<f_update_crc_ne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%rax
mov    (%rax),%r9d
call   1030 <update_crc_ne@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_update_crc_ne>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rcx),%ecx
mov    (%r8),%r8d
mov    (%r9),%r9d
jmp    1030 <update_crc_ne@plt>

LLVM IR (-O0):
define i32 @f_update_crc_ne(i32* %0, i32* %1, i8* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i8* %2, i8** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i8*, i8** %9
%18 = load i32*, i32** %10
%19 = load i32, i32* %18
%20 = load i32*, i32** %11
%21 = load i32, i32* %20
%22 = load i32*, i32** %12
%23 = load i32, i32* %22
%24 = call i32 @update_crc_ne(i32 %14, i32 %16, i8* %17, i32 %19, i32 %21, i32 %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @f_update_crc_ne(i32* nocapture %0, i32* nocapture %1, i8* %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %1
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = tail call i32 @update_crc_ne(i32 %7, i32 %8, i8* %2, i32 %9, i32 %10, i32 %11)
ret i32 %12
}
void crt_drv_uninit(struct crt_drv *drv) {}


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

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

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

LLVM IR (-O2):
%struct.crt_drv = type opaque
define void @crt_drv_uninit(%struct.crt_drv* nocapture %0) {
ret void
}
void test_109(unsigned short *x, unsigned int *y) { y[0] = x[1] >> 10; }


x86 assembly (clang, -O0):
<test_109>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
sar    $0xa,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_109>:
movzwl 0x2(%rdi),%eax
shr    $0xa,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @test_109(i16* %0, i32* %1) {
%3 = alloca i16*
%4 = alloca i32*
store i16* %0, i16** %3
store i32* %1, i32** %4
%5 = load i16*, i16** %3
%6 = getelementptr inbounds i16, i16* %5, i64 1
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 10
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @test_109(i16* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = lshr i16 %4, 10
%6 = zext i16 %5 to i32
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C();
void B(int a, int b) { C(); }


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

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

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

LLVM IR (-O2):
define void @B(i32 %0, i32 %1) {
%3 = tail call i32 (...) @C()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_from_montgomery(uintptr_t,
                                                           uintptr_t);
void fiat_secp256k1_from_montgomery(uint32_t out1[8], const uint32_t arg1[8]) {
  internal_fiat_secp256k1_from_montgomery((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_from_montgomery>:
jmp    1030 <internal_fiat_secp256k1_from_montgomery@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_from_montgomery(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_secp256k1_from_montgomery(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_from_montgomery(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_secp256k1_from_montgomery(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int op_sub(int, int);
int test_sub() {
  if (op_sub(3, 4) != (3 - 4))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<test_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <op_sub@plt>
cmp    $0xffffffff,%eax
je     113c <test_sub+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <test_sub+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sub>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <op_sub@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_sub() {
%1 = tail call i32 @op_sub(i32 3, i32 4)
%2 = icmp ne i32 %1, -1
%3 = sext i1 %2 to i32
ret i32 %3
}
void land_test(void) {
  int i;
  i = 1 && 2;
}


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

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

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

LLVM IR (-O2):
define void @land_test() {
ret void
}
void nni_stat_sys_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @nni_stat_sys_fini() {
ret void
}
void free_uint(unsigned *val) {}


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

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

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

LLVM IR (-O2):
define void @free_uint(i32* nocapture %0) {
ret void
}
/* Type definitions */
struct st_trx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_msg(int, char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
void http_500(int fd, struct st_trx *wb_trx) {
  char buff[8192];
  sprintf(buff, "HTTP/1.0 500 INTERNAL SERVER ERROR\r\n");
  sprintf(buff, "%sServer: xWebserver\r\n", buff);
  send_msg(fd, buff);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x2010,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2010(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x2010(%rbp),%rdi
lea    -0x2010(%rbp),%rdx
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x2010(%rbp),%rsi
call   1030 <send_msg@plt>
add    $0x2010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
sub    $0x2008,%rsp
mov    %edi,%ebp
movups 0xede(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xec2(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa0d524f525245,%rax
mov    %rax,0x1d(%rsp)
lea    0xecd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <send_msg@plt>
add    $0x2008,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.st_trx = type { i32 }
@.str = [37 x i8] c"HTTP/1.0 500 INTERNAL SERVER ERROR\0D\0A\00"
@.str.1 = [23 x i8] c"%sServer: xWebserver\0D\0A\00"
define void @http_500(i32 %0, %struct.st_trx* %1) {
%3 = alloca i32
%4 = alloca %struct.st_trx*
%5 = alloca [8192 x i8]
store i32 %0, i32* %3
store %struct.st_trx* %1, %struct.st_trx** %4
%6 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %3
%12 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%13 = call i32 @send_msg(i32 %11, i8* %12)
ret void
}

LLVM IR (-O2):
%struct.st_trx = type { i32 }
@.str = [37 x i8] c"HTTP/1.0 500 INTERNAL SERVER ERROR\0D\0A\00"
@.str.1 = [23 x i8] c"%sServer: xWebserver\0D\0A\00"
define void @http_500(i32 %0, %struct.st_trx* nocapture readnone %1) {
%3 = alloca [8192 x i8]
%4 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @send_msg(i32 %0, i8* %4)
ret void
}
/* Variables and functions */
int fa_parseopt(int, char **);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int ret;
  ret = fa_parseopt(argc, argv);
  if (ret)
    printf("FAIL: now doing the abnormal things\n");
  else
    printf("SUCC: now doing the normal thing\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fa_parseopt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1160 <main+0x40>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
jmp    116c <main+0x4c>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <fa_parseopt@plt>
test   %eax,%eax
lea    0xed1(%rip),%rax
lea    0xeeb(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"FAIL: now doing the abnormal things\0A\00"
@.str.1 = [34 x i8] c"SUCC: now doing the normal thing\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @fa_parseopt(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"SUCC: now doing the normal thing\00"
@str.2 = [36 x i8] c"FAIL: now doing the abnormal things\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @fa_parseopt(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.2, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
int check_prime(int num) {
  int j, flag = 0;
  for (j = 2; j <= num / 2; ++j) {
    if (num % j == 0) {
      flag = 1;
      break;
    }
  }
  return flag;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1162 <check_prime+0x62>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    114f <check_prime+0x4f>
movl   $0x1,-0xc(%rbp)
jmp    1162 <check_prime+0x62>
jmp    1154 <check_prime+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <check_prime+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
xor    %r8d,%r8d
cmp    $0x4,%edi
jl     1137 <check_prime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <check_prime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <check_prime+0x20>
mov    %r8d,%eax
ret
mov    $0x1,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %8, %1
%13 = phi i32 [ 0, %1 ], [ 1, %8 ], [ 0, %5 ]
ret i32 %13
}
/* Variables and functions */
int check_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N;
  scanf("%d", &N);
  int req_no = check_prime(N);
  printf("%d", req_no);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <check_prime@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9c(%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    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <check_prime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 @check_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage:\n");
  printf("  ./t8.4 <int_value> which 1 for _exit(0) others for exit(0).\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [63 x i8] c" ./t8.4 <int_value> which 1 for _exit(0) others for exit(0).\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"usage:\00"
@str.2 = [62 x i8] c" ./t8.4 <int_value> which 1 for _exit(0) others for exit(0).\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.2, i64 0, i64 0))
ret void
}