xunge/DecIR huggingface dataset:
/* Variables and functions */
long long C_STRTOLL(char *, char **, int);
int main() {
  char *p = "123";
  char *endptrp;
  long long ll;
  ll = C_STRTOLL(p, &endptrp, 10);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <C_STRTOLL@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i64 @C_STRTOLL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1, i32 10)
ret i32 0
}
/* Variables and functions */
int __test(int, int /*<<< orphan*/, int /*<<< orphan*/);
int rt_test_migration(void) { return __test(103, 0, 0); }


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

x86 assembly (clang, -O2):
<rt_test_migration>:
mov    $0x67,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__test@plt>

LLVM IR (-O0):
define i32 @rt_test_migration() {
%1 = call i32 @__test(i32 103, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @rt_test_migration() {
%1 = tail call i32 @__test(i32 103, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int mmc_datatrans(int, void *, unsigned long, int);
int mmc_writemultiplesector(void *data, unsigned long sector, int cnt) {
  return mmc_datatrans(1, data, sector, cnt);
}


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

x86 assembly (clang, -O2):
<mmc_writemultiplesector>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <mmc_datatrans@plt>

LLVM IR (-O0):
define i32 @mmc_writemultiplesector(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 @mmc_datatrans(i32 1, i8* %7, i64 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mmc_writemultiplesector(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @mmc_datatrans(i32 1, i8* %0, i64 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double timeval_to_double(const struct timeval *tv) {
  return (double)tv->tv_sec + ((double)tv->tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<timeval_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_double>:
cvtsi2sdq 0x8(%rdi),%xmm1
cvtsi2sdq (%rdi),%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @timeval_to_double(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %6, %11
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @timeval_to_double(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %8, %4
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ escribirArchivo(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *);
void printLog(char text[300]) {
  printf("%s\n", text);
  char filename[300];
  sprintf(filename, "../../outputs/filename.log");
  escribirArchivo(filename, text);
}


x86 assembly (clang, -O0):
<printLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x140(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x140(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <escribirArchivo@plt>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLog>:
push   %rbx
sub    $0x130,%rsp
mov    %rdi,%rbx
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
movups 0xece(%rip),%xmm0
movups %xmm0,0xb(%rsp)
movups 0xeb7(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <escribirArchivo@plt>
add    $0x130,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [27 x i8] c"../../outputs/filename.log\00"
define void @printLog(i8* %0) {
%2 = alloca i8*
%3 = alloca [300 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 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 @sprintf(i8* %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @escribirArchivo(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [27 x i8] c"../../outputs/filename.log\00"
define void @printLog(i8* %0) {
%2 = alloca [300 x i8]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 0
%5 = call i32 @escribirArchivo(i8* %4, i8* %0)
ret void
}
/* Variables and functions */
int intlog2_bound_bound(int);
int intlog2_bound_bound_bound(int x) { return intlog2_bound_bound(x); }


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

x86 assembly (clang, -O2):
<intlog2_bound_bound_bound>:
jmp    1030 <intlog2_bound_bound@plt>

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

LLVM IR (-O2):
define i32 @intlog2_bound_bound_bound(i32 %0) {
%2 = tail call i32 @intlog2_bound_bound(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_Args();
int /*<<< orphan*/ Q_strncpyz(char *, int /*<<< orphan*/, int);
void Cmd_ArgsBuffer(char *buffer, int bufferLength) {
  Q_strncpyz(buffer, Cmd_Args(), bufferLength);
}


x86 assembly (clang, -O0):
<Cmd_ArgsBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <Cmd_Args@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1040 <Q_strncpyz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_ArgsBuffer>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <Cmd_Args@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <Q_strncpyz@plt>

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

LLVM IR (-O2):
define void @Cmd_ArgsBuffer(i8* %0, i32 %1) {
%3 = tail call i32 (...) @Cmd_Args()
%4 = tail call i32 @Q_strncpyz(i8* %0, i32 %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_data(char *, char *);
int main(int argc, char **argv) {
  char the_data[40] = "yo,mo,do,wo";
  char the_address[16] = "192.168.1.106";
  send_data(the_data, the_address);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
mov    0xee5(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xee2(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <send_data@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <send_data@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.the_data = [40 x i8] c"yo,mo,do,wo\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.the_address = [16 x i8] c"192.168.1.106\00\00\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [40 x i8]
%6 = alloca [16 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [40 x i8]* %5 to i8*
%8 = bitcast [16 x i8]* %6 to i8*
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%11 = call i32 @send_data(i8* %9, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.the_data = [40 x i8] c"yo,mo,do,wo\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.the_address = [16 x i8] c"192.168.1.106\00\00\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [40 x i8]
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%7 = call i32 @send_data(i8* %5, i8* %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_bio(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ **);
int /*<<< orphan*/ RSAPublicKey_it;
RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa) {
  return ASN1_item_d2i_bio(&RSAPublicKey_it, bp, rsa);
}


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

x86 assembly (clang, -O2):
<d2i_RSAPublicKey_bio>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_d2i_bio@plt>

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

LLVM IR (-O2):
@RSAPublicKey_it = global i32 0
define i32* @d2i_RSAPublicKey_bio(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_bio(i32* @RSAPublicKey_it, i32* %0, i32** %1)
ret i32* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void ironlake_debug_dspstride(char *result, int len, int reg, uint32_t val,
                              uint32_t devid) {
  snprintf(result, len, "%d", val >> 6);
}


x86 assembly (clang, -O0):
<ironlake_debug_dspstride>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%ecx
sar    $0x6,%ecx
lea    0xec3(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ironlake_debug_dspstride>:
sar    $0x6,%ecx
lea    0xee6(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @ironlake_debug_dspstride(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = ashr i32 %13, 6
%15 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @ironlake_debug_dspstride(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = ashr i32 %3, 6
%7 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main() {
  int a[3] = {1, 2, 3};
  a[1] = 123;
  foo(a);
  return a[2];
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x8(%rsp)
mov    0xee2(%rip),%eax
mov    %eax,0x10(%rsp)
movl   $0x7b,0xc(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <foo@plt>
mov    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
store i32 123, i32* %4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = call i32 @foo(i32* %5)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
store i32 123, i32* %3
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = call i32 @foo(i32* %4)
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int getnpar(int, char *, char *, char **);
int getnparstringarray(int n, char *name, char **ptr) {
  return getnpar(n, name, "a", ptr);
}


x86 assembly (clang, -O0):
<getnparstringarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdx
call   1030 <getnpar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnparstringarray>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <getnpar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i32 @getnparstringarray(i32 %0, i8* %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8**, i8*** %6
%10 = call i32 @getnpar(i32 %7, i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define i32 @getnparstringarray(i32 %0, i8* %1, i8** %2) {
%4 = tail call i32 @getnpar(i32 %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2)
ret i32 %4
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long current_timestamp() {
  struct timeval te;
  gettimeofday(&te, NULL);
  long long milliseconds = te.tv_sec * 1000LL + te.tv_usec / 1000;
  return milliseconds;
}


x86 assembly (clang, -O0):
<current_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_timestamp>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%rcx
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define i64 @current_timestamp() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
store i64 %11, i64* %2
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define i64 @current_timestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ ped2geno(char *, char *, int *, int *);
int /*<<< orphan*/ print_convert(int, int);
void R_ped2geno(char **R_input_file, char **R_output_file, int *N, int *M) {
  ped2geno(*R_input_file, *R_output_file, N, M);
  print_convert(*N, *M);
}


x86 assembly (clang, -O0):
<R_ped2geno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <ped2geno@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1040 <print_convert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_ped2geno>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1030 <ped2geno@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <print_convert@plt>

LLVM IR (-O0):
define void @R_ped2geno(i8** %0, i8** %1, i32* %2, i32* %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32*
%8 = alloca i32*
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %6
%12 = load i8*, i8** %11
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = call i32 @ped2geno(i8* %10, i8* %12, i32* %13, i32* %14)
%16 = load i32*, i32** %7
%17 = load i32, i32* %16
%18 = load i32*, i32** %8
%19 = load i32, i32* %18
%20 = call i32 @print_convert(i32 %17, i32 %19)
ret void
}

LLVM IR (-O2):
define void @R_ped2geno(i8** nocapture %0, i8** nocapture %1, i32* %2, i32* %3) {
%5 = load i8*, i8** %0
%6 = load i8*, i8** %1
%7 = tail call i32 @ped2geno(i8* %5, i8* %6, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = tail call i32 @print_convert(i32 %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: kexecload [ <option> ] <atags path> <kernel path>\n"
                  "\n"
                  "options:\n"
                  "  -t                                       tests syscall\n"
                  "  -s <start address>                       specify start "
                  "address of kernel\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [200 x i8] c"usage: kexecload [ <option> ] <atags path> <kernel path>\0A\0Aoptions:\0A -t tests syscall\0A -s <start address> specify start address of kernel\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [200 x i8] c"usage: kexecload [ <option> ] <atags path> <kernel path>\0A\0Aoptions:\0A -t tests syscall\0A -s <start address> specify start address of kernel\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0))
ret void
}
long util_cpu_time(void) {
  long t = 0;
  return t;
}


x86 assembly (clang, -O0):
<util_cpu_time>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @util_cpu_time() {
%1 = alloca i64
store i64 0, i64* %1
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @util_cpu_time() {
ret i64 0
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *
createUnaryGeneralMathsExpression(struct memorycontainer *, int);
struct memorycontainer *
createLog10Expression(struct memorycontainer *expression) {
  return createUnaryGeneralMathsExpression(expression, 0x000D);
}


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

x86 assembly (clang, -O2):
<createLog10Expression>:
mov    $0xd,%esi
jmp    1030 <createUnaryGeneralMathsExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLog10Expression(%struct.memorycontainer* %0) {
%2 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %2
%3 = load %struct.memorycontainer*, %struct.memorycontainer** %2
%4 = call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %3, i32 13)
ret %struct.memorycontainer* %4
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLog10Expression(%struct.memorycontainer* %0) {
%2 = tail call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %0, i32 13)
ret %struct.memorycontainer* %2
}
double dBbp2b(double x) { return -0.5 + x / 6.0 * (1.0 - x * x / 30.0); }


x86 assembly (clang, -O0):
<dBbp2b>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf02(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  -0x8(%rbp),%xmm2
movsd  0xee4(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xed0(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb8(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dBbp2b>:
movapd %xmm0,%xmm1
divsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm0
divsd  0xef0(%rip),%xmm0
addsd  0xef0(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @dBbp2b(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 6.000000e+00
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = fdiv double %7, 3.000000e+01
%9 = fsub double 1.000000e+00, %8
%10 = call double @llvm.fmuladd.f64(double %4, double %9, double -5.000000e-01)
ret double %10
}

LLVM IR (-O2):
define double @dBbp2b(double %0) {
%2 = fdiv double %0, 6.000000e+00
%3 = fmul double %0, %0
%4 = fdiv double %3, 3.000000e+01
%5 = fsub double 1.000000e+00, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %5, double -5.000000e-01)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ atomic_fetch_and_add(int *, int);
int atomic_dec(int *pw) { return !atomic_fetch_and_add(pw, -1); }


x86 assembly (clang, -O0):
<atomic_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   1030 <atomic_fetch_and_add@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_dec>:
push   %rax
mov    $0xffffffff,%esi
call   1030 <atomic_fetch_and_add@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @atomic_dec(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @atomic_fetch_and_add(i32* %3, i32 -1)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @atomic_dec(i32* %0) {
%2 = tail call i32 @atomic_fetch_and_add(i32* %0, i32 -1)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void real_64_to_c(double d) { printf("%f\n", d); }


x86 assembly (clang, -O0):
<real_64_to_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_64_to_c>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @real_64_to_c(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ frecverr(char *);
int read(int /*<<< orphan*/, char *, int);
int noresponse(void) {
  char resp;
  if (read(STDOUT_FILENO, &resp, 1) != 1)
    frecverr("Lost connection");
  if (resp == '\0')
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<noresponse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     1154 <noresponse+0x34>
lea    0xeb1(%rip),%rdi
call   1040 <frecverr@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    116d <noresponse+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1174 <noresponse+0x54>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noresponse>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     114a <noresponse+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <frecverr@plt>
xor    %eax,%eax
cmpb   $0x0,0x7(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [16 x i8] c"Lost connection\00"
define i32 @noresponse() {
%1 = alloca i32
%2 = alloca i8
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @read(i32 %3, i8* %2, i32 1)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @frecverr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %1
br label %14
13: ; preds = %8
store i32 1, i32* %1
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [16 x i8] c"Lost connection\00"
define i32 @noresponse() {
%1 = alloca i8
%2 = load i32, i32* @STDOUT_FILENO
%3 = call i32 @read(i32 %2, i8* %1, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @frecverr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i8, i8* %1
%9 = icmp ne i8 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
char *makestrspace(size_t, char *);
char *mempcpy(char *, char const *, size_t);
char *stnputs(const char *s, size_t n, char *p) {
  p = makestrspace(n, p);
  p = mempcpy(p, s, n);
  return p;
}


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

x86 assembly (clang, -O2):
<stnputs>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <makestrspace@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
add    %r15,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @stnputs(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %5
%8 = load i8*, i8** %6
%9 = call i8* @makestrspace(i64 %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = call i8* @mempcpy(i8* %10, i8* %11, i64 %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
ret i8* %14
}

LLVM IR (-O2):
define i8* @stnputs(i8* nocapture %0, i64 %1, i8* %2) {
%4 = tail call i8* @makestrspace(i64 %1, i8* %2)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %0, i64 %1, i1 false)
%5 = getelementptr inbounds i8, i8* %4, i64 %1
ret i8* %5
}
void XGetGCValues() {}


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

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

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

LLVM IR (-O2):
define void @XGetGCValues() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rct_ena_usb_int_clk();
void rct_set_usb_clk(void) { rct_ena_usb_int_clk(); }


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

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

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

LLVM IR (-O2):
define void @rct_set_usb_clk() {
%1 = tail call i32 (...) @rct_ena_usb_int_clk()
ret void
}
int checking(int a, short b, signed char c) {
  return (a < 0 && b < 0 && c < 0);
}


x86 assembly (clang, -O0):
<checking>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %si,%cx
mov    %edi,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %al,-0x7(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x8(%rbp)
jge    1141 <checking+0x41>
movswl -0x6(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x8(%rbp)
jge    1141 <checking+0x41>
movsbl -0x7(%rbp),%eax
cmp    $0x0,%eax
setl   %al
mov    %al,-0x8(%rbp)
mov    -0x8(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checking>:
shr    $0x7,%dl
xor    %ecx,%ecx
test   %si,%si
movzbl %dl,%eax
cmovns %ecx,%eax
shr    $0x1f,%edi
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @checking(i32 %0, i16 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i16, i16* %5
%11 = sext i16 %10 to i32
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = icmp slt i32 %15, 0
br label %17
17: ; preds = %13, %9, %3
%18 = phi i1 [ false, %9 ], [ false, %3 ], [ %16, %13 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @checking(i32 %0, i16 signext %1, i8 signext %2) {
%4 = icmp slt i32 %0, 0
%5 = icmp slt i16 %1, 0
%6 = and i1 %4, %5
%7 = lshr i8 %2, 7
%8 = zext i8 %7 to i32
%9 = select i1 %6, i32 %8, i32 0
ret i32 %9
}
void foo014(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo014(i32 %0) {
ret void
}
int incr(int val) { return val + 1; }


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

x86 assembly (clang, -O2):
<incr>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @incr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @incr(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
long raster_order2number(long const *);
long edf_raster_order2number(const long order[]) {
  return (raster_order2number(order));
}


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

x86 assembly (clang, -O2):
<edf_raster_order2number>:
jmp    1030 <raster_order2number@plt>

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

LLVM IR (-O2):
define i64 @edf_raster_order2number(i64* %0) {
%2 = tail call i64 @raster_order2number(i64* %0)
ret i64 %2
}
int main() {
  int *p = __builtin_malloc(4);
  *p = 4;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int _pb_print_bits(int *, int);
int _pb_print_bits_i(int value) { return _pb_print_bits(&value, sizeof(int)); }


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

x86 assembly (clang, -O2):
<_pb_print_bits_i>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <_pb_print_bits@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_pb_print_bits_i(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_pb_print_bits(i32* %2, i32 4)
ret i32 %3
}
void set_bitvec(bitvec, n) unsigned char *bitvec;
unsigned short n;
{
  static unsigned char bittbl[] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80};
  bitvec[n >> 3] |= bittbl[n & 7];
}


x86 assembly (clang, -O0):
<set_bitvec>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0x7,%eax
movslq %eax,%rcx
lea    0x2f00(%rip),%rax
movzbl (%rax,%rcx,1),%esi
mov    -0x8(%rbp),%rax
movzwl -0xa(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bitvec>:
mov    %esi,%eax
and    $0x7,%eax
lea    0xef4(%rip),%rcx
mov    (%rax,%rcx,1),%al
shr    $0x3,%esi
and    $0x1fff,%esi
or     %al,(%rdi,%rsi,1)
ret

LLVM IR (-O0):
@set_bitvec.bittbl = internal global [8 x i8] c"\01\02\04\08\10 @\80"
define void @set_bitvec(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = trunc i32 %1 to i16
store i8* %0, i8** %3
store i16 %5, i16* %4
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = and i32 %7, 7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [8 x i8], [8 x i8]* @set_bitvec.bittbl, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8*, i8** %3
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = ashr i32 %15, 3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %13, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %20, %12
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
ret void
}

LLVM IR (-O2):
@set_bitvec.bittbl = internal unnamed_addr constant [8 x i8] c"\01\02\04\08\10 @\80"
define void @set_bitvec(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [8 x i8], [8 x i8]* @set_bitvec.bittbl, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = lshr i32 %1, 3
%8 = and i32 %7, 8191
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = or i8 %11, %6
store i8 %12, i8* %10
ret void
}
__attribute__((always_)) void acpi_disable_pci(void) {}


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

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

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

LLVM IR (-O2):
define void @acpi_disable_pci() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ work();
int main(void) {
  freopen("alignment.in", "r", stdin);
  freopen("alignment.out", "w", stdout);
  work();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
lea    0xec1(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edx
lea    0xeb4(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1040 <freopen@plt>
mov    $0x0,%al
call   1030 <work@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
lea    0xec2(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1040 <freopen@plt>
xor    %eax,%eax
call   1030 <work@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"alignment.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [14 x i8] c"alignment.out\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32 @freopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = call i32 @freopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @work()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"alignment.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [14 x i8] c"alignment.out\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @work()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ioline_new() {
  printf("NOT IMPLEMENTED:"
         "pa_ioline_new"
         "\n");
}


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

x86 assembly (clang, -O2):
<pa_ioline_new>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_ioline_new\0A\00"
define i32 @pa_ioline_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_ioline_new\00"
define i32 @pa_ioline_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int nbytes;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *malloc(unsigned int);
int /*<<< orphan*/ perror(char *);
char *cagetmem(u_int nbytes) {
  char *ret;
  ret = malloc(((unsigned)(((nbytes) + 31) & ~31)));
  if (!ret) {
    perror("cagetmem malloc");
    exit(-1);
  }
  return (ret);
}


x86 assembly (clang, -O0):
<cagetmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1f,%edi
and    $0xffffffe0,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <cagetmem+0x3e>
lea    0xea1(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cagetmem>:
push   %rax
add    $0x1f,%edi
and    $0xffffffe0,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1143 <cagetmem+0x13>
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"cagetmem malloc\00"
define i8* @cagetmem(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 31
%6 = and i32 %5, -32
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"cagetmem malloc\00"
define noalias i8* @cagetmem(i32 %0) {
%2 = add nsw i32 %0, 31
%3 = and i32 %2, -32
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
ret i8* %4
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void random_array(int a[], int n) {
  srand((unsigned)time(NULL));
  for (int i = 0; i < n; ++i)
    a[i] = rand() % 100;
}


x86 assembly (clang, -O0):
<random_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118a <random_array+0x5a>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <random_array+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_array>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
test   %ebp,%ebp
jle    117f <random_array+0x4f>
mov    %ebp,%ebp
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <random_array+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @random_array(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = zext i32 %1 to i64
br label %10
9: ; preds = %10, %2
ret void
10: ; preds = %7, %10
%11 = phi i64 [ 0, %7 ], [ %15, %10 ]
%12 = tail call i32 (...) @rand()
%13 = srem i32 %12, 100
%14 = getelementptr inbounds i32, i32* %0, i64 %11
store i32 %13, i32* %14
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %9, label %10
}