xunge/DecIR huggingface dataset:
void view_hotel_key(void) {}


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

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

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

LLVM IR (-O2):
define void @view_hotel_key() {
ret void
}
void SysCtlBackupDomainReset(void) {
  (*((volatile unsigned long *)(0x40021020))) |= 0x00010000;
}


x86 assembly (clang, -O0):
<SysCtlBackupDomainReset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40021020,%eax
mov    (%rax),%rcx
or     $0x10000,%rcx
mov    $0x40021020,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlBackupDomainReset>:
orq    $0x10000,0x40021020
ret

LLVM IR (-O0):
define void @SysCtlBackupDomainReset() {
%1 = load volatile i64, i64* inttoptr (i64 1073877024 to i64*)
%2 = or i64 %1, 65536
store volatile i64 %2, i64* inttoptr (i64 1073877024 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlBackupDomainReset() {
%1 = load volatile i64, i64* inttoptr (i64 1073877024 to i64*)
%2 = or i64 %1, 65536
store volatile i64 %2, i64* inttoptr (i64 1073877024 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
void cpustat_top_refresh(void) { (void)refresh(); }


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

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

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

LLVM IR (-O2):
define void @cpustat_top_refresh() {
%1 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
unsigned char io_inb(unsigned short);
int /*<<< orphan*/ io_outb(unsigned short, unsigned char);
unsigned char io_inb_index(unsigned short iport, unsigned char index,
                           unsigned short dport) {
  io_outb(iport, index);
  return io_inb(dport);
}


x86 assembly (clang, -O0):
<io_inb_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %sil,%cl
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzbl -0x3(%rbp),%esi
call   1040 <io_outb@plt>
movzwl -0x6(%rbp),%edi
call   1030 <io_inb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_inb_index>:
push   %rbx
mov    %edx,%ebx
call   1040 <io_outb@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <io_inb@plt>

LLVM IR (-O0):
define zeroext i8 @io_inb_index(i16 zeroext %0, i8 zeroext %1, i16 zeroext %2) {
%4 = alloca i16
%5 = alloca i8
%6 = alloca i16
store i16 %0, i16* %4
store i8 %1, i8* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = load i8, i8* %5
%9 = call i32 @io_outb(i16 zeroext %7, i8 zeroext %8)
%10 = load i16, i16* %6
%11 = call zeroext i8 @io_inb(i16 zeroext %10)
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @io_inb_index(i16 zeroext %0, i8 zeroext %1, i16 zeroext %2) {
%4 = tail call i32 @io_outb(i16 zeroext %0, i8 zeroext %1)
%5 = tail call zeroext i8 @io_inb(i16 zeroext %2)
ret i8 %5
}
int int_mul(int line, int a, int b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @int_mul(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* %5
%8 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @int_mul(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ date(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, const char *argv[]) {
  char num[12];
  printf(">");
  scanf("%s", num);
  date(num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x1c(%rbp),%rdi
call   1040 <date@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x3e,%edi
call   1030 <putchar@plt>
lea    0xeba(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <date@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c">\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [12 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%10 = call i32 @date(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @putchar(i32 62)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @date(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EAGAIN;
int /*<<< orphan*/ errno;
__attribute__((__weak__)) int _fork() {
  errno = EAGAIN;
  return -1;
}


x86 assembly (clang, -O0):
<_fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ecc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EAGAIN = global i32 0
@errno = global i32 0
define weak i32 @_fork() {
%1 = load i32, i32* @EAGAIN
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EAGAIN = global i32 0
@errno = global i32 0
define weak i32 @_fork() {
%1 = load i32, i32* @EAGAIN
store i32 %1, i32* @errno
ret i32 -1
}
int c022(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c022() {
ret i32 0
}
void main(void) {
  unsigned int i, j;
  for (i = 0; i < 0x2233; i++)
    j = i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2233,-0x4(%rbp)
jae    112c <main+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <main+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void relatorioJogadoresPorPeriodo() {
  printf("Vamos buscar Jogadores por Período.\n");
  system("pause");
}


x86 assembly (clang, -O0):
<relatorioJogadoresPorPeriodo>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<relatorioJogadoresPorPeriodo>:
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Vamos buscar Jogadores por Per\C3\ADodo.\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define void @relatorioJogadoresPorPeriodo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"pause\00"
@str = [37 x i8] c"Vamos buscar Jogadores por Per\C3\ADodo.\00"
define void @relatorioJogadoresPorPeriodo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "Usage: %s  <-i input file> <-o output file>\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s <-i input file> <-o output file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s <-i input file> <-o output file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
__attribute__((always_)) void IOPinToggle(int PortNo, int PinNo) {}


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

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

LLVM IR (-O0):
define void @IOPinToggle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @IOPinToggle(i32 %0, i32 %1) {
ret void
}
int fun834() { return 834; }


x86 assembly (clang, -O0):
<fun834>:
push   %rbp
mov    %rsp,%rbp
mov    $0x342,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun834>:
mov    $0x342,%eax
ret

LLVM IR (-O0):
define i32 @fun834() {
ret i32 834
}

LLVM IR (-O2):
define i32 @fun834() {
ret i32 834
}
/* Variables and functions */
unsigned long cris_swapnwbrlz(unsigned long);
extern unsigned long __ffs(unsigned long w) { return cris_swapnwbrlz(~w); }


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

x86 assembly (clang, -O2):
<__ffs>:
not    %rdi
jmp    1030 <cris_swapnwbrlz@plt>

LLVM IR (-O0):
define i64 @__ffs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i64 @cris_swapnwbrlz(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @__ffs(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 @cris_swapnwbrlz(i64 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f() { printf("\nSUCCESSFULLY HACKED!\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"\0ASUCCESSFULLY HACKED!\0A\00"
define void @f() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"\0ASUCCESSFULLY HACKED!\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
void null(char *s) {}


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

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

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

LLVM IR (-O2):
define void @null(i8* nocapture %0) {
ret void
}
int left_child(int n, int i) { return i + n; }


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

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

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

LLVM IR (-O2):
define i32 @left_child(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
char *devnum2devname(int);
int /*<<< orphan*/ free(char *);
int ping_monitor(char *);
int ping_monitor_by_id(int devnum) {
  int err = -1;
  char *container = devnum2devname(devnum);
  if (container) {
    err = ping_monitor(container);
    free(container);
  }
  return err;
}


x86 assembly (clang, -O0):
<ping_monitor_by_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <devnum2devname@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116e <ping_monitor_by_id+0x3e>
mov    -0x10(%rbp),%rdi
call   1050 <ping_monitor@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ping_monitor_by_id>:
push   %rbp
push   %rbx
push   %rax
call   1040 <devnum2devname@plt>
test   %rax,%rax
je     1156 <ping_monitor_by_id+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <ping_monitor@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    115b <ping_monitor_by_id+0x2b>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ping_monitor_by_id(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
store i32 -1, i32* %3
%5 = load i32, i32* %2
%6 = call i8* @devnum2devname(i32 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = call i32 @ping_monitor(i8* %10)
store i32 %11, i32* %3
%12 = load i8*, i8** %4
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %9, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @ping_monitor_by_id(i32 %0) {
%2 = tail call i8* @devnum2devname(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @ping_monitor(i8* %2)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %8
}
signed long long f27(signed long long v_foo) {
  signed long long v_and = v_foo & -49;
  signed long long v_parta = v_and << 5;
  signed long long v_partb = ((unsigned long long)v_and) >> 59;
  signed long long v_rotl = v_parta | v_partb;
  return v_rotl;
}


x86 assembly (clang, -O0):
<f27>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffffffffffcf,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x3b,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f27>:
mov    %rdi,%rax
rol    $0x5,%rax
and    $0xfffffffffffff9ff,%rax
ret

LLVM IR (-O0):
define i64 @f27(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = and i64 %7, -49
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = shl i64 %9, 5
store i64 %10, i64* %4
%11 = load i64, i64* %3
%12 = lshr i64 %11, 59
store i64 %12, i64* %5
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = or i64 %13, %14
store i64 %15, i64* %6
%16 = load i64, i64* %6
ret i64 %16
}

LLVM IR (-O2):
define i64 @f27(i64 %0) {
%2 = shl i64 %0, 5
%3 = and i64 %2, -1568
%4 = lshr i64 %0, 59
%5 = or i64 %3, %4
ret i64 %5
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tst_timespec_abs_diff(struct timespec, struct timespec);
long long tst_timespec_to_us(int /*<<< orphan*/);
long long tst_timespec_abs_diff_us(struct timespec t1, struct timespec t2) {
  return tst_timespec_to_us(tst_timespec_abs_diff(t1, t2));
}


x86 assembly (clang, -O0):
<tst_timespec_abs_diff_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <tst_timespec_abs_diff@plt>
mov    %eax,%edi
call   1040 <tst_timespec_to_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_timespec_abs_diff_us>:
push   %rax
call   1030 <tst_timespec_abs_diff@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <tst_timespec_to_us@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i64 @tst_timespec_abs_diff_us(i32 %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @tst_timespec_abs_diff(i32 %8, i32 %10)
%12 = call i64 @tst_timespec_to_us(i32 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @tst_timespec_abs_diff_us(i32 %0, i32 %1) {
%3 = tail call i32 @tst_timespec_abs_diff(i32 %0, i32 %1)
%4 = tail call i64 @tst_timespec_to_us(i32 %3)
ret i64 %4
}
int cas(volatile int *addr, int expected, int newval) {
  int zf = 0;
  asm volatile("lock;"
               "cmpxchg %%edx,(%%ecx);"
               "jnz 1f;"
               "movl $1,%%ebx;"
               "1:;"
               : "+b"(zf)
               : "c"(addr), "a"(expected), "d"(newval)
               :);
  return zf;
}


x86 assembly (clang, -O0):
<cas>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%ebx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%edx
lock cmpxchg %edx,(%ecx)
jne    1133 <cas+0x33>
mov    $0x1,%ebx
mov    %ebx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cas>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rcx
xor    %ebx,%ebx
lock cmpxchg %edx,(%ecx)
jne    1114 <cas+0x14>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cas(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 asm sideeffect "lock;cmpxchg %edx,(%ecx);jnz 1f;movl $$1,%ebx;1:;", "={bx},{cx},{ax},{dx},0,~{dirflag},~{fpsr},~{flags}"(i32* %9, i32 %10, i32 %11, i32 %8)
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
define i32 @cas(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 asm sideeffect "lock;cmpxchg %edx,(%ecx);jnz 1f;movl $$1,%ebx;1:;", "={bx},{cx},{ax},{dx},0,~{dirflag},~{fpsr},~{flags}"(i32* %0, i32 %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ odwroc(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char slowo[20] = "Ala ma kota";
  odwroc(slowo);
  printf("%s\n", slowo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <odwroc@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <odwroc@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.slowo = [20 x i8] c"Ala ma kota\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = bitcast [20 x i8]* %2 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @odwroc(i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.slowo = [20 x i8] c"Ala ma kota\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @odwroc(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int open(char *, int, int);
int tf_fiddle(int);
int tf_xopen(char *fname, int mode) {
  int fd;
  fd = open(fname, mode, 0600);
  fd = tf_fiddle(fd);
  return fd;
}


x86 assembly (clang, -O0):
<tf_xopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x180,%edx
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <tf_fiddle@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf_xopen>:
push   %rax
mov    $0x180,%edx
call   1040 <open@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <tf_fiddle@plt>

LLVM IR (-O0):
define i32 @tf_xopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7, i32 384)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @tf_fiddle(i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @tf_xopen(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1, i32 384)
%4 = tail call i32 @tf_fiddle(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, char, size_t);
void __aeabi_memset(void *dst0, char val, size_t length) {
  memset(dst0, val, length);
}


x86 assembly (clang, -O0):
<__aeabi_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rdx
movsbl %al,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memset>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @__aeabi_memset(i8* %0, i8 signext %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i64
store i8* %0, i8** %4
store i8 %1, i8* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = load i64, i64* %6
%10 = call i32 @memset(i8* %7, i8 signext %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @__aeabi_memset(i8* %0, i8 signext %1, i64 %2) {
%4 = tail call i32 @memset(i8* %0, i8 signext %1, i64 %2)
ret void
}
void pcgstrf_StackFree() {}


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

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

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

LLVM IR (-O2):
define void @pcgstrf_StackFree() {
ret void
}
/* Variables and functions */
int atoi(char *);
float pow(int, int);
int main(int argc, char **argv) {
  int y = atoi(argv[1]);
  float x = pow(100., y);
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x64,%edi
call   1030 <pow@plt>
movss  %xmm0,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    $0x64,%edi
mov    %eax,%esi
call   1030 <pow@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call float @pow(i32 100, i32 %12)
store float %13, float* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call float @pow(i32 100, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void emit(const char *name, char *family, int level, int optname) {
  printf("            map.put(new RegistryKey(%s, %s),", name, family);
  printf(" new OptionKey(%d, %d));\n", level, optname);
}


x86 assembly (clang, -O0):
<emit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c" map.put(new RegistryKey(%s, %s),\00"
@.str.1 = [26 x i8] c" new OptionKey(%d, %d));\0A\00"
define void @emit(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c" map.put(new RegistryKey(%s, %s),\00"
@.str.1 = [26 x i8] c" new OptionKey(%d, %d));\0A\00"
define void @emit(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %3)
ret void
}
int ti_trima_start(double const *options) { return (int)options[0] - 1; }


x86 assembly (clang, -O0):
<ti_trima_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_trima_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_trima_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_trima_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
int ft_sqrt(int n) {
  int i;
  if (n < 1)
    return (0);
  i = 0;
  while ((i * i) < n)
    i++;
  if ((i * i) == n)
    return (i);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <ft_sqrt+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1164 <ft_sqrt+0x64>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1142 <ft_sqrt+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <ft_sqrt+0x24>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    115d <ft_sqrt+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <ft_sqrt+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
test   %edi,%edi
jle    1124 <ft_sqrt+0x24>
mov    $0xffffffff,%ecx
nopl   0x0(%rax)
add    $0x1,%ecx
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
jl     1110 <ft_sqrt+0x10>
xor    %eax,%eax
cmp    %edi,%edx
cmove  %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = mul nsw i32 %4, %4
%6 = icmp slt i32 %5, %0
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = icmp eq i32 %5, %0
%10 = select i1 %9, i32 %4, i32 0
br label %11
11: ; preds = %8, %1
%12 = phi i32 [ 0, %1 ], [ %10, %8 ]
ret i32 %12
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ NOROM_IntUnregister(int);
void stub1(uint32_t);
void FlashIntUnregister(void) {
  ((void (*)(uint32_t ui32Interrupt))(
      (uint32_t *)(((uint32_t *)0x10000180)[12]))[5])(42);
  NOROM_IntUnregister(42);
}


x86 assembly (clang, -O0):
<FlashIntUnregister>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000180,%eax
mov    0x60(%rax),%rax
mov    $0x2a,%edi
call   *0x28(%rax)
mov    $0x2a,%edi
call   1030 <NOROM_IntUnregister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashIntUnregister>:
push   %rax
mov    0x100001e0,%rax
10
mov    $0x2a,%edi
call   *0x28(%rax)
mov    $0x2a,%edi
pop    %rax
jmp    1030 <NOROM_IntUnregister@plt>

LLVM IR (-O0):
define void @FlashIntUnregister() {
%1 = load i64, i64* getelementptr inbounds (i64, i64* inttoptr (i64 268435840 to i64*), i64 12)
%2 = inttoptr i64 %1 to i64*
%3 = getelementptr inbounds i64, i64* %2, i64 5
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to void (i64)*
%6 = call i32 @NOROM_IntUnregister(i32 42)
ret void
}

LLVM IR (-O2):
define void @FlashIntUnregister() {
%1 = load i64, i64* inttoptr (i64 268435936 to i64*)
%2 = inttoptr i64 %1 to i64*
%3 = getelementptr inbounds i64, i64* %2, i64 5
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to void (i64)*
tail call void %5(i64 42)
%6 = tail call i32 @NOROM_IntUnregister(i32 42)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr2initPPUSet8(int);
int /*<<< orphan*/ chr8initPPUSet8(int);
void m77initPPUSet8(uint16_t addr) {
  if (addr < 0x800)
    chr2initPPUSet8(addr);
  else if (addr < 0x2000)
    chr8initPPUSet8(addr);
}


x86 assembly (clang, -O0):
<m77initPPUSet8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x800,-0x4(%rbp)
jge    1145 <m77initPPUSet8+0x25>
mov    -0x4(%rbp),%edi
call   1040 <chr2initPPUSet8@plt>
jmp    115f <m77initPPUSet8+0x3f>
cmpl   $0x2000,-0x4(%rbp)
jge    115a <m77initPPUSet8+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <chr8initPPUSet8@plt>
jmp    115f <m77initPPUSet8+0x3f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m77initPPUSet8>:
cmp    $0x7ff,%edi
jg     112d <m77initPPUSet8+0xd>
jmp    1040 <chr2initPPUSet8@plt>
cmp    $0x1fff,%edi
ja     113a <m77initPPUSet8+0x1a>
jmp    1030 <chr8initPPUSet8@plt>
ret

LLVM IR (-O0):
define void @m77initPPUSet8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 2048
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @chr2initPPUSet8(i32 %6)
br label %15
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 8192
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = call i32 @chr8initPPUSet8(i32 %12)
br label %14
14: ; preds = %11, %8
br label %15
15: ; preds = %14, %5
ret void
}

LLVM IR (-O2):
define void @m77initPPUSet8(i32 %0) {
%2 = icmp slt i32 %0, 2048
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @chr2initPPUSet8(i32 %0)
br label %9
5: ; preds = %1
%6 = icmp ult i32 %0, 8192
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @chr8initPPUSet8(i32 %0)
br label %9
9: ; preds = %5, %7, %3
ret void
}
int RemovesRedundantVariableCopy() {
  int x = 10;
  int z __attribute__((unused)), y = x;
  return y;
}


x86 assembly (clang, -O0):
<RemovesRedundantVariableCopy>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RemovesRedundantVariableCopy>:
mov    $0xa,%eax
ret

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

LLVM IR (-O2):
define i32 @RemovesRedundantVariableCopy() {
ret i32 10
}
/* Type definitions */
typedef size_t uint64_t;

/* Variables and functions */
uint64_t delayed_timestamp(uint64_t timestamp, uint64_t window_len,
                           size_t windows_cnt) {
  return (timestamp - window_len * windows_cnt);
}


x86 assembly (clang, -O0):
<delayed_timestamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   -0x18(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayed_timestamp>:
mov    %rdi,%rax
imul   %rdx,%rsi
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @delayed_timestamp(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = mul i64 %8, %9
%11 = sub i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @delayed_timestamp(i64 %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = sub i64 %0, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ lua_lua2C(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
int /*<<< orphan*/ lua_tag(int /*<<< orphan*/);
void luaB_luatag(void) { lua_pushnumber(lua_tag(lua_lua2C(1))); }


x86 assembly (clang, -O0):
<luaB_luatag>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <lua_lua2C@plt>
mov    %eax,%edi
call   1040 <lua_tag@plt>
mov    %eax,%edi
call   1030 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaB_luatag>:
push   %rax
mov    $0x1,%edi
call   1050 <lua_lua2C@plt>
mov    %eax,%edi
call   1040 <lua_tag@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @luaB_luatag() {
%1 = call i32 @lua_lua2C(i32 1)
%2 = call i32 @lua_tag(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @luaB_luatag() {
%1 = tail call i32 @lua_lua2C(i32 1)
%2 = tail call i32 @lua_tag(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
double sqrt(double);
int main(void) {
  double x;
  double result;
  printf("x: ");
  scanf("%lf", &x);
  result = sqrt(x);
  printf("sqrt(%lf) = %lf\n", x, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe8b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1166 <main+0x36>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    116f <main+0x3f>
call   1050 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm0
lea    0xe8d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"x: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [17 x i8] c"sqrt(%lf) = %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call double @sqrt(double %5)
%7 = load double, double* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %7, double %6)
ret i32 0
}
void prts() {
  asm volatile("movq $0x26, %%rdi\n\t"
               "movq %%rsp, %%r13\n\t"
               "movq %%r15, %%rsp\n\t"
               "callq *%%r12\n\t"
               "movq %%rsp, %%r15\n\t"
               "movq %%r13, %%rsp\n\t"
               "addq $0x08, %%rsp\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<prts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x26,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %rsp,%r15
mov    %r13,%rsp
add    $0x8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prts>:
mov    $0x26,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %rsp,%r15
mov    %r13,%rsp
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @prts() {
tail call void asm sideeffect "movq $$0x26, %rdi\0A\09movq %rsp, %r13\0A\09movq %r15, %rsp\0A\09callq *%r12\0A\09movq %rsp, %r15\0A\09movq %r13, %rsp\0A\09addq $$0x08, %rsp\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int strlen(char *s) {
  int i = 0;
  while (s[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int popRankForDocIDMmap(int);
int /*<<< orphan*/ popopenMmap();
int /*<<< orphan*/ printf(char *, int);
int main() {
  popopenMmap();
  printf("DocID, rank %i\n", popRankForDocIDMmap(42074211));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <popopenMmap@plt>
mov    $0x2820063,%edi
call   1030 <popRankForDocIDMmap@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"DocID, rank %i\0A\00"
define i32 @main() {
%1 = call i32 (...) @popopenMmap()
%2 = call i32 @popRankForDocIDMmap(i32 42074211)
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"DocID, rank %i\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @popopenMmap()
%2 = tail call i32 @popRankForDocIDMmap(i32 42074211)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ timer_t;
struct sigevent {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<timer_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_create>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sigevent = type { i32 }
@ENOSYS = global i32 0
define i32 @timer_create(i32 %0, %struct.sigevent* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sigevent*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sigevent* %1, %struct.sigevent** %5
store i32* %2, i32** %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
%struct.sigevent = type { i32 }
@ENOSYS = global i32 0
define i32 @timer_create(i32 %0, %struct.sigevent* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
struct tiff_file_desc {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t write_tiff_file(struct tiff_file_desc *tfd, uint32_t *mcu_rgb,
                        uint8_t nb_blocks_h, uint8_t nb_blocks_v) {
  return 0;
}


x86 assembly (clang, -O0):
<write_tiff_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tiff_file_desc = type { i32 }
define i32 @write_tiff_file(%struct.tiff_file_desc* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca %struct.tiff_file_desc*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store %struct.tiff_file_desc* %0, %struct.tiff_file_desc** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.tiff_file_desc = type { i32 }
define i32 @write_tiff_file(%struct.tiff_file_desc* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ yylex();
int main() {
  yylex();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yylex()
ret i32 0
}
int main(void) {
  int a;
  {
    a = 6;
    a = 0;
    {
      while (1) {
      while_0_continue:;
        if (a < 6) {
        } else {
          goto while_0_break;
        }
        a = a + 1;
      }
    while_0_break:;
    }
    if (a == 6) {
    ERROR:
      goto ERROR;
    } else {
    }
    return (1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    111e <main+0x1e>
cmpl   $0x6,-0x8(%rbp)
jge    112d <main+0x2d>
jmp    1132 <main+0x32>
jmp    1140 <main+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
cmpl   $0x6,-0x8(%rbp)
jne    1154 <main+0x54>
jmp    114f <main+0x4f>
jmp    114f <main+0x4f>
jmp    1159 <main+0x59>
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
br label %1
}