xunge/DecIR huggingface dataset:
void setnull(int a[16]) {
  for (int i = 0; i < 16; i++)
    a[i] = 0;
}


x86 assembly (clang, -O0):
<setnull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1136 <setnull+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <setnull+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnull>:
xorps  %xmm0,%xmm0
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @setnull(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void waitasec(int msec) {
  struct timespec rgt;
  rgt.tv_sec = msec / 1000;
  rgt.tv_nsec = (msec % 1000) * 1000000l;
  nanosleep(&rgt, NULL);
}


x86 assembly (clang, -O0):
<waitasec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
imul   $0xf4240,%rax,%rax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitasec>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @waitasec(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = mul nsw i64 %9, 1000000
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %11, i32* %12
%13 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @waitasec(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int64_t command_compare(void *keyA, void *keyB) {
  return strcmp((char *)keyA, (char *)keyB);
}


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

x86 assembly (clang, -O2):
<command_compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @command_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char const *);
int /*<<< orphan*/ join_path(int, char *, char *, char *);
FILE *fopena(char *path, char *name, const char *mode) {
  char wholename[200];
  join_path(2, wholename, path, name);
  FILE *pointer;
  pointer = fopen(wholename, mode);
  return pointer;
}


x86 assembly (clang, -O0):
<fopena>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0xe0(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x2,%edi
call   1030 <join_path@plt>
lea    -0xe0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0xe8(%rbp)
mov    -0xe8(%rbp),%rax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopena>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %rdx,%rbx
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    %rsp,%r14
mov    $0x2,%edi
mov    %r14,%rsi
call   1030 <join_path@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <fopen@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @fopena(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [200 x i8]
%8 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i32 @join_path(i32 2, i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%14 = load i8*, i8** %6
%15 = call i32* @fopen(i8* %13, i8* %14)
store i32* %15, i32** %8
%16 = load i32*, i32** %8
ret i32* %16
}

LLVM IR (-O2):
define noalias i32* @fopena(i8* %0, i8* %1, i8* nocapture %2) {
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = call i32 @join_path(i32 2, i8* %5, i8* %0, i8* %1)
%7 = call i32* @fopen(i8* %5, i8* %2)
ret i32* %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x29() {
  Assert_real((isascii(41)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              210, ("isascii should be 1 for )"));
}


x86 assembly (clang, -O0):
<t_isascii_0x29>:
push   %rbp
mov    %rsp,%rbp
mov    $0x29,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xd2,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x29>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0xd2,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for )\00"
define void @t_isascii_0x29() {
%1 = call i32 @isascii(i32 41)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for )\00"
define void @t_isascii_0x29() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int secs_in_yr;
  secs_in_yr = 24 * 60 * 60 * 365;
  printf("Seconds in a year: %d", secs_in_yr);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Seconds in a year: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 31536000, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Seconds in a year: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 31536000)
ret i32 0
}
void foo571() {}


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

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

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

LLVM IR (-O2):
define void @foo571() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
char *troca(char *);
int main(void) {
  char nome[100];
  printf("Informe o nome para ser invertida :");
  scanf("%[^\n]s", nome);
  printf("%s\n", troca(nome));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <troca@plt>
mov    %rax,%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1060 <troca@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Informe o nome para ser invertida :\00"
@.str.1 = [7 x i8] c"%[^\0A]s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i8* @troca(i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Informe o nome para ser invertida :\00"
@.str.1 = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i8* @troca(i8* %2)
%6 = call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_u16(scalar_t__);
scalar_t__ plcvm_lpm_u16();
int plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_u2_cs16(void) {
  plcvm_push(plcvm_get_u16(plcvm_pop() * 2 + plcvm_lpm_u16()));
}


x86 assembly (clang, -O0):
<cb_ldm_u2_cs16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <plcvm_pop@plt>
shl    $0x1,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <plcvm_lpm_u16@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1030 <plcvm_get_u16@plt>
mov    %eax,%edi
call   1060 <plcvm_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_u2_cs16>:
push   %rbx
xor    %eax,%eax
call   1040 <plcvm_pop@plt>
add    %eax,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1050 <plcvm_lpm_u16@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1030 <plcvm_get_u16@plt>
mov    %eax,%edi
pop    %rbx
jmp    1060 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_u2_cs16() {
%1 = call i32 (...) @plcvm_pop()
%2 = mul nsw i32 %1, 2
%3 = sext i32 %2 to i64
%4 = call i64 (...) @plcvm_lpm_u16()
%5 = add nsw i64 %3, %4
%6 = call i32 @plcvm_get_u16(i64 %5)
%7 = call i32 @plcvm_push(i32 %6)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_u2_cs16() {
%1 = tail call i32 (...) @plcvm_pop()
%2 = shl nsw i32 %1, 1
%3 = sext i32 %2 to i64
%4 = tail call i64 (...) @plcvm_lpm_u16()
%5 = add nsw i64 %4, %3
%6 = tail call i32 @plcvm_get_u16(i64 %5)
%7 = tail call i32 @plcvm_push(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ resetMote();
void netprog_reboot() { resetMote(); }


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

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

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

LLVM IR (-O2):
define void @netprog_reboot() {
%1 = tail call i32 (...) @resetMote()
ret void
}
/* Variables and functions */
int climbStairs(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("%d == %d\n", 1134903170, climbStairs(45));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2d,%edi
call   1040 <climbStairs@plt>
lea    0xece(%rip),%rdi
mov    $0x43a53f82,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d == %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @climbStairs(i32 45)
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1134903170, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d == %d\0A\00"
define i32 @main() {
%1 = tail call i32 @climbStairs(i32 45)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1134903170, i32 %1)
ret i32 0
}
void perf_init(char *fname) { return; }


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

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

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

LLVM IR (-O2):
define void @perf_init(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pucCommand1;

/* Variables and functions */
int /*<<< orphan*/ RITWriteCommand(unsigned char const *, int);
void RIT128x96x4DisplayOff(void) {
  static const unsigned char pucCommand1[] = {0xAE, 0xe3};
  RITWriteCommand(pucCommand1, sizeof(pucCommand1));
}


x86 assembly (clang, -O0):
<RIT128x96x4DisplayOff>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <RITWriteCommand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RIT128x96x4DisplayOff>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <RITWriteCommand@plt>

LLVM IR (-O0):
@RIT128x96x4DisplayOff.pucCommand1 = internal constant [2 x i8] c"\AE\E3"
define void @RIT128x96x4DisplayOff() {
%1 = call i32 @RITWriteCommand(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @RIT128x96x4DisplayOff.pucCommand1, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@RIT128x96x4DisplayOff.pucCommand1 = internal constant [2 x i8] c"\AE\E3"
define void @RIT128x96x4DisplayOff() {
%1 = tail call i32 @RITWriteCommand(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @RIT128x96x4DisplayOff.pucCommand1, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void Uart_Rxd_Func(char Data) { printf("%c", Data); }


x86 assembly (clang, -O0):
<Uart_Rxd_Func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Uart_Rxd_Func>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @Uart_Rxd_Func(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
int FDLIBM_finite(double x) {
  int hx;
  hx = *(1 + (int *)&x);
  return (unsigned)((hx & 0x7fffffff) - 0x7ff00000) >> 31;
}


x86 assembly (clang, -O0):
<FDLIBM_finite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
sub    $0x7ff00000,%eax
shr    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FDLIBM_finite>:
movq   %xmm0,%rax
shr    $0x20,%rax
and    $0x7fffffff,%eax
add    $0x80100000,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @FDLIBM_finite(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = bitcast double* %2 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 2147483647
%9 = sub nsw i32 %8, 2146435072
%10 = lshr i32 %9, 31
ret i32 %10
}

LLVM IR (-O2):
define i32 @FDLIBM_finite(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 32
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 2147483647
%6 = add nsw i32 %5, -2146435072
%7 = lshr i32 %6, 31
ret i32 %7
}
int xwrite(fd, data, size)
int fd;
char *data;
int size;
{
  int cc;
  while (size > 0) {
    cc = write(fd, data, size);
    if (cc < 0)
      return cc;
    data += cc;
    size -= cc;
  }
  return 0;
}


x86 assembly (clang, -O0):
<xwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1176 <xwrite+0x66>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1155 <xwrite+0x45>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <xwrite+0x6d>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1122 <xwrite+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xwrite>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    113c <xwrite+0x2c>
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <write@plt>
test   %eax,%eax
js     113e <xwrite+0x2e>
mov    %eax,%ecx
add    %rcx,%rbx
sub    %eax,%ebp
jg     1120 <xwrite+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @xwrite(i32 %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3, %10
%6 = phi i32 [ %13, %10 ], [ %2, %3 ]
%7 = phi i8* [ %12, %10 ], [ %1, %3 ]
%8 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %7, i32 %6)
%9 = icmp slt i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = zext i32 %8 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
%13 = sub nsw i32 %6, %8
%14 = icmp sgt i32 %13, 0
br i1 %14, label %5, label %15
15: ; preds = %5, %10, %3
%16 = phi i32 [ 0, %3 ], [ 0, %10 ], [ %8, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ lflush();
int /*<<< orphan*/ lprcat(char *);
int /*<<< orphan*/ nap(int);
void nomore() {
  lprcat("\nSorry man, I ain't got no more of that shit.");
  lflush();
  nap(2200);
}


x86 assembly (clang, -O0):
<nomore>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <lprcat@plt>
mov    $0x0,%al
call   1040 <lflush@plt>
mov    $0x898,%edi
call   1030 <nap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nomore>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <lprcat@plt>
xor    %eax,%eax
call   1040 <lflush@plt>
mov    $0x898,%edi
pop    %rax
jmp    1030 <nap@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"\0ASorry man, I ain't got no more of that shit.\00"
define void @nomore() {
%1 = call i32 @lprcat(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @lflush()
%3 = call i32 @nap(i32 2200)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"\0ASorry man, I ain't got no more of that shit.\00"
define void @nomore() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @lflush()
%3 = tail call i32 @nap(i32 2200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void show_usage(char *argv0) {
  printf("Usage:\n");
  printf("%% %s poh5_file\n", argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [17 x i8] c"%% %s poh5_file\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"%% %s poh5_file\0A\00"
@str = [7 x i8] c"Usage:\00"
define void @show_usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int __builtin_ptx_read_clock();
long __builtin_ptx_read_clock64();
long read_clocks() {
  int a = __builtin_ptx_read_clock();
  long b = __builtin_ptx_read_clock64();
  return (long)a + b;
}


x86 assembly (clang, -O0):
<read_clocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__builtin_ptx_read_clock@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__builtin_ptx_read_clock64@plt>
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_clocks>:
push   %rbx
xor    %eax,%eax
call   1030 <__builtin_ptx_read_clock@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__builtin_ptx_read_clock64@plt>
movslq %ebx,%rcx
add    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @read_clocks() {
%1 = alloca i32
%2 = alloca i64
%3 = call i32 (...) @__builtin_ptx_read_clock()
store i32 %3, i32* %1
%4 = call i64 (...) @__builtin_ptx_read_clock64()
store i64 %4, i64* %2
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = load i64, i64* %2
%8 = add nsw i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @read_clocks() {
%1 = tail call i32 (...) @__builtin_ptx_read_clock()
%2 = tail call i64 (...) @__builtin_ptx_read_clock64()
%3 = sext i32 %1 to i64
%4 = add nsw i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Movi viola niñas. \n");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Movi viola ni\C3\B1as. \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [20 x i8] c"Movi viola ni\C3\B1as. \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
putmem(sym) char *sym;
{
  if ((sym[9] != 3) & (sym[10] == 1)) {
    ot("movb %al, ");
  } else
    ot("movl %eax, ");
  outname(sym + 0);
  nl();
}


x86 assembly (clang, -O0):
<putmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x9(%rax),%eax
cmp    $0x3,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x10(%rbp),%rcx
movsbl 0xa(%rcx),%ecx
cmp    $0x1,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1181 <putmem+0x51>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
jmp    118f <putmem+0x5f>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outname@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putmem>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x1,0xa(%rdi)
lea    0xec1(%rip),%rdi
lea    0xec5(%rip),%rax
cmovne %rax,%rdi
cmpb   $0x3,0x9(%rbx)
cmove  %rax,%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outname@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"movb %al, \00"
@.str.1 = [12 x i8] c"movl %eax, \00"
define i32 @putmem(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 9
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 3
%9 = zext i1 %8 to i32
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = and i32 %9, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %1
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %22
20: ; preds = %1
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %24)
%26 = call i32 (...) @nl()
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@.str = [11 x i8] c"movb %al, \00"
@.str.1 = [12 x i8] c"movl %eax, \00"
define i32 @putmem(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 9
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 3
%5 = getelementptr inbounds i8, i8* %0, i64 10
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 1
%8 = and i1 %4, %7
%9 = select i1 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0)
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* %9)
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %0)
%12 = tail call i32 (...) @nl()
ret i32 undef
}
/* Variables and functions */
double atan(double const);
double const tan(double const);
double geocentric_to_geodetic_hwr(const double gc_lat) {
  const double cos_ae = 0.9966349016452;
  const double cos2_ae = cos_ae * cos_ae;
  const double gcr = gc_lat * 3.14159265358979323846 / 180.0;
  return atan(tan(gcr) / cos2_ae) * 180.0 / 3.14159265358979323846;
}


x86 assembly (clang, -O0):
<geocentric_to_geodetic_hwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <tan@plt>
movsd  0xe99(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <atan@plt>
movsd  0xe80(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6c(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geocentric_to_geodetic_hwr>:
push   %rax
mulsd  0xed7(%rip),%xmm0
divsd  0xed7(%rip),%xmm0
call   1040 <tan@plt>
divsd  0xed2(%rip),%xmm0
call   1030 <atan@plt>
mulsd  0xebd(%rip),%xmm0
divsd  0xead(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @geocentric_to_geodetic_hwr(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
store double 0x3FEFE46EE093C933, double* %3
store double 0x3FEFC8F5809EBDE6, double* %4
%6 = load double, double* %2
%7 = fmul double %6, 0x400921FB54442D18
%8 = fdiv double %7, 1.800000e+02
store double %8, double* %5
%9 = load double, double* %5
%10 = call double @tan(double %9)
%11 = fdiv double %10, 0x3FEFC8F5809EBDE6
%12 = call double @atan(double %11)
%13 = fmul double %12, 1.800000e+02
%14 = fdiv double %13, 0x400921FB54442D18
ret double %14
}

LLVM IR (-O2):
define double @geocentric_to_geodetic_hwr(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
%4 = tail call double @tan(double %3)
%5 = fdiv double %4, 0x3FEFC8F5809EBDE6
%6 = tail call double @atan(double %5)
%7 = fmul double %6, 1.800000e+02
%8 = fdiv double %7, 0x400921FB54442D18
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ TimingDelay(int);
void WaitASecond() { TimingDelay(160000000); }


x86 assembly (clang, -O0):
<WaitASecond>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9896800,%edi
call   1030 <TimingDelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitASecond>:
mov    $0x9896800,%edi
jmp    1030 <TimingDelay@plt>

LLVM IR (-O0):
define void @WaitASecond() {
%1 = call i32 @TimingDelay(i32 160000000)
ret void
}

LLVM IR (-O2):
define void @WaitASecond() {
%1 = tail call i32 @TimingDelay(i32 160000000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ com_putc(char);
void com_puts(char *s) {
  char c;
  while ((c = *s++))
    com_putc(c);
}


x86 assembly (clang, -O0):
<com_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1146 <com_puts+0x36>
movsbl -0x9(%rbp),%edi
call   1030 <com_putc@plt>
jmp    111c <com_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <com_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <com_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <com_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @com_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @com_putc(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
float divide(int a, int b) { return ((a * 1.0) / b); }


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @divide(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 = sitofp i32 %5 to double
%7 = fmul double %6, 1.000000e+00
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @divide(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fdiv double %3, %4
%6 = fptrunc double %5 to float
ret float %6
}
int hexdigit(char c) {
  if ((c >= 0x30) && (c <= 0x39)) {
    return 1;
  }
  if ((c >= 0x61) && (c <= 0x66)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<hexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <hexdigit+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <hexdigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    115d <hexdigit+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1156 <hexdigit+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1156 <hexdigit+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <hexdigit+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
add    $0x9f,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @hexdigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %22
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 97
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 102
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %22
21: ; preds = %16, %12
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @hexdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -97
%5 = icmp ult i8 %4, 6
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int (*f(int a[g()]))[] {
  int(*p)[g()] = a;
  return p + 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
mov    $0x0,%al
call   1030 <g@plt>
mov    %eax,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x0,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <g@plt>
xor    %eax,%eax
call   1030 <g@plt>
mov    %eax,%eax
lea    (%rbx,%rax,4),%rax
pop    %rbx
ret

LLVM IR (-O0):
define [0 x i32]* @f(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = call i32 (...) @g()
%5 = zext i32 %4 to i64
%6 = call i32 (...) @g()
%7 = zext i32 %6 to i64
%8 = load i32*, i32** %2
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = mul nsw i64 1, %7
%11 = getelementptr inbounds i32, i32* %9, i64 %10
%12 = bitcast i32* %11 to [0 x i32]*
ret [0 x i32]* %12
}

LLVM IR (-O2):
define [0 x i32]* @f(i32* readnone %0) {
%2 = tail call i32 (...) @g()
%3 = tail call i32 (...) @g()
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = bitcast i32* %5 to [0 x i32]*
ret [0 x i32]* %6
}
/* Variables and functions */
int /*<<< orphan*/ Fortran2cstring(char *, char *, int, int);
int PAPI_add_named_event(int, char *);
void papif_add_named_event_(int *EventSet, char *EventName, int *check,
                            int Event_len) {
  char tmp[128];
  Fortran2cstring(tmp, EventName, 128, Event_len);
  *check = PAPI_add_named_event(*EventSet, tmp);
}


x86 assembly (clang, -O0):
<papif_add_named_event_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%ecx
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0xa0(%rbp),%rsi
call   1030 <PAPI_add_named_event@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_add_named_event_>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
call   1030 <PAPI_add_named_event@plt>
mov    %eax,(%r14)
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @papif_add_named_event_(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [128 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i32, i32* %8
%13 = call i32 @Fortran2cstring(i8* %10, i8* %11, i32 128, i32 %12)
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%17 = call i32 @PAPI_add_named_event(i32 %15, i8* %16)
%18 = load i32*, i32** %7
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @papif_add_named_event_(i32* nocapture %0, i8* %1, i32* nocapture writeonly %2, i32 %3) {
%5 = alloca [128 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = call i32 @Fortran2cstring(i8* %6, i8* %1, i32 128, i32 %3)
%8 = load i32, i32* %0
%9 = call i32 @PAPI_add_named_event(i32 %8, i8* %6)
store i32 %9, i32* %2
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void *memset(void *destination, int chr, size_t count) {
  uint8_t *buffer = (uint8_t *)destination;
  for (unsigned int i = 0; i < count; i++) {
    buffer[i] = chr;
  }
  return destination;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1146 <memset+0x46>
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111e <memset+0x1e>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %rdi,%rax
test   %rdx,%rdx
je     111b <memset+0x1b>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %esi,(%rax,%rcx,4)
add    $0x1,%ecx
cmp    %rdx,%rcx
jb     1110 <memset+0x10>
ret

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

LLVM IR (-O2):
define i8* @memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = icmp eq i64 %2, 0
br i1 %5, label %6, label %7
6: ; preds = %7, %3
ret i8* %0
7: ; preds = %3, %7
%8 = phi i64 [ %11, %7 ], [ 0, %3 ]
%9 = getelementptr inbounds i32, i32* %4, i64 %8
store i32 %1, i32* %9
%10 = add nuw nsw i64 %8, 1
%11 = and i64 %10, 4294967295
%12 = icmp ult i64 %11, %2
br i1 %12, label %7, label %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t inverse_adjust_seed_7(uint32_t seed) {
  return seed ^ (seed << 7) ^ (seed << 14) ^ (seed << 21) ^ (seed << 28);
}


x86 assembly (clang, -O0):
<inverse_adjust_seed_7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x7,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0xe,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x15,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1c,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse_adjust_seed_7>:
mov    %edi,%ecx
shl    $0x7,%ecx
xor    %edi,%ecx
mov    %edi,%edx
shl    $0xe,%edx
mov    %edi,%eax
shl    $0x15,%eax
xor    %edx,%eax
xor    %ecx,%eax
shl    $0x1c,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @inverse_adjust_seed_7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 7
%6 = xor i32 %3, %5
%7 = load i32, i32* %2
%8 = shl i32 %7, 14
%9 = xor i32 %6, %8
%10 = load i32, i32* %2
%11 = shl i32 %10, 21
%12 = xor i32 %9, %11
%13 = load i32, i32* %2
%14 = shl i32 %13, 28
%15 = xor i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @inverse_adjust_seed_7(i32 %0) {
%2 = shl i32 %0, 7
%3 = xor i32 %2, %0
%4 = shl i32 %0, 14
%5 = xor i32 %3, %4
%6 = shl i32 %0, 21
%7 = xor i32 %5, %6
%8 = shl i32 %0, 28
%9 = xor i32 %7, %8
ret i32 %9
}
/* Type definitions */
struct dirent {
  char const *d_name;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
struct dirent *diterate(int /*<<< orphan*/ *, int);
const char *getfile(DIR *dir, int filter) {
  struct dirent *entry;
  while ((entry = diterate(dir, filter))) {
    return entry->d_name;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<getfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <diterate@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1149 <getfile+0x39>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <getfile+0x41>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfile>:
push   %rax
call   1030 <diterate@plt>
test   %rax,%rax
je     1120 <getfile+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i8* @getfile(i32* %0, i32 %1) {
%3 = tail call %struct.dirent* @diterate(i32* %0, i32 %1)
%4 = icmp eq %struct.dirent* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%7 = load i8*, i8** %6
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ null, %2 ]
ret i8* %9
}
int main() {
  int a, b, c = 7;
  a = (b = 5 + 4 * c) + 2;
  return a + b - 68;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    $0x44,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %4
%5 = load i32, i32* %4
%6 = mul nsw i32 4, %5
%7 = add nsw i32 5, %6
store i32 %7, i32* %3
%8 = add nsw i32 %7, 2
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
%12 = sub nsw i32 %11, 68
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int main() {
  volatile unsigned int *address = 0x64100200;
  volatile unsigned int c = *address;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
mov    0x64100200,%eax
mov    %eax,-0x4(%rsp)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load volatile i32, i32* inttoptr (i64 1678770688 to i32*)
store volatile i32 %3, i32* %1
ret i32 0
}