xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char const *, char const *);
int string_compare(const void *a, const void *b) {
  const char *sa = a;
  const char *sb = b;
  return strcmp(sa, sb);
}


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

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

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

LLVM IR (-O2):
define i32 @string_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void mdp4_lcdc_primary_vsyn(void) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_lcdc_primary_vsyn() {
ret void
}
int sysLoad(char *dst, int i, int ldst, char *filename, int j, int len) {}


x86 assembly (clang, -O0):
<sysLoad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sysLoad(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @sysLoad(i8* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32 %4, i32 %5) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC18F4550_stop(void) {
  serial_close(0);
  ;
}


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

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

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

LLVM IR (-O2):
define void @PIC18F4550_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aes_decr(unsigned char *, unsigned char *);
int /*<<< orphan*/ expandKey(unsigned char *, unsigned char *);
void aes_decrypt(unsigned char *state, unsigned char *key) {
  unsigned char expandedKey[176];
  expandKey(expandedKey, key);
  aes_decr(state, expandedKey);
}


x86 assembly (clang, -O0):
<aes_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xc0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <expandKey@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1030 <aes_decr@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_decrypt>:
push   %r14
push   %rbx
sub    $0xb8,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <expandKey@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <aes_decr@plt>
add    $0xb8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @aes_decrypt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [176 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [176 x i8], [176 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @expandKey(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [176 x i8], [176 x i8]* %5, i64 0, i64 0
%11 = call i32 @aes_decr(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @aes_decrypt(i8* %0, i8* %1) {
%3 = alloca [176 x i8]
%4 = getelementptr inbounds [176 x i8], [176 x i8]* %3, i64 0, i64 0
%5 = call i32 @expandKey(i8* %4, i8* %1)
%6 = call i32 @aes_decr(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int identity(char);
void void_tor1(char x) { char y = (identity(x) | 1) ? 42 : 43; }


x86 assembly (clang, -O0):
<void_tor1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <identity@plt>
mov    %eax,%edx
or     $0x1,%edx
mov    $0x2b,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x2(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<void_tor1>:
jmp    1030 <identity@plt>

LLVM IR (-O0):
define void @void_tor1(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @identity(i8 signext %4)
%6 = or i32 %5, 1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 42, i32 43
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
ret void
}

LLVM IR (-O2):
define void @void_tor1(i8 signext %0) {
%2 = tail call i32 @identity(i8 signext %0)
ret void
}
/* Variables and functions */
unsigned long long le32dec(unsigned char const *);
extern unsigned long long le64dec(const void *buf) {
  const unsigned char *p = (const unsigned char *)buf;
  return (le32dec(p) | ((unsigned long long)le32dec(p + 4) << 32));
}


x86 assembly (clang, -O0):
<le64dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <le32dec@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1030 <le32dec@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
shl    $0x20,%rcx
or     %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le64dec>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <le32dec@plt>
mov    %rax,%r14
add    $0x4,%rbx
mov    %rbx,%rdi
call   1030 <le32dec@plt>
shl    $0x20,%rax
or     %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @le64dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @le32dec(i8* %5)
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 4
%9 = call i64 @le32dec(i8* %8)
%10 = shl i64 %9, 32
%11 = or i64 %6, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @le64dec(i8* %0) {
%2 = tail call i64 @le32dec(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = tail call i64 @le32dec(i8* %3)
%5 = shl i64 %4, 32
%6 = or i64 %5, %2
ret i64 %6
}
void Food_Treatment(int ido, int t) {}


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

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

LLVM IR (-O0):
define void @Food_Treatment(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 @Food_Treatment(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t header_len_high(size_t header_len) {
  return ((1280 - header_len) & 0xff00) >> 8;
}


x86 assembly (clang, -O0):
<header_len_high>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x500,%eax
sub    -0x8(%rbp),%rax
and    $0xff00,%rax
shr    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_len_high>:
mov    $0x500,%eax
sub    %edi,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @header_len_high(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 1280, %3
%5 = and i64 %4, 65280
%6 = lshr i64 %5, 8
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @header_len_high(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = sub i32 1280, %2
%4 = lshr i32 %3, 8
%5 = and i32 %4, 255
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
size_t strlen(char *);
void writeBuffer(char *buffer, char *header, char *info) {
  strcat(buffer, header);
  strcat(buffer, info);
  buffer[strlen(buffer)] = '\n';
}


x86 assembly (clang, -O0):
<writeBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
movb   $0xa,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeBuffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movb   $0xa,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @writeBuffer(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcat(i8* %7, i8* %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %6
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %4
%15 = call i64 @strlen(i8* %14)
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 10, i8* %16
ret void
}

LLVM IR (-O2):
define void @writeBuffer(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcat(i8* %0, i8* %1)
%5 = tail call i32 @strcat(i8* %0, i8* %2)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 10, i8* %7
ret void
}
void foo659() {}


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

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

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

LLVM IR (-O2):
define void @foo659() {
ret void
}
/* Variables and functions */
scalar_t__ all_divisible(int, int);
int solve(int p) {
  int i;
  for (i = 1;; i++) {
    if (all_divisible(p, i)) {
      return i;
    }
  }
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <all_divisible@plt>
cmp    $0x0,%rax
je     1140 <solve+0x30>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1145 <solve+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <solve+0x12>

x86 assembly (clang, -O2):
<solve>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <all_divisible@plt>
test   %rax,%rax
je     1120 <solve+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @solve(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = tail call i64 @all_divisible(i32 %0, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void main() { int64_t a; }


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendBlink(int, int, int, int);
int /*<<< orphan*/ sendConf(int, int);
void setBlueRedBlink(int sockfd, int timeOn, int period) {
  sendConf(sockfd, (1 << 7) | (3 << 3) | (3 << 1));
  sendBlink(sockfd, 0x11, 101, 100);
  sendBlink(sockfd, 0x13, timeOn, period);
}


x86 assembly (clang, -O0):
<setBlueRedBlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x9e,%esi
call   1040 <sendConf@plt>
mov    -0x4(%rbp),%edi
mov    $0x11,%esi
mov    $0x65,%edx
mov    $0x64,%ecx
call   1030 <sendBlink@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x13,%esi
call   1030 <sendBlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBlueRedBlink>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x9e,%esi
call   1040 <sendConf@plt>
mov    %ebx,%edi
mov    $0x11,%esi
mov    $0x65,%edx
mov    $0x64,%ecx
call   1030 <sendBlink@plt>
mov    %ebx,%edi
mov    $0x13,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sendBlink@plt>

LLVM IR (-O0):
define void @setBlueRedBlink(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @sendConf(i32 %7, i32 158)
%9 = load i32, i32* %4
%10 = call i32 @sendBlink(i32 %9, i32 17, i32 101, i32 100)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @sendBlink(i32 %11, i32 19, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @setBlueRedBlink(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @sendConf(i32 %0, i32 158)
%5 = tail call i32 @sendBlink(i32 %0, i32 17, i32 101, i32 100)
%6 = tail call i32 @sendBlink(i32 %0, i32 19, i32 %1, i32 %2)
ret void
}
void nestra(int **p) {
  int a;
  a = 5;
  *p = &a;
}


x86 assembly (clang, -O0):
<nestra>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%rax
lea    -0xc(%rbp),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nestra>:
lea    -0x4(%rsp),%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @nestra(i32** nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32* %2, i32** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getc(int /*<<< orphan*/ *);
void uninitvar_getc(void) {
  FILE *stream;
  (void)getc(stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_getc>:
jmp    1030 <getc@plt>

LLVM IR (-O0):
define void @uninitvar_getc() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @getc(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_getc() {
%1 = tail call i32 @getc(i32* undef)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
void lineCount() {
  int c, nl;
  nl = 0;
  while ((c = getchar()) != EOF)
    if (c == '\n')
      ++nl;
  printf("%d\n", nl);
}


x86 assembly (clang, -O0):
<lineCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1160 <lineCount+0x40>
cmpl   $0xa,-0x4(%rbp)
jne    115b <lineCount+0x3b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <lineCount+0xf>
mov    -0x8(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineCount>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <lineCount+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <lineCount+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @lineCount() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, int);
void swap(void *p1, void *p2, int size) {
  char tmp[20];
  memcpy(tmp, p1, size);
  memcpy(p1, p2, size);
  memcpy(p2, tmp, size);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%r12
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i32 %2) {
%4 = alloca [20 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%6 = call i32 @memcpy(i8* %5, i8* %0, i32 %2)
%7 = call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%8 = call i32 @memcpy(i8* %1, i8* %5, i32 %2)
ret void
}
int fibo(int i) {
  if (i == 0)
    return 1;
  if (i == 1)
    return 1;
  return fibo(i - 1) + fibo(i - 2);
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibo+0x21>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibo+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibo+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibo+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jb     1145 <fibo+0x35>
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <fibo@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1130 <fibo+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibo(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printInstructions() {
  printf("Temperature Visualizer: \n"
         "Relocate source with mouse click\n"
         "Change source temperature (-/+): s/S\n"
         "Change air temperature    (-/+): a/A\n"
         "Change ground temperature (-/+): g/G\n"
         "Change pipe radius        (-/+): r/R\n"
         "Change chamfer            (-/+): c/C\n"
         "Reset to air temperature       : z\n"
         "Exit                           : Esc\n");
}


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

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

LLVM IR (-O0):
@.str = [316 x i8] c"Temperature Visualizer: \0ARelocate source with mouse click\0AChange source temperature (-/+): s/S\0AChange air temperature (-/+): a/A\0AChange ground temperature (-/+): g/G\0AChange pipe radius (-/+): r/R\0AChange chamfer (-/+): c/C\0AReset to air temperature : z\0AExit : Esc\0A\00"
define void @printInstructions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([316 x i8], [316 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [315 x i8] c"Temperature Visualizer: \0ARelocate source with mouse click\0AChange source temperature (-/+): s/S\0AChange air temperature (-/+): a/A\0AChange ground temperature (-/+): g/G\0AChange pipe radius (-/+): r/R\0AChange chamfer (-/+): c/C\0AReset to air temperature : z\0AExit : Esc\00"
define void @printInstructions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([315 x i8], [315 x i8]* @str, i64 0, i64 0))
ret void
}
float Sleef_fminf(float x, float y) { return __builtin_fminf(x, y); }


x86 assembly (clang, -O0):
<Sleef_fminf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
minss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_fminf>:
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
minss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @Sleef_fminf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.minnum.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @Sleef_fminf(float %0, float %1) {
%3 = tail call float @llvm.minnum.f32(float %0, float %1)
ret float %3
}
void *fz_malloc(int n) {
  void *p = malloc(n);
  if (!p)
    fz_throwimp("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/OpenInkpot-archive/"
                "iplinux-mupdf-fontdump/refs/heads/master/fitz/base_memory.c",
                7, __func__, "cannot malloc %d bytes", n);
  return p;
}


x86 assembly (clang, -O0):
<fz_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <fz_malloc+0x48>
mov    -0x4(%rbp),%r8d
lea    0xeb2(%rip),%rdi
mov    $0x7,%esi
lea    0xf4f(%rip),%rdx
lea    0xf52(%rip),%rcx
mov    $0x0,%al
call   1040 <fz_throwimp@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
movslq %edi,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1159 <fz_malloc+0x39>
lea    0xec4(%rip),%rdi
lea    0xf66(%rip),%rdx
lea    0xf69(%rip),%rcx
mov    $0x7,%esi
mov    %ebp,%r8d
xor    %eax,%eax
call   1040 <fz_throwimp@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/OpenInkpot-archive/iplinux-mupdf-fontdump/refs/heads/master/fitz/base_memory.c\00"
@__func__.fz_malloc = [10 x i8] c"fz_malloc\00"
@.str.1 = [23 x i8] c"cannot malloc %d bytes\00"
define i8* @fz_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 (i8*, i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @fz_throwimp to i32 (i8*, i32, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.fz_malloc, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/OpenInkpot-archive/iplinux-mupdf-fontdump/refs/heads/master/fitz/base_memory.c\00"
@__func__.fz_malloc = [10 x i8] c"fz_malloc\00"
@.str.1 = [23 x i8] c"cannot malloc %d bytes\00"
define i8* @fz_malloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @fz_throwimp to i32 (i8*, i32, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.fz_malloc, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Type definitions */
struct hashlist {
  int dummy;
};

/* Variables and functions */
void InitializeHashTable(struct hashlist **tab) {
  int i;
  for (i = 0; i < 997; i++)
    tab[i] = NULL;
}


x86 assembly (clang, -O0):
<InitializeHashTable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e5,-0xc(%rbp)
jge    113a <InitializeHashTable+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <InitializeHashTable+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitializeHashTable>:
push   %rax
mov    $0x1f28,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
%struct.hashlist = type { i32 }
define void @InitializeHashTable(%struct.hashlist** nocapture writeonly %0) {
%2 = bitcast %struct.hashlist** %0 to i8*
ret void
}
/* Variables and functions */
char *mystrrchr(char *str, char *ch) {
  char *res = NULL;
  while (*str) {
    if (*str == ch[0])
      res = str;
    *str++;
  }
  return res;
}


x86 assembly (clang, -O0):
<mystrrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <mystrrchr+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113f <mystrrchr+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <mystrrchr+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrrchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <mystrrchr+0x23>
mov    (%rsi),%dl
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmp    %dl,%cl
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <mystrrchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @mystrrchr(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = load i8, i8* %1
br label %7
7: ; preds = %5, %7
%8 = phi i8 [ %3, %5 ], [ %14, %7 ]
%9 = phi i8* [ null, %5 ], [ %12, %7 ]
%10 = phi i8* [ %0, %5 ], [ %13, %7 ]
%11 = icmp eq i8 %8, %6
%12 = select i1 %11, i8* %10, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i8* [ null, %2 ], [ %12, %7 ]
ret i8* %17
}
/* Variables and functions */
int /*<<< orphan*/ copyFileTo(char *, char *);
int main(int argc, char *argv[]) {
  char *source = argv[1];
  char *dest = argv[2];
  copyFileTo(source, dest);
  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),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <copyFileTo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <copyFileTo@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 i8*
%7 = alloca i8*
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
store i8* %10, i8** %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 2
%13 = load i8*, i8** %12
store i8* %13, i8** %7
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = call i32 @copyFileTo(i8* %14, i8* %15)
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 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @copyFileTo(i8* %4, i8* %6)
ret i32 0
}
/* Variables and functions */
char *getenv(char const *);
int strToInt(char const *);
int getFromEnv(const char *name) {
  const char *val = getenv(name);
  if (val == NULL) {
    return 0;
  }
  return strToInt(val);
}


x86 assembly (clang, -O0):
<getFromEnv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <getFromEnv+0x30>
movl   $0x0,-0x4(%rbp)
jmp    115c <getFromEnv+0x3c>
mov    -0x18(%rbp),%rdi
call   1040 <strToInt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFromEnv>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
je     1134 <getFromEnv+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <strToInt@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getFromEnv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @strToInt(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void version(void) {
  fprintf(stderr, "replay - version 0.2 alpha\n");
  fprintf(stderr, "Copyright 2008, Adam Hoka\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"replay - version 0.2 alpha\0A\00"
@.str.1 = [27 x i8] c"Copyright 2008, Adam Hoka\0A\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"replay - version 0.2 alpha\0A\00"
@.str.1 = [27 x i8] c"Copyright 2008, Adam Hoka\0A\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t BitInterleave(uint64_t Ai) {
  if ((0)) {
    uint32_t hi = (uint32_t)(Ai >> 32), lo = (uint32_t)Ai;
    uint32_t t0, t1;
    t0 = lo & 0x55555555;
    t0 |= t0 >> 1;
    t0 &= 0x33333333;
    t0 |= t0 >> 2;
    t0 &= 0x0f0f0f0f;
    t0 |= t0 >> 4;
    t0 &= 0x00ff00ff;
    t0 |= t0 >> 8;
    t0 &= 0x0000ffff;
    t1 = hi & 0x55555555;
    t1 |= t1 >> 1;
    t1 &= 0x33333333;
    t1 |= t1 >> 2;
    t1 &= 0x0f0f0f0f;
    t1 |= t1 >> 4;
    t1 &= 0x00ff00ff;
    t1 |= t1 >> 8;
    t1 <<= 16;
    lo &= 0xaaaaaaaa;
    lo |= lo << 1;
    lo &= 0xcccccccc;
    lo |= lo << 2;
    lo &= 0xf0f0f0f0;
    lo |= lo << 4;
    lo &= 0xff00ff00;
    lo |= lo << 8;
    lo >>= 16;
    hi &= 0xaaaaaaaa;
    hi |= hi << 1;
    hi &= 0xcccccccc;
    hi |= hi << 2;
    hi &= 0xf0f0f0f0;
    hi |= hi << 4;
    hi &= 0xff00ff00;
    hi |= hi << 8;
    hi &= 0xffff0000;
    Ai = ((uint64_t)(hi | lo) << 32) | (t1 | t0);
  }
  return Ai;
}


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

x86 assembly (clang, -O2):
<BitInterleave>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @BitInterleave(i32 returned %0) {
ret i32 %0
}
void gdk_window_begin_paint_region() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_begin_paint_region() {
ret void
}
/* Variables and functions */
scalar_t__ ceil(long double);
int iceill(long double a) { return (int)ceil(a); }


x86 assembly (clang, -O0):
<iceill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <ceil@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iceill>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @iceill(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @ceil(x86_fp80 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @iceill(x86_fp80 %0) {
%2 = tail call i64 @ceil(x86_fp80 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
prefix(s1, s2) register char *s1, *s2;
{
  while (*s1)
    if (*s1++ != *s2++)
      return (0);
  if (*s2)
    return (*s2 == '/');
  return (1);
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <prefix+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1151 <prefix+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1184 <prefix+0x84>
jmp    110c <prefix+0xc>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     117d <prefix+0x7d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <prefix+0x84>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1127 <prefix+0x27>
lea    0x1(%rax),%rdx
cmp    (%rsi,%rax,1),%cl
mov    %rdx,%rax
je     1110 <prefix+0x10>
xor    %eax,%eax
ret
mov    (%rsi,%rax,1),%cl
test   %cl,%cl
je     1137 <prefix+0x37>
xor    %eax,%eax
cmp    $0x2f,%cl
sete   %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @prefix(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %10, %8 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %5
%12 = icmp eq i8 %6, %11
br i1 %12, label %3, label %19
13: ; preds = %3
%14 = load i8, i8* %5
%15 = icmp eq i8 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = icmp eq i8 %14, 47
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %8, %13, %16
%20 = phi i32 [ %18, %16 ], [ 1, %13 ], [ 0, %8 ]
ret i32 %20
}
/* Variables and functions */
int CompSystem_SetArraySize(void **, int, int, int);
int CompSystem_GrowArraySize(void **array, int elementSize, int size,
                             int delta) {
  return CompSystem_SetArraySize(array, elementSize, size, size + delta);
}


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

x86 assembly (clang, -O2):
<CompSystem_GrowArraySize>:
add    %edx,%ecx
jmp    1030 <CompSystem_SetArraySize@plt>

LLVM IR (-O0):
define i32 @CompSystem_GrowArraySize(i8** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8**, i8*** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = add nsw i32 %12, %13
%15 = call i32 @CompSystem_SetArraySize(i8** %9, i32 %10, i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @CompSystem_GrowArraySize(i8** %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %3, %2
%6 = tail call i32 @CompSystem_SetArraySize(i8** %0, i32 %1, i32 %2, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void diewitherror(char *data, int rcode, int sock) {
  fprintf(stderr, "%s\n", data);
  if (sock >= 0) {
    close(sock);
  }
  exit(rcode);
}


x86 assembly (clang, -O0):
<diewitherror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x0,-0x10(%rbp)
jl     116d <diewitherror+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<diewitherror>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1040 <fprintf@plt>
test   %ebp,%ebp
js     115a <diewitherror+0x2a>
mov    %ebp,%edi
call   1030 <close@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @diewitherror(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %6
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i32, i32* %6
%14 = call i32 @close(i32 %13)
br label %15
15: ; preds = %12, %3
%16 = load i32, i32* %5
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @diewitherror(i8* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = icmp sgt i32 %2, -1
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @close(i32 %2)
br label %9
9: ; preds = %7, %3
%10 = tail call i32 @exit(i32 %1)
unreachable
}