xunge/DecIR huggingface dataset:
int MUSIC_PlaySong(unsigned char *song, int loopflag) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MUSIC_PlaySong(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
int f(int a, int b, int c) {
  if (a == 0 && b > c)
    return 0;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112f <f+0x2f>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    112f <f+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1135 <f+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    %edx,%esi
cmovle %edi,%eax
test   %edi,%edi
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = icmp sgt i32 %1, %2
%6 = and i1 %4, %5
%7 = select i1 %6, i32 0, i32 %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ reap_children();
int /*<<< orphan*/ reload_sig_handler(int, void (*)(int));
void reaper(int signo) {
  reap_children();
  reload_sig_handler(signo, reaper);
}


x86 assembly (clang, -O0):
<reaper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <reap_children@plt>
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rsi
call   1030 <reload_sig_handler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reaper>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <reap_children@plt>
mov    0x2ec7(%rip),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <reload_sig_handler@plt>

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

LLVM IR (-O2):
define void @reaper(i32 %0) {
%2 = tail call i32 (...) @reap_children()
%3 = tail call i32 @reload_sig_handler(i32 %0, void (i32)* @reaper)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int name_cmp(char *s1, char *s2) {
  short i = 0;
  int r;
  while (s1[i] != ':') {
    i++;
  }
  s1[i] = 0;
  r = strcmp(s1, s2);
  s1[i] = ':';
  return (r);
}


x86 assembly (clang, -O0):
<name_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x0,-0x12(%rbp)
mov    -0x8(%rbp),%rax
movswq -0x12(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
je     114d <name_cmp+0x3d>
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
jmp    1126 <name_cmp+0x16>
mov    -0x8(%rbp),%rax
movswq -0x12(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movswq -0x12(%rbp),%rcx
movb   $0x3a,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_cmp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
nopl   0x0(%rax)
movswq %ax,%rbx
add    $0x1,%eax
cmpb   $0x3a,(%r14,%rbx,1)
jne    1120 <name_cmp+0x10>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rdi
call   1030 <strcmp@plt>
movb   $0x3a,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @name_cmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i16 [ 0, %2 ], [ %9, %3 ]
%5 = sext i16 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 58
%9 = add i16 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %11
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
store i8 58, i8* %11
ret i32 %12
}
void NetworkServerMonthlyLoop() {}


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

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

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

LLVM IR (-O2):
define void @NetworkServerMonthlyLoop() {
ret void
}
void fn_pragma_0(void) {}


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

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

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

LLVM IR (-O2):
define void @fn_pragma_0() {
ret void
}
/* Variables and functions */
size_t ptls_base64_howlong(size_t data_length) {
  return (((data_length + 2) / 3) * 4);
}


x86 assembly (clang, -O0):
<ptls_base64_howlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptls_base64_howlong>:
lea    0x2(%rdi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
lea    (%rdx,%rdx,1),%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i64 @ptls_base64_howlong(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 2
%5 = udiv i64 %4, 3
%6 = mul i64 %5, 4
ret i64 %6
}

LLVM IR (-O2):
define i64 @ptls_base64_howlong(i64 %0) {
%2 = add i64 %0, 2
%3 = udiv i64 %2, 3
%4 = shl i64 %3, 2
ret i64 %4
}
int javascript_concatenable(const unsigned char *given_char) {
  int concatenable = 0;
  switch (*given_char) {
  case '=':
  case '+':
  case '-':
  case '*':
  case '/':
  case '(':
  case ')':
  case '>':
  case '<':
  case ';':
  case ':':
  case ',':
  case '[':
  case ']':
  case '{':
  case '}':
  case '"':
    concatenable = 1;
  }
  return (concatenable);
}


x86 assembly (clang, -O0):
<javascript_concatenable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5b,%eax
ja     1143 <javascript_concatenable+0x43>
mov    -0x18(%rbp),%rax
lea    0xecd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<javascript_concatenable>:
mov    (%rdi),%cl
xor    %eax,%eax
add    $0xde,%cl
cmp    $0x5b,%cl
ja     1124 <javascript_concatenable+0x24>
movzbl %cl,%ecx
lea    0xeea(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @javascript_concatenable(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
switch i32 %6, label %8 [
i32 61, label %7
i32 43, label %7
i32 45, label %7
i32 42, label %7
i32 47, label %7
i32 40, label %7
i32 41, label %7
i32 62, label %7
i32 60, label %7
i32 59, label %7
i32 58, label %7
i32 44, label %7
i32 91, label %7
i32 93, label %7
i32 123, label %7
i32 125, label %7
i32 34, label %7
]
7: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @javascript_concatenable(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %4 [
i8 61, label %3
i8 43, label %3
i8 45, label %3
i8 42, label %3
i8 47, label %3
i8 40, label %3
i8 41, label %3
i8 62, label %3
i8 60, label %3
i8 59, label %3
i8 58, label %3
i8 44, label %3
i8 91, label %3
i8 93, label %3
i8 123, label %3
i8 125, label %3
i8 34, label %3
]
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %4
4: ; preds = %3, %1
%5 = phi i32 [ 0, %1 ], [ 1, %3 ]
ret i32 %5
}
int fun909() { return 909; }


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

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

LLVM IR (-O0):
define i32 @fun909() {
ret i32 909
}

LLVM IR (-O2):
define i32 @fun909() {
ret i32 909
}
void z(int a, int b) {}


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

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

LLVM IR (-O0):
define void @z(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 @z(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC18F4620_stop(void) {
  serial_close(0);
  ;
}


x86 assembly (clang, -O0):
<PIC18F4620_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <serial_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC18F4620_stop>:
xor    %edi,%edi
jmp    1030 <serial_close@plt>

LLVM IR (-O0):
define void @PIC18F4620_stop() {
%1 = call i32 @serial_close(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC18F4620_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
int I2C_WriteBytes(int I2cSlaveAddr, int RegAddress, unsigned char *TxBuffer,
                   int NumberOfBytes) {
  return -1;
}


x86 assembly (clang, -O0):
<I2C_WriteBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @I2C_WriteBytes(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @I2C_WriteBytes(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printHello();
int main() {
  printHello();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printHello()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ detab(char *, char *, int);
int getlineuser(char *, int);
int main() {
  int len;
  char line[1000];
  char dline[1000];
  while ((len = getlineuser(line, 1000)) > 0)
    detab(dline, line, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getlineuser@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    116c <main+0x4c>
lea    -0x7e0(%rbp),%rdi
lea    -0x3f0(%rbp),%rsi
mov    $0x4,%edx
call   1030 <detab@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7d8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getlineuser@plt>
test   %eax,%eax
jle    1171 <main+0x51>
lea    0x3f0(%rsp),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <detab@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getlineuser@plt>
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x7d8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
store i32 0, i32* %1
br label %5
5: ; preds = %9, %0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = call i32 @getlineuser(i8* %6, i32 1000)
store i32 %7, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = call i32 @detab(i8* %10, i8* %11, i32 4)
br label %5
13: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @getlineuser(i8* %3, i32 1000)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0, %7
%8 = call i32 @detab(i8* %4, i8* %3, i32 4)
%9 = call i32 @getlineuser(i8* %3, i32 1000)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7, %0
ret i32 0
}
unsigned long __udivdi3(unsigned long a __attribute__((unused)),
                        unsigned long b __attribute__((unused))) {
  return 0.0;
}


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

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

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

LLVM IR (-O2):
define i64 @__udivdi3(i64 %0, i64 %1) {
ret i64 0
}
void reg_write_32(unsigned int data, volatile unsigned int *addr) {
  *addr = data;
}


x86 assembly (clang, -O0):
<reg_write_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_write_32>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @reg_write_32(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
store volatile i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @reg_write_32(i32 %0, i32* %1) {
store volatile i32 %0, i32* %1
ret void
}
/* Variables and functions */
double cc_barometer_to_pressure(double);
double cc_pressure_to_altitude(double);
double cc_barometer_to_altitude(double baro) {
  double Pa = cc_barometer_to_pressure(baro);
  return cc_pressure_to_altitude(Pa);
}


x86 assembly (clang, -O0):
<cc_barometer_to_altitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cc_barometer_to_pressure@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cc_pressure_to_altitude@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_barometer_to_altitude>:
push   %rax
call   1040 <cc_barometer_to_pressure@plt>
pop    %rax
jmp    1030 <cc_pressure_to_altitude@plt>

LLVM IR (-O0):
define double @cc_barometer_to_altitude(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @cc_barometer_to_pressure(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @cc_pressure_to_altitude(double %6)
ret double %7
}

LLVM IR (-O2):
define double @cc_barometer_to_altitude(double %0) {
%2 = tail call double @cc_barometer_to_pressure(double %0)
%3 = tail call double @cc_pressure_to_altitude(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ MFRC522_CRC(char *, int, char *);
int /*<<< orphan*/ MFRC522_Clear_Bit(int, int);
int /*<<< orphan*/ MFRC522_ToCard(int, char *, int, char *, unsigned int *);
void MFRC522_Halt() {
  unsigned unLen;
  char buff[4];
  buff[0] = 0x50;
  buff[1] = 0;
  MFRC522_CRC(buff, 2, &buff[2]);
  MFRC522_Clear_Bit(0x08, 0x80);
  MFRC522_ToCard(0x0C, buff, 4, buff, &unLen);
  MFRC522_Clear_Bit(0x08, 0x08);
}


x86 assembly (clang, -O0):
<MFRC522_Halt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x50,-0x8(%rbp)
movb   $0x0,-0x7(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x8(%rbp),%rdx
add    $0x2,%rdx
mov    $0x2,%esi
call   1030 <MFRC522_CRC@plt>
mov    $0x8,%edi
mov    $0x80,%esi
call   1050 <MFRC522_Clear_Bit@plt>
lea    -0x8(%rbp),%rsi
lea    -0x8(%rbp),%rcx
mov    $0xc,%edi
mov    $0x4,%edx
lea    -0x4(%rbp),%r8
call   1040 <MFRC522_ToCard@plt>
mov    $0x8,%esi
mov    %esi,%edi
call   1050 <MFRC522_Clear_Bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MFRC522_Halt>:
push   %rbx
sub    $0x10,%rsp
movw   $0x50,0x8(%rsp)
lea    0xa(%rsp),%rdx
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <MFRC522_CRC@plt>
mov    $0x8,%edi
mov    $0x80,%esi
call   1050 <MFRC522_Clear_Bit@plt>
lea    0xc(%rsp),%r8
mov    $0xc,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1040 <MFRC522_ToCard@plt>
mov    $0x8,%edi
mov    $0x8,%esi
call   1050 <MFRC522_Clear_Bit@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @MFRC522_Halt() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
store i8 80, i8* %3
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%7 = call i32 @MFRC522_CRC(i8* %5, i32 2, i8* %6)
%8 = call i32 @MFRC522_Clear_Bit(i32 8, i32 128)
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%11 = call i32 @MFRC522_ToCard(i32 12, i8* %9, i32 4, i8* %10, i32* %1)
%12 = call i32 @MFRC522_Clear_Bit(i32 8, i32 8)
ret void
}

LLVM IR (-O2):
define void @MFRC522_Halt() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
store i8 80, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 0, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%7 = call i32 @MFRC522_CRC(i8* %4, i32 2, i8* %6)
%8 = call i32 @MFRC522_Clear_Bit(i32 8, i32 128)
%9 = call i32 @MFRC522_ToCard(i32 12, i8* %4, i32 4, i8* %4, i32* %1)
%10 = call i32 @MFRC522_Clear_Bit(i32 8, i32 8)
ret void
}
unsigned int test1(unsigned int a) { return (a & 1) | 1; }


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

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

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

LLVM IR (-O2):
define i32 @test1(i32 %0) {
ret i32 1
}
void __lock(volatile int *l) {}


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

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

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

LLVM IR (-O2):
define void @__lock(i32* nocapture %0) {
ret void
}
void INT_Excep_FCU_FIFERR(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_FCU_FIFERR() {
ret void
}
void exo_prefetch1(volatile void *p) {
  asm volatile("prefetcht1 %[p]" : [p] "+m"(*(volatile char *)p));
}


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

x86 assembly (clang, -O2):
<exo_prefetch1>:
prefetcht1 (%rdi)
ret

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

LLVM IR (-O2):
define void @exo_prefetch1(i8* %0) {
tail call void asm sideeffect "prefetcht1 $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i8* elementtype(i8) %0)
ret void
}
void get_frame_size(widthp, heightp) int *widthp, *heightp;
{
  *widthp = 0;
  *heightp = 0;
}


x86 assembly (clang, -O0):
<get_frame_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_frame_size>:
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @get_frame_size(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
store i32 0, i32* %5
%6 = load i32*, i32** %4
store i32 0, i32* %6
ret void
}

LLVM IR (-O2):
define void @get_frame_size(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 0, i32* %0
store i32 0, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __sys__(char *, char *);
int main() {
  __sys__("print", "hello there");
  int a = 5;
  double d = 5.0;
  float c = 2.0f;
  char *pt = "hi thar";
  int *ptr = &a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeea(%rip),%rdi
lea    0xee9(%rip),%rsi
call   1030 <__sys__@plt>
movl   $0x5,-0x8(%rbp)
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"print\00"
@.str.1 = [12 x i8] c"hello there\00"
@.str.2 = [8 x i8] c"hi thar\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca float
%5 = alloca i8*
%6 = alloca i32*
store i32 0, i32* %1
%7 = call i32 @__sys__(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 5, i32* %2
store double 5.000000e+00, double* %3
store float 2.000000e+00, float* %4
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %5
store i32* %2, i32** %6
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"print\00"
@.str.1 = [12 x i8] c"hello there\00"
define i32 @main() {
%1 = tail call i32 @__sys__(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ arm();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ thumb();
int main(int argc, char *argv[]) {
  arm();
  thumb();
  printf("arm: %d\n", (ptrdiff_t)&arm);
  printf("thumb: %d\n", (ptrdiff_t)&thumb);
  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   1040 <arm@plt>
mov    $0x0,%al
call   1048 <thumb@plt>
lea    0xeb5(%rip),%rdi
mov    0x2e86(%rip),%rax
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    0x2e81(%rip),%rax
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <arm@plt>
mov    0x2ea8(%rip),%ebx
xor    %eax,%eax
call   1048 <thumb@plt>
mov    0x2eab(%rip),%ebp
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"arm: %d\0A\00"
@.str.1 = [11 x i8] c"thumb: %d\0A\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 (...) @arm()
%7 = call i32 (...) @thumb()
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 ptrtoint (i32 (...)* @arm to i32))
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 ptrtoint (i32 (...)* @thumb to i32))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"arm: %d\0A\00"
@.str.1 = [11 x i8] c"thumb: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @arm()
%4 = tail call i32 (...) @thumb()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 ptrtoint (i32 (...)* @arm to i32))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 ptrtoint (i32 (...)* @thumb to i32))
ret i32 0
}
/* Variables and functions */
int rand();
int randint(int l, int u) { return rand() % (u - l + 1) + l; }


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randint(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ s2qwin(float *, float *, float *, float *, float *, float *);
void s2qwin_(float *x1, float *x2, float *y1, float *y2, float *z1, float *z2) {
  s2qwin(x1, x2, y1, y2, z1, z2);
}


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

x86 assembly (clang, -O2):
<s2qwin_>:
jmp    1030 <s2qwin@plt>

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

LLVM IR (-O2):
define void @s2qwin_(float* %0, float* %1, float* %2, float* %3, float* %4, float* %5) {
%7 = tail call i32 @s2qwin(float* %0, float* %1, float* %2, float* %3, float* %4, float* %5)
ret void
}
int checkRow(int r, int board[3][3]) {
  int rowState = 0;
  for (int i = 0; i < 3; i++)
    rowState += board[i][r];
  if (rowState == 3)
    return 1;
  if (rowState == -3)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<checkRow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    114d <checkRow+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1119 <checkRow+0x19>
cmpl   $0x3,-0x14(%rbp)
jne    1163 <checkRow+0x63>
movl   $0x1,-0x4(%rbp)
jmp    1180 <checkRow+0x80>
cmpl   $0xfffffffd,-0x14(%rbp)
jne    1179 <checkRow+0x79>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <checkRow+0x80>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkRow>:
movslq %edi,%rax
mov    0xc(%rsi,%rax,4),%ecx
add    (%rsi,%rax,4),%ecx
add    0x18(%rsi,%rax,4),%ecx
xor    %edx,%edx
cmp    $0xfffffffd,%ecx
sete   %dl
neg    %edx
cmp    $0x3,%ecx
mov    $0x1,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
define i32 @checkRow(i32 %0, [3 x i32]* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x i32]*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store [3 x i32]* %1, [3 x i32]** %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %22, %2
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = load [3 x i32]*, [3 x i32]** %5
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %12, i64 %14
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %6
%21 = add nsw i32 %20, %19
store i32 %21, i32* %6
br label %22
22: ; preds = %11
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %8
25: ; preds = %8
%26 = load i32, i32* %6
%27 = icmp eq i32 %26, 3
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 1, i32* %3
br label %34
29: ; preds = %25
%30 = load i32, i32* %6
%31 = icmp eq i32 %30, -3
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 -1, i32* %3
br label %34
33: ; preds = %29
store i32 0, i32* %3
br label %34
34: ; preds = %33, %32, %28
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @checkRow(i32 %0, [3 x i32]* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 %3
%5 = load i32, i32* %4
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 1, i64 %3
%7 = load i32, i32* %6
%8 = add nsw i32 %7, %5
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 2, i64 %3
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
%12 = icmp eq i32 %11, -3
%13 = sext i1 %12 to i32
%14 = icmp eq i32 %11, 3
%15 = select i1 %14, i32 1, i32 %13
ret i32 %15
}
int set_window_size(fd, height, width)
int fd, height, width;
{ return -1; }


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

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

LLVM IR (-O0):
define i32 @set_window_size(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @set_window_size(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_24(uint64_t x) {
  __asm__("rolq $24, %0" : "=r"(x) : "0"(x));
  return x;
}


x86 assembly (clang, -O0):
<ROL64_24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
rol    $0x18,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL64_24>:
mov    %rdi,%rax
rol    $0x18,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_24(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$24, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_24(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$24, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_ConnectionManager_GetCurrentConnectionIDs(void *, char *);
void UpnpConnectionManager_GetCurrentConnectionIDs(void *upnptoken) {
  UpnpResponse_ConnectionManager_GetCurrentConnectionIDs(upnptoken, "");
}


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

x86 assembly (clang, -O2):
<UpnpConnectionManager_GetCurrentConnectionIDs>:
lea    0xee9(%rip),%rsi
jmp    1030 <UpnpResponse_ConnectionManager_GetCurrentConnectionIDs@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @UpnpConnectionManager_GetCurrentConnectionIDs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @UpnpResponse_ConnectionManager_GetCurrentConnectionIDs(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @UpnpConnectionManager_GetCurrentConnectionIDs(i8* %0) {
%2 = tail call i32 @UpnpResponse_ConnectionManager_GetCurrentConnectionIDs(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write_call_table();
int /*<<< orphan*/ write_makefile();
int main(int argc, char *argv[]) {
  write_makefile();
  write_call_table();
  exit(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 <write_makefile@plt>
mov    $0x0,%al
call   1040 <write_call_table@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <write_makefile@plt>
xor    %eax,%eax
call   1040 <write_call_table@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @write_makefile()
%7 = call i32 (...) @write_call_table()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @write_makefile()
%4 = tail call i32 (...) @write_call_table()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int Object_attack(void *self, int damage) {
  assert(self != NULL);
  printf("You can't attack that.\n");
  return 0;
}


x86 assembly (clang, -O0):
<Object_attack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Object_attack>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"You can't attack that.\0A\00"
define i32 @Object_attack(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 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"You can't attack that.\00"
define i32 @Object_attack(i8* readnone %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned char sel_ch(unsigned char a, unsigned char b, int bit) {
  unsigned mask = (unsigned)(-bit);
  return (unsigned char)((mask & (a ^ b)) ^ a);
}


x86 assembly (clang, -O0):
<sel_ch>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%edx
xor    %edx,%ecx
and    %ecx,%eax
movzbl -0x1(%rbp),%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sel_ch>:
mov    %edi,%eax
xor    %edi,%esi
neg    %dl
and    %sil,%dl
xor    %dl,%al
ret

LLVM IR (-O0):
define zeroext i8 @sel_ch(i8 zeroext %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sub nsw i32 0, %8
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = and i32 %10, %15
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = xor i32 %16, %18
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @sel_ch(i8 zeroext %0, i8 zeroext %1, i32 %2) {
%4 = xor i8 %1, %0
%5 = trunc i32 %2 to i8
%6 = sub i8 0, %5
%7 = and i8 %4, %6
%8 = xor i8 %7, %0
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ IsHeximalPal(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  for (; !IsHeximalPal(n); n++)
    ;
  printf("%X", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <IsHeximalPal@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116c <main+0x3c>
jmp    117f <main+0x4f>
jmp    1171 <main+0x41>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <main+0x1f>
mov    -0x8(%rbp),%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
cs nopw 0x0(%rax,%rax,1)
call   1050 <IsHeximalPal@plt>
test   %eax,%eax
jne    1166 <main+0x36>
mov    0x4(%rsp),%edi
add    $0x1,%edi
mov    %edi,0x4(%rsp)
jmp    1150 <main+0x20>
mov    0x4(%rsp),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%X\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @IsHeximalPal(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = call i32 @IsHeximalPal(i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
%13 = load i32, i32* %1
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}
/* Variables and functions */
int foo();
int main() { return 1 + foo(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Type definitions */
struct tp {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ tp_field(struct tp *, char const *, int /*<<< orphan*/);
ssize_t tp_sz(struct tp *p, const char *sz) {
  return tp_field(p, sz, strlen(sz));
}


x86 assembly (clang, -O0):
<tp_sz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <tp_field@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_sz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <tp_field@plt>

LLVM IR (-O0):
%struct.tp = type { i32 }
define i32 @tp_sz(%struct.tp* %0, i8* %1) {
%3 = alloca %struct.tp*
%4 = alloca i8*
store %struct.tp* %0, %struct.tp** %3
store i8* %1, i8** %4
%5 = load %struct.tp*, %struct.tp** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @tp_field(%struct.tp* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.tp = type { i32 }
define i32 @tp_sz(%struct.tp* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @tp_field(%struct.tp* %0, i8* %1, i32 %3)
ret i32 %4
}
int wiringPiSetup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wiringPiSetup() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void show_error_and_die(char *e) {
  printf("%s stopping...\n", e);
  exit(-1);
}


x86 assembly (clang, -O0):
<show_error_and_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_error_and_die>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"%s stopping...\0A\00"
define void @show_error_and_die(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("POLLER WAS HERE|poller=1;3;5;0;\n");
  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)
lea    0xed3(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"POLLER WAS HERE|poller=1;3;5;0;\0A\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 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [32 x i8] c"POLLER WAS HERE|poller=1;3;5;0;\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
void quit(int sig) {
  endwin();
  exit(sig);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <endwin@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @endwin()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @quit(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @exit(i32 %0)
unreachable
}