xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ print(int);
void function_with_loop_1() {
  int x = 1;
  while (x < 100) {
    while (x < 50) {
      x = x + 1;
    }
    x = x + 1;
  }
  print(x);
}


x86 assembly (clang, -O0):
<function_with_loop_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1154 <function_with_loop_1+0x44>
jmp    112e <function_with_loop_1+0x1e>
cmpl   $0x32,-0x4(%rbp)
jge    1146 <function_with_loop_1+0x36>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <function_with_loop_1+0x1e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <function_with_loop_1+0xf>
mov    -0x4(%rbp),%edi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_with_loop_1>:
mov    $0x64,%edi
jmp    1030 <print@plt>

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

LLVM IR (-O2):
define void @function_with_loop_1() {
%1 = tail call i32 @print(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("STanDard IO falando OI!\ncabeçalho (heads .h) padrão para Entrada e "
         "Saída\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [77 x i8] c"STanDard IO falando OI!\0Acabe\C3\A7alho (heads .h) padr\C3\A3o para Entrada e Sa\C3\ADda\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [76 x i8] c"STanDard IO falando OI!\0Acabe\C3\A7alho (heads .h) padr\C3\A3o para Entrada e Sa\C3\ADda\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int tune_continuation_parameters(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(70, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<tune_continuation_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x46,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tune_continuation_parameters>:
mov    $0x46,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @tune_continuation_parameters() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 70, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
scalar_t__ Char_3d_array(int, int, int);
void ****Pointer_3d_array(int i_size, int j_size, int k_size) {
  return ((void ****)Char_3d_array(i_size, j_size, k_size * sizeof(void *)));
}


x86 assembly (clang, -O0):
<Pointer_3d_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <Char_3d_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pointer_3d_array>:
shl    $0x3,%edx
jmp    1030 <Char_3d_array@plt>

LLVM IR (-O0):
define i8**** @Pointer_3d_array(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i64 @Char_3d_array(i32 %7, i32 %8, i32 %12)
%14 = inttoptr i64 %13 to i8****
ret i8**** %14
}

LLVM IR (-O2):
define i8**** @Pointer_3d_array(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = tail call i64 @Char_3d_array(i32 %0, i32 %1, i32 %4)
%6 = inttoptr i64 %5 to i8****
ret i8**** %6
}
/* Variables and functions */
int /*<<< orphan*/ puthex1(char);
void puthex_b(char c) {
  puthex1((c >> 4) & 0xFU);
  puthex1(c & 0xFU);
}


x86 assembly (clang, -O0):
<puthex_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movsbl %al,%edi
call   1030 <puthex1@plt>
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movsbl %al,%edi
call   1030 <puthex1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puthex_b>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <puthex1@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <puthex1@plt>

LLVM IR (-O0):
define void @puthex_b(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i8
%8 = call i32 @puthex1(i8 signext %7)
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = and i32 %10, 15
%12 = trunc i32 %11 to i8
%13 = call i32 @puthex1(i8 signext %12)
ret void
}

LLVM IR (-O2):
define void @puthex_b(i8 signext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @puthex1(i8 signext %2)
%4 = and i8 %0, 15
%5 = tail call i32 @puthex1(i8 signext %4)
ret void
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
float mat4_minor(struct mat4 *, unsigned int, unsigned int);
float mat4_cofactor(struct mat4 *mat, unsigned int col, unsigned int row) {
  float cofactor = mat4_minor(mat, col, row);
  if ((col + row) % 2 == 0)
    return cofactor;
  return -cofactor;
}


x86 assembly (clang, -O0):
<mat4_cofactor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <mat4_minor@plt>
movss  %xmm0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1157 <mat4_cofactor+0x47>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116e <mat4_cofactor+0x5e>
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4_cofactor>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <mat4_minor@plt>
add    %ebp,%ebx
test   $0x1,%bl
je     112a <mat4_cofactor+0x1a>
xorps  0xed6(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define float @mat4_cofactor(%struct.mat4* %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca %struct.mat4*
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store %struct.mat4* %0, %struct.mat4** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load %struct.mat4*, %struct.mat4** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call float @mat4_minor(%struct.mat4* %9, i32 %10, i32 %11)
store float %12, float* %8
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = add i32 %13, %14
%16 = urem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %3
%19 = load float, float* %8
store float %19, float* %4
br label %23
20: ; preds = %3
%21 = load float, float* %8
%22 = fneg float %21
store float %22, float* %4
br label %23
23: ; preds = %20, %18
%24 = load float, float* %4
ret float %24
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define float @mat4_cofactor(%struct.mat4* %0, i32 %1, i32 %2) {
%4 = tail call float @mat4_minor(%struct.mat4* %0, i32 %1, i32 %2)
%5 = add i32 %2, %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = fneg float %4
%9 = select i1 %7, float %4, float %8
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ UART4_ERR_DriverIRQHandler();
__attribute__((weak)) void UART4_ERR_IRQHandler(void) {
  UART4_ERR_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @UART4_ERR_IRQHandler() {
%1 = tail call i32 (...) @UART4_ERR_DriverIRQHandler()
ret void
}
/* Variables and functions */
char *strcpy(char *, char *);
char *ctermid(char *s) {
  char *name = (char *)"/dev/tty";
  if (s == NULL)
    return name;
  return strcpy(s, name);
}


x86 assembly (clang, -O0):
<ctermid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113f <ctermid+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1150 <ctermid+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctermid>:
test   %rdi,%rdi
je     111a <ctermid+0x1a>
mov    %rdi,%rax
movabs $0x7974742f7665642f,%rcx
74 74 79
mov    %rcx,(%rdi)
movb   $0x0,0x8(%rdi)
ret
lea    0xedf(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/tty\00"
define i8* @ctermid(i8* writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(9) %0, i8* align 1 dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 9, i1 false)
br label %4
4: ; preds = %1, %3
%5 = phi i8* [ %0, %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Scr_AddString(int /*<<< orphan*/);
int /*<<< orphan*/ Scr_Error(char *);
int Scr_GetNumParam();
int /*<<< orphan*/ Scr_GetString(int /*<<< orphan*/);
void GScr_CopyString() {
  if (Scr_GetNumParam() != 1) {
    Scr_Error("Usage: CopyStr(<string>)\n");
  }
  Scr_AddString(Scr_GetString(0));
}


x86 assembly (clang, -O0):
<GScr_CopyString>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Scr_GetNumParam@plt>
cmp    $0x1,%eax
je     1160 <GScr_CopyString+0x20>
lea    0xea5(%rip),%rdi
call   1050 <Scr_Error@plt>
xor    %edi,%edi
call   1040 <Scr_GetString@plt>
mov    %eax,%edi
call   1060 <Scr_AddString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GScr_CopyString>:
push   %rax
xor    %eax,%eax
call   1030 <Scr_GetNumParam@plt>
cmp    $0x1,%eax
je     1159 <GScr_CopyString+0x19>
lea    0xeac(%rip),%rdi
call   1050 <Scr_Error@plt>
xor    %edi,%edi
call   1040 <Scr_GetString@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <Scr_AddString@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: CopyStr(<string>)\0A\00"
define void @GScr_CopyString() {
%1 = call i32 (...) @Scr_GetNumParam()
%2 = icmp ne i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @Scr_Error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = call i32 @Scr_GetString(i32 0)
%7 = call i32 @Scr_AddString(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: CopyStr(<string>)\0A\00"
define void @GScr_CopyString() {
%1 = tail call i32 (...) @Scr_GetNumParam()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @Scr_Error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @Scr_GetString(i32 0)
%7 = tail call i32 @Scr_AddString(i32 %6)
ret void
}
void itos(int n, char string[]) {
  for (int i = 3; i >= 0; i--) {
    string[i] = n % 10 + '0';
    n = n / 10;
  }
}


x86 assembly (clang, -O0):
<itos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1151 <itos+0x51>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <itos+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<itos>:
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%r8d
imul   $0x51eb851f,%rcx,%r9
imul   $0x10624dd3,%rcx,%rdx
sub    %r8d,%ecx
add    $0x30,%cl
mov    %cl,0x3(%rsi)
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
shr    $0x22,%rcx
add    %edi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
mov    %al,0x2(%rsi)
mov    %r9,%rax
shr    $0x3f,%rax
sar    $0x25,%r9
add    %eax,%r9d
movslq %r9d,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
shr    $0x22,%rcx
add    %edi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
mov    %al,0x1(%rsi)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x26,%rdx
add    %eax,%edx
movslq %edx,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @itos(i32 %0, i8* nocapture writeonly %1) {
%3 = srem i32 %0, 10
%4 = trunc i32 %3 to i8
%5 = add nsw i8 %4, 48
%6 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %5, i8* %6
%7 = sdiv i32 %0, 10
%8 = srem i32 %7, 10
%9 = trunc i32 %8 to i8
%10 = add nsw i8 %9, 48
%11 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %10, i8* %11
%12 = sdiv i32 %0, 100
%13 = srem i32 %12, 10
%14 = trunc i32 %13 to i8
%15 = add nsw i8 %14, 48
%16 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %15, i8* %16
%17 = sdiv i32 %0, 1000
%18 = srem i32 %17, 10
%19 = trunc i32 %18 to i8
%20 = add nsw i8 %19, 48
store i8 %20, i8* %1
ret void
}
__attribute__((noipa)) void fcas2(char a[2]) {
  sink(0, a[0]);
  sink(0, a[1]);
  sink(0, a[2]);
}


x86 assembly (clang, -O0):
<fcas2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <sink@plt>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <sink@plt>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <sink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcas2>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%esi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <sink@plt>
movsbl 0x1(%rbx),%esi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <sink@plt>
movsbl 0x2(%rbx),%esi
xor    %edi,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <sink@plt>

LLVM IR (-O0):
define void @fcas2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sink to i32 (i32, i32, ...)*)(i32 0, i32 %6)
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sink to i32 (i32, i32, ...)*)(i32 0, i32 %11)
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sink to i32 (i32, i32, ...)*)(i32 0, i32 %16)
ret void
}

LLVM IR (-O2):
define void @fcas2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @sink to i32 (i32, i32, ...)*)(i32 0, i32 %3)
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @sink to i32 (i32, i32, ...)*)(i32 0, i32 %7)
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @sink to i32 (i32, i32, ...)*)(i32 0, i32 %11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ keccak_squeezeblocks(unsigned char *, unsigned long,
                                        int /*<<< orphan*/ *, int);
void shake128_squeezeblocks(unsigned char *output, unsigned long nblocks,
                            uint64_t *s) {
  keccak_squeezeblocks(output, nblocks, s, 168);
}


x86 assembly (clang, -O0):
<shake128_squeezeblocks>:
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    $0xa8,%ecx
call   1030 <keccak_squeezeblocks@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shake128_squeezeblocks>:
mov    $0xa8,%ecx
jmp    1030 <keccak_squeezeblocks@plt>

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

LLVM IR (-O2):
define void @shake128_squeezeblocks(i8* %0, i64 %1, i32* %2) {
%4 = tail call i32 @keccak_squeezeblocks(i8* %0, i64 %1, i32* %2, i32 168)
ret void
}
int fill_buffer(char *buf, char val, int size) {
  int i;
  for (i = 0; i < size; i++)
    buf[i] = val;
  return 0;
}


x86 assembly (clang, -O0):
<fill_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1140 <fill_buffer+0x40>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <fill_buffer+0x18>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_buffer>:
test   %edx,%edx
jle    1124 <fill_buffer+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fill_buffer(i8* nocapture writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret i32 0
}
/* Type definitions */
struct extmap_t {
  int dummy;
};

/* Variables and functions */
char extmap_lookup(struct extmap_t *, char *);
char *getfileextension(char *);
char DetectGopherType(char *filename, struct extmap_t *extmap) {
  char *ext = getfileextension(filename);
  return (extmap_lookup(extmap, ext));
}


x86 assembly (clang, -O0):
<DetectGopherType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getfileextension@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <extmap_lookup@plt>
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DetectGopherType>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getfileextension@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <extmap_lookup@plt>

LLVM IR (-O0):
%struct.extmap_t = type { i32 }
define signext i8 @DetectGopherType(i8* %0, %struct.extmap_t* %1) {
%3 = alloca i8*
%4 = alloca %struct.extmap_t*
%5 = alloca i8*
store i8* %0, i8** %3
store %struct.extmap_t* %1, %struct.extmap_t** %4
%6 = load i8*, i8** %3
%7 = call i8* @getfileextension(i8* %6)
store i8* %7, i8** %5
%8 = load %struct.extmap_t*, %struct.extmap_t** %4
%9 = load i8*, i8** %5
%10 = call signext i8 @extmap_lookup(%struct.extmap_t* %8, i8* %9)
ret i8 %10
}

LLVM IR (-O2):
%struct.extmap_t = type { i32 }
define signext i8 @DetectGopherType(i8* %0, %struct.extmap_t* %1) {
%3 = tail call i8* @getfileextension(i8* %0)
%4 = tail call signext i8 @extmap_lookup(%struct.extmap_t* %1, i8* %3)
ret i8 %4
}
int sysfs_create_link(struct kobject *k, struct kobject *t, char *n) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
define i32 @sysfs_create_link(%struct.kobject* %0, %struct.kobject* %1, i8* %2) {
%4 = alloca %struct.kobject*
%5 = alloca %struct.kobject*
%6 = alloca i8*
store %struct.kobject* %0, %struct.kobject** %4
store %struct.kobject* %1, %struct.kobject** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.kobject = type opaque
define i32 @sysfs_create_link(%struct.kobject* nocapture readnone %0, %struct.kobject* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
void whichISR(void) {
  void (*the_isr)(void);
  the_isr = (void *)(*(volatile unsigned int *)(0x71200F00));
  (*the_isr)();
  return;
}


x86 assembly (clang, -O0):
<whichISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x71200f00,%eax
mov    (%rax),%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whichISR>:
mov    0x71200f00,%eax
jmp    *%rax

LLVM IR (-O0):
define void @whichISR() {
%1 = alloca void ()*
%2 = load volatile i32, i32* inttoptr (i64 1897926400 to i32*)
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = bitcast i8* %4 to void ()*
store void ()* %5, void ()** %1
%6 = load void ()*, void ()** %1
ret void
}

LLVM IR (-O2):
define void @whichISR() {
%1 = load volatile i32, i32* inttoptr (i64 1897926400 to i32*)
%2 = zext i32 %1 to i64
%3 = inttoptr i64 %2 to void ()*
tail call void %3()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DymosimMessage(char const *);
void DymosimMessageDymosimSev(int severity, const char *message) {
  DymosimMessage(message);
}


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

x86 assembly (clang, -O2):
<DymosimMessageDymosimSev>:
mov    %rsi,%rdi
jmp    1030 <DymosimMessage@plt>

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

LLVM IR (-O2):
define void @DymosimMessageDymosimSev(i32 %0, i8* %1) {
%3 = tail call i32 @DymosimMessage(i8* %1)
ret void
}
int main() {
  int a = 1, b = 3, c;
  if (a < b) {
    c = 0;
  } else {
    c = 2;
  }
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1131 <main+0x31>
movl   $0x0,-0x10(%rbp)
jmp    1138 <main+0x38>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%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
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 3, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %4
br label %10
9: ; preds = %0
store i32 2, i32* %4
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int SH2DynarecInit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SH2DynarecInit() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ _syscall(int, int, int /*<<< orphan*/, int);
off_t lseek(int fd, off_t offset, int whence) {
  return _syscall(19, fd, offset, whence);
}


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

x86 assembly (clang, -O2):
<lseek>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x13,%edi
jmp    1030 <_syscall@plt>

LLVM IR (-O0):
define i32 @lseek(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @_syscall(i32 19, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_syscall(i32 19, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
size_t shift_left(void *f, unsigned short pass) {
  return (size_t)((unsigned char)(*((unsigned int *)f) >> pass * 8));
}


x86 assembly (clang, -O0):
<shift_left>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movzwl -0xa(%rbp),%ecx
shl    $0x3,%ecx
shr    %cl,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_left>:
mov    (%rdi),%eax
lea    0x0(,%rsi,8),%ecx
shr    %cl,%rax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i64 @shift_left(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = mul nsw i32 %9, 8
%11 = lshr i32 %7, %10
%12 = trunc i32 %11 to i8
%13 = zext i8 %12 to i64
ret i64 %13
}

LLVM IR (-O2):
define i64 @shift_left(i8* nocapture %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = zext i16 %1 to i32
%6 = shl nuw nsw i32 %5, 3
%7 = lshr i32 %4, %6
%8 = and i32 %7, 255
%9 = zext i32 %8 to i64
ret i64 %9
}
__attribute__((always_)) void tracing_on(void) {}


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

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

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

LLVM IR (-O2):
define void @tracing_on() {
ret void
}
int _begin() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_begin() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int getdomainname(char *name, size_t len) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<getdomainname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdomainname>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @getdomainname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @getdomainname(i8* nocapture readnone %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
void nseel_asm_assign_fast_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_assign_fast_end() {
ret void
}
/* Variables and functions */
float *malloc(int);
float *alloc_1d_float(int ndim1) { return malloc(ndim1 * sizeof(float)); }


x86 assembly (clang, -O0):
<alloc_1d_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_1d_float>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define float* @alloc_1d_float(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 4
%6 = trunc i64 %5 to i32
%7 = call float* @malloc(i32 %6)
ret float* %7
}

LLVM IR (-O2):
define noalias float* @alloc_1d_float(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call float* @malloc(i32 %2)
ret float* %3
}
/* Variables and functions */
int /*<<< orphan*/ sift(int *, int, int);
void heapify(int a[], int n) {
  int i = n / 2;
  while (i >= 0) {
    sift(a, i, n);
    i--;
  }
}


x86 assembly (clang, -O0):
<heapify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <heapify+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <sift@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <heapify+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapify>:
push   %rbp
push   %r14
push   %rbx
cmp    $0xffffffff,%esi
jl     1141 <heapify+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%ebp
shr    $0x1f,%ebp
add    %esi,%ebp
sar    %ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <sift@plt>
add    $0xffffffff,%ebp
jb     1130 <heapify+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @heapify(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, -2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = sdiv i32 %1, 2
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @sift(i32* %0, i32 %7, i32 %1)
%9 = add nsw i32 %7, -1
%10 = icmp eq i32 %7, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
int rand();
int brng() {
  int temp = rand() % 2;
  return temp;
}


x86 assembly (clang, -O0):
<brng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brng>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @brng() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 2
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @brng() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 2
ret i32 %2
}
/* Variables and functions */
int rand();
int rand_level() {
  int times = 0;
  while (rand() & 0x1) {
    times++;
  }
  return times;
}


x86 assembly (clang, -O0):
<rand_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     1140 <rand_level+0x30>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <rand_level+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_level>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebx
test   $0x1,%al
jne    1120 <rand_level+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_level() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @rand()
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @rand_level() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @rand()
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
ret i32 %2
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
void foo() {
  DIR *dir;
  struct dirent *d;
}


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

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

LLVM IR (-O0):
%struct.dirent = type { i32 }
define void @foo() {
%1 = alloca i32*
%2 = alloca %struct.dirent*
ret void
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define void @foo() {
ret void
}
void nseel_asm_div_op_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_div_op_end() {
ret void
}
/* Type definitions */
typedef int uint;
typedef int netaddr;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
char *m_netaddr2ascii(uint netaddr, char *ascii) {
  sprintf(ascii, "%d.%d.%d.%d", (netaddr)&0xff, (netaddr >> 8) & 0xff,
          (netaddr >> 16) & 0xff, (netaddr >> 24) & 0xff);
  return ascii;
}


x86 assembly (clang, -O0):
<m_netaddr2ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
and    $0xff,%edx
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x4(%rbp),%r8d
sar    $0x10,%r8d
and    $0xff,%r8d
mov    -0x4(%rbp),%r9d
sar    $0x18,%r9d
and    $0xff,%r9d
lea    0xea3(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_netaddr2ascii>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%eax
movzbl %al,%edx
movzbl %ah,%ecx
mov    %edi,%esi
shr    $0x10,%esi
movzbl %sil,%r8d
shr    $0x18,%eax
lea    0xed1(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%r9d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @m_netaddr2ascii(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = and i32 %6, 255
%8 = load i32, i32* %3
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
%11 = load i32, i32* %3
%12 = ashr i32 %11, 16
%13 = and i32 %12, 255
%14 = load i32, i32* %3
%15 = ashr i32 %14, 24
%16 = and i32 %15, 255
%17 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %10, i32 %13, i32 %16)
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @m_netaddr2ascii(i32 %0, i8* returned writeonly %1) {
%3 = and i32 %0, 255
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = lshr i32 %0, 16
%7 = and i32 %6, 255
%8 = lshr i32 %0, 24
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7, i32 %8)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int *);
int gcd(int a, int b) {
  if (b > a)
    swap(&a, &b);
  if (a % b != 0)
    return gcd(b, a % b);
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1147 <gcd+0x27>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1170 <gcd+0x50>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1176 <gcd+0x56>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
push   %rax
mov    %edi,%eax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
cmp    %edi,%esi
jle    1142 <gcd+0x22>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%esi
cltd
idiv   %esi
test   %edx,%edx
je     1154 <gcd+0x34>
mov    %esi,%edi
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,%esi
mov    %esi,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gcd(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* %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @swap(i32* %4, i32* %5)
br label %11
11: ; preds = %9, %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %11
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = srem i32 %18, %19
%21 = call i32 @gcd(i32 %17, i32 %20)
store i32 %21, i32* %3
br label %24
22: ; preds = %11
%23 = load i32, i32* %5
store i32 %23, i32* %3
br label %24
24: ; preds = %22, %16
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = icmp sgt i32 %1, %0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = call i32 @swap(i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ %9, %6 ], [ %1, %2 ]
%12 = phi i32 [ %8, %6 ], [ %0, %2 ]
%13 = srem i32 %12, %11
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %10
%16 = call i32 @gcd(i32 %11, i32 %13)
br label %17
17: ; preds = %10, %15
%18 = phi i32 [ %16, %15 ], [ %11, %10 ]
ret i32 %18
}
int xmalloc(size)
int size;
{
  int result = malloc(size);
  if (!result)
    fatal("virtual memory exhausted", 0);
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1030 <malloc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1151 <xmalloc+0x31>
lea    0xeb8(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
movslq %edi,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %ebx,%ebx
jne    1140 <xmalloc+0x20>
lea    0xec9(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i32 @xmalloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @fatal to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0)
br label %9
9: ; preds = %7, %1
ret i32 %5
}
/* Variables and functions */
long double nextafterl(long double, long double);
long double nexttowardl(long double x, long double y) {
  return nextafterl(x, y);
}


x86 assembly (clang, -O0):
<nexttowardl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <nextafterl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nexttowardl>:
jmp    1030 <nextafterl@plt>

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

LLVM IR (-O2):
define x86_fp80 @nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @nextafterl(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
int foo(x)
int x;
{ return x; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
void OTG_FS_WKUP_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @OTG_FS_WKUP_IRQHandler() {
ret void
}
void XUnmapSubwindows() {}


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

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

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

LLVM IR (-O2):
define void @XUnmapSubwindows() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int arr[], int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}