xunge/DecIR huggingface dataset:
/* Variables and functions */
int minimum(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arrLen = 10;
  int array[10] = {27, 5, 3, 6, 44, 15, 5, 7, 25, 14};
  printf("Minimum = %d\n", minimum(array, arrLen));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <minimum@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <minimum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 27, i32 5, i32 3, i32 6, i32 44, i32 15, i32 5, i32 7, i32 25, i32 14]
@.str = [14 x i8] c"Minimum = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
store i32 0, i32* %1
store i32 10, i32* %2
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @minimum(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [10 x i32] [i32 27, i32 5, i32 3, i32 6, i32 44, i32 15, i32 5, i32 7, i32 25, i32 14]
@.str = [14 x i8] c"Minimum = %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @minimum(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
__attribute__((no)) void func_9(void) {}


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

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

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

LLVM IR (-O2):
define void @func_9() {
ret void
}
/* Type definitions */
struct CMD {
  int dummy;
};

/* Variables and functions */
int detruire_lien(char *);
int /*<<< orphan*/ perreur(char *);
int /*<<< orphan*/ scanf(char *, char *);
void rm(struct CMD *c) {
  char fichier[300];
  scanf("%s", fichier);
  if (detruire_lien(fichier) == -1)
    perreur(fichier);
}


x86 assembly (clang, -O0):
<rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x140(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <scanf@plt>
lea    -0x140(%rbp),%rdi
call   1040 <detruire_lien@plt>
cmp    $0xffffffff,%eax
jne    1173 <rm+0x43>
lea    -0x140(%rbp),%rdi
call   1050 <perreur@plt>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm>:
push   %rbx
sub    $0x130,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    %rbx,%rdi
call   1040 <detruire_lien@plt>
cmp    $0xffffffff,%eax
jne    115f <rm+0x2f>
mov    %rsp,%rdi
call   1050 <perreur@plt>
add    $0x130,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.CMD = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @rm(%struct.CMD* %0) {
%2 = alloca %struct.CMD*
%3 = alloca [300 x i8]
store %struct.CMD* %0, %struct.CMD** %2
%4 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%7 = call i32 @detruire_lien(i8* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%11 = call i32 @perreur(i8* %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.CMD = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @rm(%struct.CMD* nocapture readnone %0) {
%2 = alloca [300 x i8]
%3 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @detruire_lien(i8* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perreur(i8* %3)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_clear_error();
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void openconnect_init_openssl(void) {
  SSL_library_init();
  ERR_clear_error();
  SSL_load_error_strings();
  OpenSSL_add_all_algorithms();
}


x86 assembly (clang, -O0):
<openconnect_init_openssl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1050 <ERR_clear_error@plt>
mov    $0x0,%al
call   1060 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_algorithms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<openconnect_init_openssl>:
push   %rax
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
call   1050 <ERR_clear_error@plt>
xor    %eax,%eax
call   1060 <SSL_load_error_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <OpenSSL_add_all_algorithms@plt>

LLVM IR (-O0):
define void @openconnect_init_openssl() {
%1 = call i32 (...) @SSL_library_init()
%2 = call i32 (...) @ERR_clear_error()
%3 = call i32 (...) @SSL_load_error_strings()
%4 = call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}

LLVM IR (-O2):
define void @openconnect_init_openssl() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @ERR_clear_error()
%3 = tail call i32 (...) @SSL_load_error_strings()
%4 = tail call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void s_intcpy(int *ip1, int *ip2, int cnt) {
  memcpy(ip1, ip2, cnt * sizeof(*ip1));
}


x86 assembly (clang, -O0):
<s_intcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_intcpy>:
shl    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @s_intcpy(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, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(i32* %7, i32* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @s_intcpy(i32* %0, i32* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i32* %0, i32* %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void ftnstop(char *msg) {
  if (msg != NULL)
    fprintf(stderr, "%s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<ftnstop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <ftnstop+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ftnstop>:
push   %rax
test   %rdi,%rdi
je     113e <ftnstop+0x1e>
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @ftnstop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @ftnstop(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ hanoi(int, char, char, char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int m;
  printf("input the number of diskes:");
  scanf("%d", &m);
  printf("The step to moving %3d diskes:\n", m);
  hanoi(m, 'A', 'B', 'C');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1050 <hanoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1050 <hanoi@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"input the number of diskes:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"The step to moving %3d diskes:\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @hanoi(i32 %6, i8 signext 65, i8 signext 66, i8 signext 67)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"input the number of diskes:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"The step to moving %3d diskes:\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @hanoi(i32 %7, i8 signext 65, i8 signext 66, i8 signext 67)
ret void
}
call2h(d2, c, f1, s, d1, i, f2, l) double d2;
char c;
float f1;
short s;
double d1;
int i;
float f2;
long l;
{
  c = 'a';
  f1 = 0.0;
  s = 5;
  d1 = 0.0;
  i = 6;
  f2 = 0.1;
  l = 7;
  d2 = 0.2;
}


x86 assembly (clang, -O0):
<call2h>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm3,-0x40(%rbp)
mov    %esi,%eax
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
mov    %dil,%sil
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movsd  %xmm3,-0x10(%rbp)
mov    %sil,-0x11(%rbp)
movss  %xmm1,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
movss  %xmm0,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
movb   $0x61,-0x11(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movw   $0x5,-0x1a(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x6,-0x2c(%rbp)
movss  0xe9e(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
movq   $0x7,-0x38(%rbp)
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call2h(double %0, i32 %1, double %2, i32 %3, double %4, i32 %5, double %6, i64 %7) {
%9 = alloca i32
%10 = alloca double
%11 = alloca i8
%12 = alloca float
%13 = alloca i16
%14 = alloca double
%15 = alloca i32
%16 = alloca float
%17 = alloca i64
%18 = trunc i32 %1 to i8
%19 = fptrunc double %2 to float
%20 = trunc i32 %3 to i16
%21 = fptrunc double %6 to float
store double %0, double* %10
store i8 %18, i8* %11
store float %19, float* %12
store i16 %20, i16* %13
store double %4, double* %14
store i32 %5, i32* %15
store float %21, float* %16
store i64 %7, i64* %17
store i8 97, i8* %11
store float 0.000000e+00, float* %12
store i16 5, i16* %13
store double 0.000000e+00, double* %14
store i32 6, i32* %15
store float 0x3FB99999A0000000, float* %16
store i64 7, i64* %17
store double 2.000000e-01, double* %10
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @call2h(double %0, i32 %1, double %2, i32 %3, double %4, i32 %5, double %6, i64 %7) {
ret i32 undef
}
void typecheck_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @typecheck_init() {
ret void
}
/* Variables and functions */
int foo(int);
int bar(int a) { return foo(a); }


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
ret i32 %2
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[local1] *= state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] * 809088178UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    $0x1,%rax
jae    1150 <RandomFunc+0x50>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%ecx
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp,%rax,4),%ecx
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%eax
imul   $0x3039b4b2,%rax,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0xff660b45,%eax
add    (%rdi),%eax
imul   %eax,%eax
imul   $0x3039b4b2,%eax,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %16, %2
%13 = load i32, i32* %6
%14 = zext i32 %13 to i64
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %30
16: ; preds = %12
%17 = load i32, i32* %6
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %6
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = mul i32 %24, %20
store i32 %25, i32* %23
%26 = load i32, i32* %6
%27 = zext i32 %26 to i64
%28 = add i64 %27, 2
%29 = trunc i64 %28 to i32
store i32 %29, i32* %6
br label %12
30: ; preds = %12
%31 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%32 = load i32, i32* %31
%33 = zext i32 %32 to i64
%34 = mul i64 %33, 809088178
%35 = trunc i64 %34 to i32
%36 = load i32*, i32** %4
%37 = getelementptr inbounds i32, i32* %36, i64 0
store i32 %35, i32* %37
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, -10089659
%5 = mul i32 %4, 809088178
%6 = mul i32 %5, %4
store i32 %6, i32* %1
ret void
}
void gf8mul_01110011(void) {
  __asm__ __volatile__("\tpxor    %xmm7, %xmm3\n"
                       "\tpxor    %xmm6, %xmm2\n"
                       "\tpxor    %xmm5, %xmm1\n"
                       "\tpxor    %xmm4, %xmm0\n"
                       "\tpxor    %xmm3, %xmm7\n"
                       "\tpxor    %xmm3, %xmm2\n"
                       "\tpxor    %xmm3, %xmm1\n"
                       "\tpxor    %xmm2, %xmm6\n"
                       "\tpxor    %xmm2, %xmm1\n"
                       "\tpxor    %xmm2, %xmm0\n"
                       "\tpxor    %xmm1, %xmm7\n"
                       "\tpxor    %xmm1, %xmm6\n"
                       "\tpxor    %xmm1, %xmm5\n"
                       "\tpxor    %xmm1, %xmm2\n"
                       "\tpxor    %xmm0, %xmm6\n"
                       "\tpxor    %xmm0, %xmm5\n"
                       "\tpxor    %xmm0, %xmm4\n"
                       "\tpxor    %xmm0, %xmm1\n");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
pxor   %xmm7,%xmm3
pxor   %xmm6,%xmm2
pxor   %xmm5,%xmm1
pxor   %xmm4,%xmm0
pxor   %xmm3,%xmm7
pxor   %xmm3,%xmm2
pxor   %xmm3,%xmm1
pxor   %xmm2,%xmm6
pxor   %xmm2,%xmm1
pxor   %xmm2,%xmm0
pxor   %xmm1,%xmm7
pxor   %xmm1,%xmm6
pxor   %xmm1,%xmm5
pxor   %xmm1,%xmm2
pxor   %xmm0,%xmm6
pxor   %xmm0,%xmm5
pxor   %xmm0,%xmm4
pxor   %xmm0,%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
pxor   %xmm7,%xmm3
pxor   %xmm6,%xmm2
pxor   %xmm5,%xmm1
pxor   %xmm4,%xmm0
pxor   %xmm3,%xmm7
pxor   %xmm3,%xmm2
pxor   %xmm3,%xmm1
pxor   %xmm2,%xmm6
pxor   %xmm2,%xmm1
pxor   %xmm2,%xmm0
pxor   %xmm1,%xmm7
pxor   %xmm1,%xmm6
pxor   %xmm1,%xmm5
pxor   %xmm1,%xmm2
pxor   %xmm0,%xmm6
pxor   %xmm0,%xmm5
pxor   %xmm0,%xmm4
pxor   %xmm0,%xmm1
ret

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

LLVM IR (-O2):
define void @gf8mul_01110011() {
tail call void asm sideeffect "\09pxor %xmm7, %xmm3\0A\09pxor %xmm6, %xmm2\0A\09pxor %xmm5, %xmm1\0A\09pxor %xmm4, %xmm0\0A\09pxor %xmm3, %xmm7\0A\09pxor %xmm3, %xmm2\0A\09pxor %xmm3, %xmm1\0A\09pxor %xmm2, %xmm6\0A\09pxor %xmm2, %xmm1\0A\09pxor %xmm2, %xmm0\0A\09pxor %xmm1, %xmm7\0A\09pxor %xmm1, %xmm6\0A\09pxor %xmm1, %xmm5\0A\09pxor %xmm1, %xmm2\0A\09pxor %xmm0, %xmm6\0A\09pxor %xmm0, %xmm5\0A\09pxor %xmm0, %xmm4\0A\09pxor %xmm0, %xmm1\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_execve;
int /*<<< orphan*/ abort();
scalar_t__ foo();
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  if (foo() <= 0)
    abort();
  syscall(SYS_execve, 0, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <foo@plt>
cmp    $0x0,%rax
jg     1157 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <syscall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <foo@plt>
test   %rax,%rax
jle    1155 <main+0x25>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@SYS_execve = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp sle i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = load i32, i32* @SYS_execve
%8 = call i32 @syscall(i32 %7, i32 0, i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
@SYS_execve = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp slt i64 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = load i32, i32* @SYS_execve
%7 = tail call i32 @syscall(i32 %6, i32 0, i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ heap_heapify(int *, int, int /*<<< orphan*/);
int heap_extract_max(int a[], int n) {
  int max = a[0];
  a[0] = a[n - 1];
  heap_heapify(a, n - 1, 0);
  return max;
}


x86 assembly (clang, -O0):
<heap_extract_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
xor    %edx,%edx
call   1030 <heap_heapify@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_extract_max>:
push   %rbx
mov    (%rdi),%ebx
movslq %esi,%rax
add    $0xffffffff,%esi
mov    -0x4(%rdi,%rax,4),%eax
mov    %eax,(%rdi)
xor    %edx,%edx
call   1030 <heap_heapify@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @heap_extract_max(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** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 %14, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = call i32 @heap_heapify(i32* %17, i32 %19, i32 0)
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @heap_extract_max(i32* %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
store i32 %7, i32* %0
%8 = tail call i32 @heap_heapify(i32* %0, i32 %4, i32 0)
ret i32 %3
}
void spx_resource_stats_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @spx_resource_stats_shutdown() {
ret void
}
void CL_Drop(void) {}


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

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

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

LLVM IR (-O2):
define void @CL_Drop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reconfig_thr_value();
void process_dmic_timer() { reconfig_thr_value(); }


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

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

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

LLVM IR (-O2):
define void @process_dmic_timer() {
%1 = tail call i32 (...) @reconfig_thr_value()
ret void
}
__attribute__((no)) int foo(int a) {
  void *l = &&error;
  if (a == 4)
    goto *l;
  return 150;
error:
  return a;
failure:
  return a + 2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
lea    0x27(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    1129 <foo+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1140 <foo+0x40>
movl   $0x96,-0x4(%rbp)
jmp    113b <foo+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret
mov    -0x18(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<foo>:
cmp    $0x4,%edi
mov    $0x96,%eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* blockaddress(@foo, %10), i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %4
br label %17
9: ; preds = %1
store i32 150, i32* %2
br label %15
10: ; preds = %17
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %15
12: ; No predecessors!
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 2
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %10, %9
%16 = load i32, i32* %2
ret i32 %16
17: ; preds = %7
%18 = phi i8* [ %8, %7 ]
indirectbr i8* %18, [label %10]
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = select i1 %2, i32 4, i32 150
ret i32 %3
}
int get_char(int x, int upper) {
  char set[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  int ret = 0;
  ret += set[x];
  ret += upper;
  for (int i = 0; i < 2500; ++i)
    x *= 2;
  return ret;
}


x86 assembly (clang, -O0):
<get_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xed7(%rip),%rsi
mov    $0x25,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
movslq -0x4(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x9c4,-0x38(%rbp)
jge    117d <get_char+0x6d>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1159 <get_char+0x49>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
add    %esi,%eax
ret

LLVM IR (-O0):
@__const.get_char.set = [37 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\00"
define i32 @get_char(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [37 x i8]
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = bitcast [37 x i8]* %5 to i8*
store i32 0, i32* %6
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [37 x i8], [37 x i8]* %5, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i32, i32* %6
%15 = add nsw i32 %14, %13
store i32 %15, i32* %6
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = add nsw i32 %17, %16
store i32 %18, i32* %6
store i32 0, i32* %7
br label %19
19: ; preds = %25, %2
%20 = load i32, i32* %7
%21 = icmp slt i32 %20, 2500
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = load i32, i32* %3
%24 = mul nsw i32 %23, 2
store i32 %24, i32* %3
br label %25
25: ; preds = %22
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %19
28: ; preds = %19
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
@__const.get_char.set = [37 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\00"
define i32 @get_char(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.get_char.set, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, %1
ret i32 %7
}
void vtime_account(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @vtime_account(%struct.task_struct* nocapture %0) {
ret void
}
int wps_validate_m8_encr(const struct wpabuf *tlvs, int ap, int wps2) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_m8_encr(%struct.wpabuf* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
main() { printf("getchar() != EOF=%d\n", getchar() != EOF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"getchar() != EOF=%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"getchar() != EOF=%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 3; i++) {
    printf("%d hello world! \n", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"%d hello world! \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void gpio_write(uint32_t *port, uint8_t pin, uint8_t value) {
  port[(1 << pin << 2) / 4] = value << pin;
}


x86 assembly (clang, -O0):
<gpio_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
shl    $0x2,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_write>:
mov    %esi,%ecx
shl    %cl,%edx
mov    $0x4,%eax
shl    %cl,%eax
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
movslq %ecx,%rax
mov    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @gpio_write(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* %6
%8 = load i32, i32* %5
%9 = shl i32 %7, %8
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = shl i32 1, %11
%13 = shl i32 %12, 2
%14 = sdiv i32 %13, 4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %10, i64 %15
store i32 %9, i32* %16
ret void
}

LLVM IR (-O2):
define void @gpio_write(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = shl i32 %2, %1
%5 = shl i32 4, %1
%6 = sdiv i32 %5, 4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %4, i32* %8
ret void
}
/* Variables and functions */
double tml_dr_vSum(double const *, int);
double tml_dr_vMean(const double *vec, int n) {
  return tml_dr_vSum(vec, n) / (double)n;
}


x86 assembly (clang, -O0):
<tml_dr_vMean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <tml_dr_vSum@plt>
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tml_dr_vMean>:
push   %rbx
mov    %esi,%ebx
call   1030 <tml_dr_vSum@plt>
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @tml_dr_vMean(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call double @tml_dr_vSum(double* %5, i32 %6)
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @tml_dr_vMean(double* %0, i32 %1) {
%3 = tail call double @tml_dr_vSum(double* %0, i32 %1)
%4 = sitofp i32 %1 to double
%5 = fdiv double %3, %4
ret double %5
}
__float128 pass_through(__float128 x) { return x; }


x86 assembly (clang, -O0):
<pass_through>:
push   %rbp
mov    %rsp,%rbp
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define fp128 @pass_through(fp128 returned %0) {
ret fp128 %0
}
int test_imm_ADuint32_mem(unsigned int *val) {
  return ((*val) & (0xAD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ADuint32_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, 173
%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_ADuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 173
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double cos(int);
double kern(int i) {
  if (0) {
    return 0.5 * (cos(i * 3.14159265358979323846 / 20) + 1.0);
  } else {
    return 1.;
  }
}


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

x86 assembly (clang, -O2):
<kern>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @kern(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @kern(i32 %0) {
ret double 1.000000e+00
}
int trailingZeroes(int n) {
  if (n < 0)
    return 0;
  int sum = 0;
  while (n) {
    sum += n / 5;
    n /= 5;
  }
  return sum;
}


x86 assembly (clang, -O0):
<trailingZeroes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <trailingZeroes+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1158 <trailingZeroes+0x58>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1152 <trailingZeroes+0x52>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1124 <trailingZeroes+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trailingZeroes>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <trailingZeroes+0x31>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rdi
add    %edx,%edi
add    %edi,%eax
add    $0x4,%ecx
cmp    $0x8,%ecx
ja     1110 <trailingZeroes+0x10>
ret

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

LLVM IR (-O2):
define i32 @trailingZeroes(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 5
%7 = add nsw i32 %4, %6
%8 = add i32 %5, 4
%9 = icmp ult i32 %8, 9
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
char *__compat_get_home_dir(char *str, int size) {
  char *home = getenv("HOME");
  snprintf(str, size - 1, "%s", home);
  return str;
}


x86 assembly (clang, -O0):
<__compat_get_home_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%rcx
lea    0xeb1(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__compat_get_home_dir>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xed0(%rip),%rdi
call   1030 <getenv@plt>
add    $0xffffffff,%ebx
lea    0xec6(%rip),%rdx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rcx
call   1040 <snprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [3 x i8] c"%s\00"
define i8* @__compat_get_home_dir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = load i8*, i8** %5
%11 = call i32 @snprintf(i8* %7, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [3 x i8] c"%s\00"
define i8* @__compat_get_home_dir(i8* returned %0, i32 %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %1, -1
%5 = tail call i32 @snprintf(i8* %0, i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i8* %0
}
void proc54() {}


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

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

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

LLVM IR (-O2):
define void @proc54() {
ret void
}
/* Variables and functions */
int isalnum(unsigned char);
int isurlchar(unsigned char c) { return isalnum(c); }


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

x86 assembly (clang, -O2):
<isurlchar>:
jmp    1030 <isalnum@plt>

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

LLVM IR (-O2):
define i32 @isurlchar(i8 zeroext %0) {
%2 = tail call i32 @isalnum(i8 zeroext %0)
ret i32 %2
}
void foo474(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo474(i32 %0) {
ret void
}
/* Variables and functions */
float GetIBLAccumMinUint();
float rcp(float);
float GetIBLAccumMin() { return GetIBLAccumMinUint() * rcp(15.0f); }


x86 assembly (clang, -O0):
<GetIBLAccumMin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <GetIBLAccumMinUint@plt>
movss  %xmm0,-0x4(%rbp)
movss  0xec4(%rip),%xmm0
call   1030 <rcp@plt>
movaps %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetIBLAccumMin>:
push   %rax
xor    %eax,%eax
call   1040 <GetIBLAccumMinUint@plt>
movss  %xmm0,0x4(%rsp)
movss  0xeca(%rip),%xmm0
call   1030 <rcp@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @GetIBLAccumMin() {
%1 = call float (...) @GetIBLAccumMinUint()
%2 = call float @rcp(float 1.500000e+01)
%3 = fmul float %1, %2
ret float %3
}

LLVM IR (-O2):
define float @GetIBLAccumMin() {
%1 = tail call float (...) @GetIBLAccumMinUint()
%2 = tail call float @rcp(float 1.500000e+01)
%3 = fmul float %1, %2
ret float %3
}
void thump(void) {
  int i;
  for (i = 1; i < 2; i++) {
    ;
    ;
    ;
  };
}


x86 assembly (clang, -O0):
<thump>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1128 <thump+0x28>
jmp    111a <thump+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <thump+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @thump() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @thump() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(void) {
  foo(400);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x190,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 400)
ret i32 0
}
void swap(int *collection, int left, int right) {
  int temp = *(collection + left);
  *(collection + left) = *(collection + right);
  *(collection + right) = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void disable_denormals() {}


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

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

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

LLVM IR (-O2):
define void @disable_denormals() {
ret void
}
/* Type definitions */
struct mfrag_fh {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mfrag_fh_cleanup(struct mfrag_fh *);
struct mfrag_fh *mfrag_fh_new();
int main() {
  struct mfrag_fh *fh;
  fh = mfrag_fh_new();
  mfrag_fh_cleanup(fh);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.mfrag_fh = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.mfrag_fh*
store i32 0, i32* %1
%3 = call %struct.mfrag_fh* (...) @mfrag_fh_new()
store %struct.mfrag_fh* %3, %struct.mfrag_fh** %2
%4 = load %struct.mfrag_fh*, %struct.mfrag_fh** %2
%5 = call i32 @mfrag_fh_cleanup(%struct.mfrag_fh* %4)
ret i32 0
}

LLVM IR (-O2):
%struct.mfrag_fh = type { i32 }
define i32 @main() {
%1 = tail call %struct.mfrag_fh* (...) @mfrag_fh_new()
%2 = tail call i32 @mfrag_fh_cleanup(%struct.mfrag_fh* %1)
ret i32 0
}