xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
int /*<<< orphan*/ ol(char *);
void convSint2char(void) {
  ol("ld\ta,l");
  callrts("l_sxt");
}


x86 assembly (clang, -O0):
<convSint2char>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <ol@plt>
lea    0xed0(%rip),%rdi
call   1030 <callrts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<convSint2char>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <ol@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <callrts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ld\09a,l\00"
@.str.1 = [6 x i8] c"l_sxt\00"
define void @convSint2char() {
%1 = call i32 @ol(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ld\09a,l\00"
@.str.1 = [6 x i8] c"l_sxt\00"
define void @convSint2char() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double tvtod(struct timeval);
double dtime() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tvtod(tv));
}


x86 assembly (clang, -O0):
<dtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
call   1040 <tvtod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <tvtod@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define double @dtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call double @tvtod(i32 %4)
ret double %5
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define double @dtime() {
%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 i32, i32* %4
%6 = tail call double @tvtod(i32 %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ AirspeedSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AirspeedSettingsRequestUpdate() {
  UAVObjRequestUpdate(AirspeedSettingsHandle());
}


x86 assembly (clang, -O0):
<AirspeedSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AirspeedSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AirspeedSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <AirspeedSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @AirspeedSettingsRequestUpdate() {
%1 = call i32 (...) @AirspeedSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AirspeedSettingsRequestUpdate() {
%1 = tail call i32 (...) @AirspeedSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int fastrand();
int M_Random(void) { return (fastrand() & 255); }


x86 assembly (clang, -O0):
<M_Random>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fastrand@plt>
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_Random>:
push   %rax
xor    %eax,%eax
call   1030 <fastrand@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @M_Random() {
%1 = call i32 (...) @fastrand()
%2 = and i32 %1, 255
ret i32 %2
}

LLVM IR (-O2):
define i32 @M_Random() {
%1 = tail call i32 (...) @fastrand()
%2 = and i32 %1, 255
ret i32 %2
}
void mallocAssert(int *g) {
  struct xx *p = malloc(12);
  ((g != 0)
       ? (void)(0)
       : __assert_fail(
             "g != 0",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/indashnet/InDashNet.Open.UN2000/refs/"
             "heads/master/android/external/clang/test/Analysis/malloc.c",
             621, __func__));
  free(p);
  return;
}


x86 assembly (clang, -O0):
<mallocAssert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115a <mallocAssert+0x2a>
jmp    117b <mallocAssert+0x4b>
lea    0xe9f(%rip),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x26d,%edx
lea    0xf4d(%rip),%rcx
mov    $0x0,%al
call   1040 <__assert_fail@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocAssert>:
test   %rdi,%rdi
je     1116 <mallocAssert+0x6>
ret
lea    0xee3(%rip),%rdi
lea    0xee3(%rip),%rsi
lea    0xf96(%rip),%rcx
mov    $0x26d,%edx
xor    %eax,%eax
jmp    1030 <__assert_fail@plt>

LLVM IR (-O0):
%struct.xx = type opaque
@.str = [7 x i8] c"g != 0\00"
@.str.1 = [186 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/indashnet/InDashNet.Open.UN2000/refs/heads/master/android/external/clang/test/Analysis/malloc.c\00"
@__func__.mallocAssert = [13 x i8] c"mallocAssert\00"
define void @mallocAssert(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.xx*
store i32* %0, i32** %2
%4 = call i8* @malloc(i64 12)
%5 = bitcast i8* %4 to %struct.xx*
store %struct.xx* %5, %struct.xx** %3
%6 = load i32*, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %11
9: ; preds = %1
%10 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str.1, i64 0, i64 0), i32 621, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.mallocAssert, i64 0, i64 0))
br label %11
11: ; preds = %9, %8
%12 = load %struct.xx*, %struct.xx** %3
%13 = bitcast %struct.xx* %12 to i8*
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"g != 0\00"
@.str.1 = [186 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/indashnet/InDashNet.Open.UN2000/refs/heads/master/android/external/clang/test/Analysis/malloc.c\00"
@__func__.mallocAssert = [13 x i8] c"mallocAssert\00"
define void @mallocAssert(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str.1, i64 0, i64 0), i32 621, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.mallocAssert, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
char *malloc(int);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *cycle(char *s) {
  int n = strlen(s);
  char *u = malloc(n + 1);
  strncpy(u, s + 1, n - 1);
  u[n - 1] = s[0];
  u[n] = '\0';
  return u;
}


x86 assembly (clang, -O0):
<cycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0x1(%r14),%rsi
movslq %r15d,%r15
lea    -0x1(%r15),%rdx
mov    %rax,%rdi
call   1030 <strncpy@plt>
mov    (%r14),%al
mov    %al,-0x1(%rbx,%r15,1)
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @cycle(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
%15 = call i32 @strncpy(i8* %10, i8* %12, i32 %14)
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 %18, i8* %23
%24 = load i8*, i8** %4
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
store i8 0, i8* %27
%28 = load i8*, i8** %4
ret i8* %28
}

LLVM IR (-O2):
define i8* @cycle(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = add nsw i32 %2, -1
%7 = tail call i32 @strncpy(i8* %4, i8* %5, i32 %6)
%8 = load i8, i8* %0
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds i8, i8* %4, i64 %9
store i8 %8, i8* %10
%11 = sext i32 %2 to i64
%12 = getelementptr inbounds i8, i8* %4, i64 %11
store i8 0, i8* %12
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail(char *, char *, unsigned int, char *);
int constant();
int /*<<< orphan*/ f();
void main(void) {
  int i1;
  int i2;
  {
    {
      i1 = constant();
      f();
      i2 = constant();
    }
    if (i1 == i2) {
    } else {
      { __assert_fail("i1 == i2", "test.c", 14U, "main"); }
    }
    return;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <constant@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1050 <constant@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1164 <main+0x34>
jmp    1183 <main+0x53>
lea    0xe95(%rip),%rdi
lea    0xe97(%rip),%rsi
mov    $0xe,%edx
lea    0xe92(%rip),%rcx
call   1040 <__assert_fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <constant@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1050 <constant@plt>
cmp    %eax,%ebx
jne    114e <main+0x1e>
pop    %rbx
ret
lea    0xeab(%rip),%rdi
lea    0xead(%rip),%rsi
lea    0xead(%rip),%rcx
mov    $0xe,%edx
pop    %rbx
jmp    1040 <__assert_fail@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"i1 == i2\00"
@.str.1 = [7 x i8] c"test.c\00"
@.str.2 = [5 x i8] c"main\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @constant()
store i32 %3, i32* %1
%4 = call i32 (...) @f()
%5 = call i32 (...) @constant()
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %0
br label %12
10: ; preds = %0
%11 = call i32 @__assert_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"i1 == i2\00"
@.str.1 = [7 x i8] c"test.c\00"
@.str.2 = [5 x i8] c"main\00"
define void @main() {
%1 = tail call i32 (...) @constant()
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @constant()
%4 = icmp eq i32 %1, %3
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @__assert_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
ret void
}
int test_imm_9Aint32_reg(int val) { return ((val) & (0x9A << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_9Aint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x9a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Aint32_reg>:
test   $0x9a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Aint32_reg(i32 %0) {
%2 = and i32 %0, 154
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ radio_get_bl();
int /*<<< orphan*/ rom_write(int, int /*<<< orphan*/);
void radio_write_rom_bl(void) { rom_write(55, radio_get_bl()); }


x86 assembly (clang, -O0):
<radio_write_rom_bl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <radio_get_bl@plt>
mov    %eax,%esi
mov    $0x37,%edi
call   1040 <rom_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<radio_write_rom_bl>:
push   %rax
xor    %eax,%eax
call   1030 <radio_get_bl@plt>
mov    $0x37,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <rom_write@plt>

LLVM IR (-O0):
define void @radio_write_rom_bl() {
%1 = call i32 (...) @radio_get_bl()
%2 = call i32 @rom_write(i32 55, i32 %1)
ret void
}

LLVM IR (-O2):
define void @radio_write_rom_bl() {
%1 = tail call i32 (...) @radio_get_bl()
%2 = tail call i32 @rom_write(i32 55, i32 %1)
ret void
}
void test_array_sum() {}


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

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

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

LLVM IR (-O2):
define void @test_array_sum() {
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
int rotl64(unsigned long long, int);
uint64_t hash64_mix(uint64_t x, uint64_t y) {
  x = rotl64(x * 14029467366897019727ULL, 31) * 11400714785074694791ULL;
  y = rotl64(y ^ x, 31) * 5 + 0xbdef9f91b243c6e6ULL;
  return y;
}


x86 assembly (clang, -O0):
<hash64_mix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0xc2b2ae3d27d4eb4f,%rdi
ae b2 c2
imul   -0x8(%rbp),%rdi
mov    $0x1f,%esi
call   1030 <rotl64@plt>
cltq
movabs $0x9e3779b185ebca87,%rcx
79 37 9e
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
xor    -0x8(%rbp),%rdi
mov    $0x1f,%esi
call   1030 <rotl64@plt>
imul   $0x5,%eax,%eax
cltq
movabs $0xbdef9f91b243c6e6,%rcx
9f ef bd
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash64_mix>:
push   %rbx
mov    %rsi,%rbx
movabs $0xc2b2ae3d27d4eb4f,%rax
ae b2 c2
imul   %rax,%rdi
mov    $0x1f,%esi
call   1030 <rotl64@plt>
cltq
movabs $0x9e3779b185ebca87,%rdi
79 37 9e
imul   %rax,%rdi
xor    %rbx,%rdi
mov    $0x1f,%esi
call   1030 <rotl64@plt>
lea    (%rax,%rax,4),%eax
movslq %eax,%rcx
movabs $0xbdef9f91b243c6e6,%rax
9f ef bd
add    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @hash64_mix(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = mul i64 %5, -4417276706812531889
%7 = call i32 @rotl64(i64 %6, i32 31)
%8 = sext i32 %7 to i64
%9 = mul i64 %8, -7046029288634856825
store i64 %9, i64* %3
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = xor i64 %10, %11
%13 = call i32 @rotl64(i64 %12, i32 31)
%14 = mul nsw i32 %13, 5
%15 = sext i32 %14 to i64
%16 = add i64 %15, -4760410832997464346
store i64 %16, i64* %4
%17 = load i64, i64* %4
ret i64 %17
}

LLVM IR (-O2):
define i64 @hash64_mix(i64 %0, i64 %1) {
%3 = mul i64 %0, -4417276706812531889
%4 = tail call i32 @rotl64(i64 %3, i32 31)
%5 = sext i32 %4 to i64
%6 = mul i64 %5, -7046029288634856825
%7 = xor i64 %6, %1
%8 = tail call i32 @rotl64(i64 %7, i32 31)
%9 = mul nsw i32 %8, 5
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, -4760410832997464346
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sprintf_malloc() {
  printf("NOT IMPLEMENTED:"
         "pa_sprintf_malloc"
         "\n");
}


x86 assembly (clang, -O0):
<pa_sprintf_malloc>:
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_sprintf_malloc>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_sprintf_malloc\00"
define i32 @pa_sprintf_malloc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void swap(int *a1, int *a2) {
  int temp = 0;
  if (a1 == 0 || a2 == 0)
    return;
  temp = *a1;
  *a1 = *a2;
  *a2 = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <swap+0x29>
cmpq   $0x0,-0x10(%rbp)
jne    112e <swap+0x2e>
jmp    114c <swap+0x4c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
test   %rdi,%rdi
je     1112 <swap+0x12>
test   %rsi,%rsi
je     1112 <swap+0x12>
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, null
%4 = icmp eq i32* %1, null
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* %0
%8 = load i32, i32* %1
store i32 %8, i32* %0
store i32 %7, i32* %1
br label %9
9: ; preds = %2, %6
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR8F_get(void) { return U_WMRCORENONE_get("U_WMR8F"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR8F\00"
define i32 @U_WMR8F_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR8F\00"
define i32 @U_WMR8F_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int change_memory_attr(unsigned long, int, int);
int set_memory_rw(unsigned long addr, int numpages) {
  return change_memory_attr(addr, numpages, 1);
}


x86 assembly (clang, -O0):
<set_memory_rw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <change_memory_attr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_memory_rw>:
mov    $0x1,%edx
jmp    1030 <change_memory_attr@plt>

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

LLVM IR (-O2):
define i32 @set_memory_rw(i64 %0, i32 %1) {
%3 = tail call i32 @change_memory_attr(i64 %0, i32 %1, i32 1)
ret i32 %3
}
void gtk_invisible_get_screen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_invisible_get_screen() {
ret void
}
long kernel__Int___43d(long self, long p0) {
  long var;
  long var1;
  var1 = self + p0;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Int___43d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Int___43d>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @kernel__Int___43d(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = add nsw i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @kernel__Int___43d(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t n) {
  const unsigned char *p = s;
  while (n--) {
    if (*p == (unsigned char)c) {
      return (void *)p;
    }
    ++p;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1163 <memchr+0x63>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1152 <memchr+0x52>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <memchr+0x6b>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
je     1122 <memchr+0x22>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1124 <memchr+0x24>
add    $0xffffffffffffffff,%rdx
add    $0x1,%rax
test   %rdx,%rdx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %13
%8 = phi i64 [ %2, %5 ], [ %10, %13 ]
%9 = phi i8* [ %0, %5 ], [ %14, %13 ]
%10 = add i64 %8, -1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, %6
br i1 %12, label %16, label %13
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = icmp eq i64 %10, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %13, %3
%17 = phi i8* [ null, %3 ], [ null, %13 ], [ %9, %7 ]
ret i8* %17
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ test_leaks_pid(char const *, int /*<<< orphan*/);
void test_leaks(const char *name) { test_leaks_pid(name, getpid()); }


x86 assembly (clang, -O0):
<test_leaks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <test_leaks_pid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_leaks>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <test_leaks_pid@plt>

LLVM IR (-O0):
define void @test_leaks(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @getpid()
%5 = call i32 @test_leaks_pid(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @test_leaks(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @test_leaks_pid(i8* %0, i32 %2)
ret void
}
int test_imm_5Eint16_mem(short *val) {
  return ((*val) & (-0x5E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Eint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -94
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printTestInfo(char *, char *);
int nullNodeTest() {
  printTestInfo("nullNodeTest", "(not implemented)");
  return 0;
}


x86 assembly (clang, -O0):
<nullNodeTest>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeeb(%rip),%rsi
call   1030 <printTestInfo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"nullNodeTest\00"
@.str.1 = [18 x i8] c"(not implemented)\00"
define i32 @nullNodeTest() {
%1 = call i32 @printTestInfo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"nullNodeTest\00"
@.str.1 = [18 x i8] c"(not implemented)\00"
define i32 @nullNodeTest() {
%1 = tail call i32 @printTestInfo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void dec_zcache_eph_zbytes(unsigned zsize) {}


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

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

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

LLVM IR (-O2):
define void @dec_zcache_eph_zbytes(i32 %0) {
ret void
}
float damping(float cfm, float erp) { return ((1.f - (erp)) / (cfm)); }


x86 assembly (clang, -O0):
<damping>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xeea(%rip),%xmm0
subss  -0x8(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<damping>:
movss  0xef8(%rip),%xmm2
subss  %xmm1,%xmm2
divss  %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @damping(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fsub float 1.000000e+00, %5
%7 = load float, float* %3
%8 = fdiv float %6, %7
ret float %8
}

LLVM IR (-O2):
define float @damping(float %0, float %1) {
%3 = fsub float 1.000000e+00, %1
%4 = fdiv float %3, %0
ret float %4
}
/* Variables and functions */
int multiple2Values();
int /*<<< orphan*/ printf(char *, ...);
void main() {
  printf("Begin call function main() in extern_main.c\n");
  int result = multiple2Values();
  printf("** Result is %d\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <multiple2Values@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <multiple2Values@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Begin call function main() in extern_main.c\0A\00"
@.str.1 = [17 x i8] c"** Result is %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @multiple2Values()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"** Result is %d\0A\00"
@str = [44 x i8] c"Begin call function main() in extern_main.c\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @multiple2Values()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
void swap(int *array, const int i, const int j) {
  int temp;
  temp = array[i];
  array[i] = array[j];
  array[j] = temp;
  return;
}


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
}
/* Variables and functions */
double atof(char *);
double string__NativeString__atof(char *self) {
  double var;
  double var1;
  var1 = atof(self);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<string__NativeString__atof>:
jmp    1030 <atof@plt>

LLVM IR (-O0):
define double @string__NativeString__atof(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca double
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call double @atof(i8* %5)
store double %6, double* %4
%7 = load double, double* %4
store double %7, double* %3
br label %8
8: ; preds = %1
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @string__NativeString__atof(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ sink(void *);
__attribute__((noipa)) void *return_array(void) {
  int a[32];
  void *p = a;
  sink(p);
  return p;
}


x86 assembly (clang, -O0):
<return_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
call   1030 <sink@plt>
mov    -0x88(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_array>:
push   %rbx
sub    $0x80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sink@plt>
mov    %rbx,%rax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @return_array() {
%1 = alloca [32 x i32]
%2 = alloca i8*
%3 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%4 = bitcast i32* %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @sink(i8* %5)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define i8* @return_array() {
%1 = alloca [32 x i32]
%2 = bitcast [32 x i32]* %1 to i8*
%3 = call i32 @sink(i8* %2)
ret i8* %2
}
/* Type definitions */
struct cpufreq_affected_cpus {
  int dummy;
};

/* Variables and functions */
struct cpufreq_affected_cpus *sysfs_get_freq_related_cpus(unsigned int);
struct cpufreq_affected_cpus *cpufreq_get_related_cpus(unsigned int cpu) {
  return sysfs_get_freq_related_cpus(cpu);
}


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

x86 assembly (clang, -O2):
<cpufreq_get_related_cpus>:
jmp    1030 <sysfs_get_freq_related_cpus@plt>

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

LLVM IR (-O2):
%struct.cpufreq_affected_cpus = type { i32 }
define %struct.cpufreq_affected_cpus* @cpufreq_get_related_cpus(i32 %0) {
%2 = tail call %struct.cpufreq_affected_cpus* @sysfs_get_freq_related_cpus(i32 %0)
ret %struct.cpufreq_affected_cpus* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void Fhalt() { exit(0); }


x86 assembly (clang, -O0):
<Fhalt>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<Fhalt>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @Fhalt() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @Fhalt() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int bmp180_get_p();
double bmp180_get_t();
int /*<<< orphan*/ bmp180_init();
int /*<<< orphan*/ printf(char *, double, int);
int bmp180_main(int argc, const char *argv[]) {
  bmp180_init();
  double t = bmp180_get_t();
  printf("get temp = %.1f, pressure = %d\n", t / 10, bmp180_get_p());
  return 0;
}


x86 assembly (clang, -O0):
<bmp180_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <bmp180_init@plt>
mov    $0x0,%al
call   1050 <bmp180_get_t@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe91(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <bmp180_get_p@plt>
movsd  -0x20(%rbp),%xmm0
mov    %eax,%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmp180_main>:
push   %rax
xor    %eax,%eax
call   1060 <bmp180_init@plt>
xor    %eax,%eax
call   1050 <bmp180_get_t@plt>
divsd  0xea9(%rip),%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <bmp180_get_p@plt>
lea    0xe9e(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"get temp = %.1f, pressure = %d\0A\00"
define i32 @bmp180_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (...) @bmp180_init()
%7 = call double (...) @bmp180_get_t()
store double %7, double* %5
%8 = load double, double* %5
%9 = fdiv double %8, 1.000000e+01
%10 = call i32 (...) @bmp180_get_p()
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"get temp = %.1f, pressure = %d\0A\00"
define i32 @bmp180_main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @bmp180_init()
%4 = tail call double (...) @bmp180_get_t()
%5 = fdiv double %4, 1.000000e+01
%6 = tail call i32 (...) @bmp180_get_p()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ flashfsGetWriteBufferSize();
scalar_t__ flashfsTransmitBufferUsed();
uint32_t flashfsGetWriteBufferFreeSpace(void) {
  return flashfsGetWriteBufferSize() - flashfsTransmitBufferUsed();
}


x86 assembly (clang, -O0):
<flashfsGetWriteBufferFreeSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <flashfsGetWriteBufferSize@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <flashfsTransmitBufferUsed@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flashfsGetWriteBufferFreeSpace>:
push   %rbx
xor    %eax,%eax
call   1040 <flashfsGetWriteBufferSize@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <flashfsTransmitBufferUsed@plt>
sub    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @flashfsGetWriteBufferFreeSpace() {
%1 = call i64 (...) @flashfsGetWriteBufferSize()
%2 = call i64 (...) @flashfsTransmitBufferUsed()
%3 = sub nsw i64 %1, %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @flashfsGetWriteBufferFreeSpace() {
%1 = tail call i64 (...) @flashfsGetWriteBufferSize()
%2 = tail call i64 (...) @flashfsTransmitBufferUsed()
%3 = sub nsw i64 %1, %2
ret i64 %3
}
int is_prefixed(const char s[]) { return (s[0] == '0' && s[1] == 'X'); }


x86 assembly (clang, -O0):
<is_prefixed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jne    112e <is_prefixed+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x58,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prefixed>:
xor    %eax,%eax
cmpb   $0x30,(%rdi)
jne    1110 <is_prefixed+0x10>
xor    %eax,%eax
cmpb   $0x58,0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_prefixed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 48
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 88
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_prefixed(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 88
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
__attribute__((always_)) void outw_local(unsigned short value, int port) {
  __asm__ __volatile__("out"
                       "w"
                       " %"
                       "w"
                       "0, %w1"
                       :
                       : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw_local>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%edx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw_local>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw_local(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @outw_local(i16 zeroext %0, i32 %1) {
tail call void asm sideeffect "outw ${0:w}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int evil_pivot_root(const char *new_root, const char *old_put) {
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<evil_pivot_root>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evil_pivot_root>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EPERM = global i32 0
@errno = global i32 0
define i32 @evil_pivot_root(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EPERM
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
define i32 @evil_pivot_root(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EPERM
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
char *getHost() {
  char hostname[1024];
  hostname[1023] = '\0';
  gethostname(hostname, 1023);
  return hostname;
}


x86 assembly (clang, -O0):
<getHost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movb   $0x0,-0x1(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3ff,%esi
call   1030 <gethostname@plt>
lea    -0x400(%rbp),%rax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHost>:
push   %rbx
sub    $0x400,%rsp
movb   $0x0,0x3ff(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3ff,%esi
call   1030 <gethostname@plt>
mov    %rbx,%rax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getHost() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 1023
store i8 0, i8* %2
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = call i32 @gethostname(i8* %3, i32 1023)
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
ret i8* %5
}

LLVM IR (-O2):
define i8* @getHost() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 1023
store i8 0, i8* %3
%4 = call i32 @gethostname(i8* %2, i32 1023)
ret i8* %2
}
void emit_blob_end(struct processor_explicatory_state *process_state,
                   struct modern_stream *stream, void *stream_state,
                   struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_blob_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_blob_end(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_blob_end(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
int main(int argc, char *argv[]) {
  *((volatile int *)0) = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 0, i32* null
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
store volatile i32 0, i32* null
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void die(const char *message) {
  write(2, message, strlen(message));
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}