xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ nrf_cel();
int nrf_reg_read(int, int);
int /*<<< orphan*/ nrf_reg_write(int, int, int);
void nrf_powerup_nodelay() {
  int config;
  nrf_cel();
  *(unsigned char *)0x500C |= (1 << 3);
  *(unsigned char *)0x500D |= (1 << 3);
  config = nrf_reg_read(0x00, 1);
  nrf_reg_write(0x00, config | (1 << 1) | (1 << 2), 1);
}


x86 assembly (clang, -O0):
<nrf_powerup_nodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <nrf_cel@plt>
mov    $0x500c,%eax
movzbl (%rax),%eax
or     $0x8,%eax
mov    %al,%cl
mov    $0x500c,%eax
mov    %cl,(%rax)
mov    $0x500d,%eax
movzbl (%rax),%eax
or     $0x8,%eax
mov    %al,%cl
mov    $0x500d,%eax
mov    %cl,(%rax)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <nrf_reg_read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
or     $0x2,%esi
or     $0x4,%esi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <nrf_reg_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_powerup_nodelay>:
push   %rax
xor    %eax,%eax
call   1050 <nrf_cel@plt>
orb    $0x8,0x500c
08
orb    $0x8,0x500d
08
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <nrf_reg_read@plt>
or     $0x6,%eax
xor    %edi,%edi
mov    %eax,%esi
mov    $0x1,%edx
pop    %rax
jmp    1040 <nrf_reg_write@plt>

LLVM IR (-O0):
define void @nrf_powerup_nodelay() {
%1 = alloca i32
%2 = call i32 (...) @nrf_cel()
%3 = load i8, i8* inttoptr (i64 20492 to i8*)
%4 = zext i8 %3 to i32
%5 = or i32 %4, 8
%6 = trunc i32 %5 to i8
store i8 %6, i8* inttoptr (i64 20492 to i8*)
%7 = load i8, i8* inttoptr (i64 20493 to i8*)
%8 = zext i8 %7 to i32
%9 = or i32 %8, 8
%10 = trunc i32 %9 to i8
store i8 %10, i8* inttoptr (i64 20493 to i8*)
%11 = call i32 @nrf_reg_read(i32 0, i32 1)
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = or i32 %12, 2
%14 = or i32 %13, 4
%15 = call i32 @nrf_reg_write(i32 0, i32 %14, i32 1)
ret void
}

LLVM IR (-O2):
define void @nrf_powerup_nodelay() {
%1 = tail call i32 (...) @nrf_cel()
%2 = load i8, i8* inttoptr (i64 20492 to i8*)
%3 = or i8 %2, 8
store i8 %3, i8* inttoptr (i64 20492 to i8*)
%4 = load i8, i8* inttoptr (i64 20493 to i8*)
%5 = or i8 %4, 8
store i8 %5, i8* inttoptr (i64 20493 to i8*)
%6 = tail call i32 @nrf_reg_read(i32 0, i32 1)
%7 = or i32 %6, 6
%8 = tail call i32 @nrf_reg_write(i32 0, i32 %7, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL;

/* Variables and functions */
int /*<<< orphan*/ liberate(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
void mysql_close(MYSQL *handle) {
  printf("mysql_close(%s)\n", (handle ? "MYSQL" : "NULL"));
  if (handle) {
    liberate(handle);
  }
  return;
}


x86 assembly (clang, -O0):
<mysql_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xee0(%rip),%rsi
lea    0xed3(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1166 <mysql_close+0x46>
mov    -0x8(%rbp),%rdi
call   1040 <liberate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysql_close>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
lea    0xee9(%rip),%rax
lea    0xedc(%rip),%rsi
cmove  %rax,%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
test   %rbx,%rbx
je     1153 <mysql_close+0x33>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <liberate@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"mysql_close(%s)\0A\00"
@.str.1 = [6 x i8] c"MYSQL\00"
@.str.2 = [5 x i8] c"NULL\00"
define void @mysql_close(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %2
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32*, i32** %2
%12 = call i32 @liberate(i32* %11)
br label %13
13: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"mysql_close(%s)\0A\00"
@.str.1 = [6 x i8] c"MYSQL\00"
@.str.2 = [5 x i8] c"NULL\00"
define void @mysql_close(i32* %0) {
%2 = icmp eq i32* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
br i1 %2, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @liberate(i32* %0)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int sched_get_priority_max(int policy) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<sched_get_priority_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_get_priority_max>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sched_get_priority_max(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sched_get_priority_max(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
unsigned long pci_read_config32(int);
int /*<<< orphan*/ pci_write_config32(int, unsigned long);
void sdram_set_spd_registers(void) {
  unsigned long dcl;
  dcl = pci_read_config32(((((0) & 0xFF) << 16) | (((0x18) & 0x1f) << 11) |
                           (((2) & 0x07) << 8) | ((0x90) & 0xFF)));
  dcl &= ~(1 << 17);
  pci_write_config32(((((0) & 0xFF) << 16) | (((0x18) & 0x1f) << 11) |
                      (((2) & 0x07) << 8) | ((0x90) & 0xFF)),
                     dcl);
}


x86 assembly (clang, -O0):
<sdram_set_spd_registers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc290,%edi
call   1030 <pci_read_config32@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffffffdffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xc290,%edi
call   1040 <pci_write_config32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdram_set_spd_registers>:
push   %rax
mov    $0xc290,%edi
call   1030 <pci_read_config32@plt>
and    $0xfffffffffffdffff,%rax
mov    $0xc290,%edi
mov    %rax,%rsi
pop    %rax
jmp    1040 <pci_write_config32@plt>

LLVM IR (-O0):
define void @sdram_set_spd_registers() {
%1 = alloca i64
%2 = call i64 @pci_read_config32(i32 49808)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = and i64 %3, -131073
store i64 %4, i64* %1
%5 = load i64, i64* %1
%6 = call i32 @pci_write_config32(i32 49808, i64 %5)
ret void
}

LLVM IR (-O2):
define void @sdram_set_spd_registers() {
%1 = tail call i64 @pci_read_config32(i32 49808)
%2 = and i64 %1, -131073
%3 = tail call i32 @pci_write_config32(i32 49808, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("test github");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"test github\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"test github\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void Print(const char *message) { printf("PRINT: %s\n", message); }


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

x86 assembly (clang, -O2):
<Print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"PRINT: %s\0A\00"
define void @Print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int process_dsyn_init() { return 0; }


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

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

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

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


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define i32 @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
main() {
  switch (15) {
  case 10:
    echo("One");
    break;
  default:
    echo("Default");
  case 20:
    echo("Two");
    break;
  case 30:
    echo("Three");
    break;
  }
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Default\00"
@.str.1 = [4 x i8] c"Two\00"
define i32 @main() {
%1 = call i32 @echo(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Default\00"
@.str.1 = [4 x i8] c"Two\00"
define i32 @main() {
%1 = tail call i32 @echo(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double random_0_to_1() { return (double)rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<random_0_to_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_0_to_1>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @random_0_to_1() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @random_0_to_1() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ err_die(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void audio_close(int audio_fd, const char *audio_dev) {
  if (close(audio_fd) == -1)
    err_die("could not close %s: %s\n", audio_dev, strerror(errno));
}


x86 assembly (clang, -O0):
<audio_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1178 <audio_close+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xe8d(%rip),%rdi
call   1040 <err_die@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_close>:
push   %rbx
mov    %rsi,%rbx
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     1140 <audio_close+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <err_die@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"could not close %s: %s\0A\00"
@errno = global i32 0
define void @audio_close(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @close(i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i32, i32* @errno
%11 = call i32 @strerror(i32 %10)
%12 = call i32 @err_die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %11)
br label %13
13: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"could not close %s: %s\0A\00"
@errno = global i32 0
define void @audio_close(i32 %0, i8* %1) {
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @err_die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %7)
br label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ build_stamp_create();
char const *string_contents(int /*<<< orphan*/);
const char *redroid_buildinfo() {
  return string_contents(build_stamp_create());
}


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

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

LLVM IR (-O0):
define i8* @redroid_buildinfo() {
%1 = call i32 (...) @build_stamp_create()
%2 = call i8* @string_contents(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
define i8* @redroid_buildinfo() {
%1 = tail call i32 (...) @build_stamp_create()
%2 = tail call i8* @string_contents(i32 %1)
ret i8* %2
}
int f(int x) {
  while (1) {
    if (x < 0) {
      return x;
    } else {
      x--;
    }
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1116 <f+0x16>
mov    -0x4(%rbp),%eax
pop    %rbp
ret
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <f+0x7>

x86 assembly (clang, -O2):
<f>:
cmp    $0xffffffff,%edi
mov    $0xffffffff,%eax
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = call i32 @llvm.smin.i32(i32 %0, i32 -1)
ret i32 %2
}
unsigned int rshift_u_s(unsigned int left, int right) { return left >> right; }


x86 assembly (clang, -O0):
<rshift_u_s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rshift_u_s>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @rshift_u_s(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ init_Huffman_tables();
int /*<<< orphan*/ precalculate_YCbCr_tables();
int /*<<< orphan*/ prepare_quant_tables();
int /*<<< orphan*/ set_DHTinfo();
int /*<<< orphan*/ set_DQTinfo();
int /*<<< orphan*/ set_numbers_category_and_bitcode();
void init_all() {
  set_DQTinfo();
  set_DHTinfo();
  init_Huffman_tables();
  set_numbers_category_and_bitcode();
  precalculate_YCbCr_tables();
  prepare_quant_tables();
}


x86 assembly (clang, -O0):
<init_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <set_DQTinfo@plt>
mov    $0x0,%al
call   1060 <set_DHTinfo@plt>
mov    $0x0,%al
call   1040 <init_Huffman_tables@plt>
mov    $0x0,%al
call   1030 <set_numbers_category_and_bitcode@plt>
mov    $0x0,%al
call   1070 <precalculate_YCbCr_tables@plt>
mov    $0x0,%al
call   1050 <prepare_quant_tables@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_all>:
push   %rax
xor    %eax,%eax
call   1080 <set_DQTinfo@plt>
xor    %eax,%eax
call   1060 <set_DHTinfo@plt>
xor    %eax,%eax
call   1040 <init_Huffman_tables@plt>
xor    %eax,%eax
call   1030 <set_numbers_category_and_bitcode@plt>
xor    %eax,%eax
call   1070 <precalculate_YCbCr_tables@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <prepare_quant_tables@plt>

LLVM IR (-O0):
define void @init_all() {
%1 = call i32 (...) @set_DQTinfo()
%2 = call i32 (...) @set_DHTinfo()
%3 = call i32 (...) @init_Huffman_tables()
%4 = call i32 (...) @set_numbers_category_and_bitcode()
%5 = call i32 (...) @precalculate_YCbCr_tables()
%6 = call i32 (...) @prepare_quant_tables()
ret void
}

LLVM IR (-O2):
define void @init_all() {
%1 = tail call i32 (...) @set_DQTinfo()
%2 = tail call i32 (...) @set_DHTinfo()
%3 = tail call i32 (...) @init_Huffman_tables()
%4 = tail call i32 (...) @set_numbers_category_and_bitcode()
%5 = tail call i32 (...) @precalculate_YCbCr_tables()
%6 = tail call i32 (...) @prepare_quant_tables()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_144() {
  Assert_real((isqrt(144) == 12),
              "/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/stdlib/isqrt.c",
              725, ("Integer square root of 144 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_144>:
push   %rbp
mov    %rsp,%rbp
mov    $0x90,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x2d5,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_144>:
push   %rax
mov    $0x90,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x2d5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 144 should be 12\00"
define void @t_sqrt_144() {
%1 = call i32 @isqrt(i32 144)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 725, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 144 should be 12\00"
define void @t_sqrt_144() {
%1 = tail call i32 @isqrt(i32 144)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 725, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long myrandom(void) {
  static unsigned long m_w = 11;
  static unsigned long m_z = 13;
  m_z = 36969 * (m_z & 65535) + (m_z >> 16);
  m_w = 18000 * (m_w & 65535) + (m_w >> 16);
  return (m_z << 16) + m_w;
}


x86 assembly (clang, -O0):
<myrandom>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1d(%rip),%rax
and    $0xffff,%rax
imul   $0x9069,%rax,%rax
mov    0x2f09(%rip),%rcx
shr    $0x10,%rcx
add    %rcx,%rax
mov    %rax,0x2efb(%rip)
mov    0x2eec(%rip),%rax
and    $0xffff,%rax
imul   $0x4650,%rax,%rax
mov    0x2ed8(%rip),%rcx
shr    $0x10,%rcx
add    %rcx,%rax
mov    %rax,0x2eca(%rip)
mov    0x2ecb(%rip),%rax
shl    $0x10,%rax
add    0x2eb8(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrandom>:
mov    0x2f21(%rip),%rax
movzwl %ax,%ecx
imul   $0x9069,%rcx,%rcx
shr    $0x10,%rax
add    %rcx,%rax
mov    %rax,0x2f09(%rip)
mov    0x2efa(%rip),%rcx
movzwl %cx,%edx
imul   $0x4650,%rdx,%rdx
shr    $0x10,%rcx
add    %rdx,%rcx
mov    %rcx,0x2ee2(%rip)
shl    $0x10,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@myrandom.m_w = internal global i64 11
@myrandom.m_z = internal global i64 13
define i64 @myrandom() {
%1 = load i64, i64* @myrandom.m_z
%2 = and i64 %1, 65535
%3 = mul i64 36969, %2
%4 = load i64, i64* @myrandom.m_z
%5 = lshr i64 %4, 16
%6 = add i64 %3, %5
store i64 %6, i64* @myrandom.m_z
%7 = load i64, i64* @myrandom.m_w
%8 = and i64 %7, 65535
%9 = mul i64 18000, %8
%10 = load i64, i64* @myrandom.m_w
%11 = lshr i64 %10, 16
%12 = add i64 %9, %11
store i64 %12, i64* @myrandom.m_w
%13 = load i64, i64* @myrandom.m_z
%14 = shl i64 %13, 16
%15 = load i64, i64* @myrandom.m_w
%16 = add i64 %14, %15
ret i64 %16
}

LLVM IR (-O2):
@myrandom.m_w = internal unnamed_addr global i64 11
@myrandom.m_z = internal unnamed_addr global i64 13
define i64 @myrandom() {
%1 = load i64, i64* @myrandom.m_z
%2 = and i64 %1, 65535
%3 = mul nuw nsw i64 %2, 36969
%4 = lshr i64 %1, 16
%5 = add nuw nsw i64 %3, %4
store i64 %5, i64* @myrandom.m_z
%6 = load i64, i64* @myrandom.m_w
%7 = and i64 %6, 65535
%8 = mul nuw nsw i64 %7, 18000
%9 = lshr i64 %6, 16
%10 = add nuw nsw i64 %8, %9
store i64 %10, i64* @myrandom.m_w
%11 = shl i64 %5, 16
%12 = add i64 %10, %11
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ nrfunit_device_init();
int /*<<< orphan*/ nrfunit_device_main_loop();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  nrfunit_device_init();
  printf("Press Button 0 to run the tests.\n\r\n\r");
  nrfunit_device_main_loop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <nrfunit_device_init@plt>
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <nrfunit_device_main_loop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <nrfunit_device_init@plt>
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <nrfunit_device_main_loop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Press Button 0 to run the tests.\0A\0D\0A\0D\00"
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
%6 = call i32 (...) @nrfunit_device_init()
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @nrfunit_device_main_loop()
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Press Button 0 to run the tests.\0A\0D\0A\0D\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @nrfunit_device_init()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @nrfunit_device_main_loop()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ atomic_int;

/* Variables and functions */
int atomic_fetch_add(int /*<<< orphan*/ *, int);
int atomic_fetch_and(int /*<<< orphan*/ *, int);
int atomic_fetch_or(int /*<<< orphan*/ *, int);
int atomic_fetch_sub(int /*<<< orphan*/ *, int);
int atomic_fetch_xor(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ atomic_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
void c11_builtins() {
  int _a;
  atomic_int a;
  atomic_init(&a, 0);
  _a = atomic_fetch_add(&a, 1);
  _a = atomic_fetch_sub(&a, 1);
  _a = atomic_fetch_and(&a, 1);
  _a = atomic_fetch_or(&a, 1);
  _a = atomic_fetch_xor(&a, 1);
}


x86 assembly (clang, -O0):
<c11_builtins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1080 <atomic_init@plt>
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <atomic_fetch_add@plt>
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <atomic_fetch_sub@plt>
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1050 <atomic_fetch_and@plt>
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1070 <atomic_fetch_or@plt>
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1060 <atomic_fetch_xor@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c11_builtins>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <atomic_init@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <atomic_fetch_add@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <atomic_fetch_sub@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <atomic_fetch_and@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1070 <atomic_fetch_or@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1060 <atomic_fetch_xor@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @c11_builtins() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @atomic_init(i32* %2, i32 0)
%4 = call i32 @atomic_fetch_add(i32* %2, i32 1)
store i32 %4, i32* %1
%5 = call i32 @atomic_fetch_sub(i32* %2, i32 1)
store i32 %5, i32* %1
%6 = call i32 @atomic_fetch_and(i32* %2, i32 1)
store i32 %6, i32* %1
%7 = call i32 @atomic_fetch_or(i32* %2, i32 1)
store i32 %7, i32* %1
%8 = call i32 @atomic_fetch_xor(i32* %2, i32 1)
store i32 %8, i32* %1
ret void
}

LLVM IR (-O2):
define void @c11_builtins() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @atomic_init(i32* %1, i32 0)
%4 = call i32 @atomic_fetch_add(i32* %1, i32 1)
%5 = call i32 @atomic_fetch_sub(i32* %1, i32 1)
%6 = call i32 @atomic_fetch_and(i32* %1, i32 1)
%7 = call i32 @atomic_fetch_or(i32* %1, i32 1)
%8 = call i32 @atomic_fetch_xor(i32* %1, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ activities(int *, int *, int);
int /*<<< orphan*/ getchar();
void main() {
  int s[] = {1, 3, 0, 5, 3, 5, 6, 8, 8, 2, 12};
  int f[] = {4, 5, 6, 7, 9, 9, 10, 11, 12, 14, 16};
  int n = sizeof(s) / sizeof(s[0]);
  activities(s, f, n);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
movl   $0xb,-0x64(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x64(%rbp),%edx
call   1030 <activities@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0x4c(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movups 0xefd(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xb,%edx
call   1030 <activities@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [11 x i32] [i32 1, i32 3, i32 0, i32 5, i32 3, i32 5, i32 6, i32 8, i32 8, i32 2, i32 12]
@__const.main.f = [11 x i32] [i32 4, i32 5, i32 6, i32 7, i32 9, i32 9, i32 10, i32 11, i32 12, i32 14, i32 16]
define void @main() {
%1 = alloca [11 x i32]
%2 = alloca [11 x i32]
%3 = alloca i32
%4 = bitcast [11 x i32]* %1 to i8*
%5 = bitcast [11 x i32]* %2 to i8*
store i32 11, i32* %3
%6 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @activities(i32* %6, i32* %7, i32 %8)
%10 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@__const.main.s = [11 x i32] [i32 1, i32 3, i32 0, i32 5, i32 3, i32 5, i32 6, i32 8, i32 8, i32 2, i32 12]
@__const.main.f = [11 x i32] [i32 4, i32 5, i32 6, i32 7, i32 9, i32 9, i32 10, i32 11, i32 12, i32 14, i32 16]
define void @main() {
%1 = alloca [11 x i32]
%2 = alloca [11 x i32]
%3 = bitcast [11 x i32]* %1 to i8*
%4 = bitcast [11 x i32]* %2 to i8*
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%7 = call i32 @activities(i32* %5, i32* %6, i32 11)
%8 = call i32 (...) @getchar()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int _wymix(int, int);
uint64_t wyrand(uint64_t *seed) {
  *seed += 0xa0761d6478bd642full;
  return _wymix(*seed, *seed ^ 0xe7037ed1a0b428dbull);
}


x86 assembly (clang, -O0):
<wyrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
movabs $0xa0761d6478bd642f,%rdx
1d 76 a0
add    %rdx,%rcx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
movabs $0xe7037ed1a0b428db,%rcx
7e 03 e7
xor    %rcx,%rax
mov    %eax,%esi
call   1030 <_wymix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wyrand>:
mov    $0x78bd642f,%eax
add    (%rdi),%eax
mov    %eax,(%rdi)
mov    %eax,%esi
xor    $0xa0b428db,%esi
mov    %eax,%edi
jmp    1030 <_wymix@plt>

LLVM IR (-O0):
define i32 @wyrand(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = add i64 %5, -6884282663029611473
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = xor i64 %12, -1800455987208640293
%14 = trunc i64 %13 to i32
%15 = call i32 @_wymix(i32 %9, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @wyrand(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 2025677871
store i32 %3, i32* %0
%4 = xor i32 %3, -1598805797
%5 = tail call i32 @_wymix(i32 %3, i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t col_get_red(int colour) { return (colour >> 16) & 0xFF; }


x86 assembly (clang, -O0):
<col_get_red>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<col_get_red>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @col_get_red(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @col_get_red(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
unsigned lookup_variable_or_env_unsigned(const char *szKey,
                                         unsigned valueDefault) {
  return valueDefault;
}


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

x86 assembly (clang, -O2):
<lookup_variable_or_env_unsigned>:
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @lookup_variable_or_env_unsigned(i8* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
double pow(float, int);
float calcArea(float radius) { return 3.141592 * pow(radius, 2); }


x86 assembly (clang, -O0):
<calcArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec9(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcArea>:
push   %rax
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xedd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @calcArea(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @pow(float %3, i32 2)
%5 = fmul double 0x400921FAFC8B007A, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @calcArea(float %0) {
%2 = tail call double @pow(float %0, i32 2)
%3 = fmul double %2, 0x400921FAFC8B007A
%4 = fptrunc double %3 to float
ret float %4
}
/* Type definitions */
typedef unsigned long uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t FlashUserSet(uint32_t ui32User0, uint32_t ui32User1) {
  (*((volatile unsigned long *)(0x400FE1E0))) = ui32User0;
  (*((volatile unsigned long *)(0x400FE1E4))) = ui32User1;
  return (0);
}


x86 assembly (clang, -O0):
<FlashUserSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fe1e0,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    $0x400fe1e4,%eax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashUserSet>:
mov    %rdi,0x400fe1e0
40
mov    %rsi,0x400fe1e4
40
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @FlashUserSet(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
store volatile i64 %5, i64* inttoptr (i64 1074782688 to i64*)
%6 = load i64, i64* %4
store volatile i64 %6, i64* inttoptr (i64 1074782692 to i64*)
ret i32 0
}

LLVM IR (-O2):
define i32 @FlashUserSet(i64 %0, i64 %1) {
store volatile i64 %0, i64* inttoptr (i64 1074782688 to i64*)
store volatile i64 %1, i64* inttoptr (i64 1074782692 to i64*)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,
                       int before_p) {
  abort();
}


x86 assembly (clang, -O0):
<CRYPTO_dbg_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<CRYPTO_dbg_malloc>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @CRYPTO_dbg_malloc(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @CRYPTO_dbg_malloc(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i32 %4) {
%6 = tail call i32 (...) @abort()
unreachable
}
void sig_pipe_handler(int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @sig_pipe_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scde_task(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  printf("argc = %d\n", argc);
  int i;
  for (i = 1; i < argc; i++) {
  }
  scde_task(NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116b <main+0x4b>
jmp    115d <main+0x3d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <main+0x2c>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <scde_task@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"argc = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @scde_task(i32* null)
ret i32 0
}
int test_imm_C8uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xC8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C8uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xc8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C8uint64_highword_reg>:
movabs $0xc800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C8uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 858993459200
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int anwser =
      4 + 9 - 2 * 16 + 1 / 3 * 6 - 67 + 8 * 2 - 3 + 26 - 1 / 34 + 3 / 7 + 2 - 5;
  printf("%d", anwser);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -50)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ tl_non_fatal(char *, char *);
void Fatal(char *s1, char *s2) {
  tl_non_fatal(s1, s2);
  exit(1);
}


x86 assembly (clang, -O0):
<Fatal>:
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 <tl_non_fatal@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Fatal>:
push   %rax
call   1030 <tl_non_fatal@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Fatal(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 @tl_non_fatal(i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @Fatal(i8* %0, i8* %1) {
%3 = tail call i32 @tl_non_fatal(i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int main() {
  int x[20];
  return x[0];
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
int fun_3_in_so(int x, int y, int z) { return 20 + x + y + z; }


x86 assembly (clang, -O0):
<fun_3_in_so>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_3_in_so>:
add    %esi,%edi
lea    (%rdx,%rdi,1),%eax
add    $0x14,%eax
ret

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

LLVM IR (-O2):
define i32 @fun_3_in_so(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 20
%5 = add nsw i32 %4, %1
%6 = add nsw i32 %5, %2
ret i32 %6
}
void section_end() { ("section_end"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"section_end\00"
define void @section_end() {
ret void
}

LLVM IR (-O2):
define void @section_end() {
ret void
}
/* Variables and functions */
scalar_t__ errno;
int fdatasync(int fd) {
  errno = 0;
  return 0;
}


x86 assembly (clang, -O0):
<fdatasync>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdatasync>:
mov    0x2ed9(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
ret

LLVM IR (-O0):
@errno = global i64 0
define i32 @fdatasync(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i64 0, i64* @errno
ret i32 0
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @fdatasync(i32 %0) {
store i64 0, i64* @errno
ret i32 0
}
void prword(base, indx) const char *const base[];
int indx;
{ printw("%s", base[indx]); }


x86 assembly (clang, -O0):
<prword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prword>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rsi
lea    0xee2(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @prword(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @prword(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookreal16array(void *x, int n) {
  lookNarray((char *)x, (unsigned int)(n * 16));
}


x86 assembly (clang, -O0):
<lookreal16array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x4,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookreal16array>:
shl    $0x4,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookreal16array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 16
%8 = call i32 @lookNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @lookreal16array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = tail call i32 @lookNarray(i8* %0, i32 %3)
ret void
}