xunge/DecIR huggingface dataset:
void destruye_matriz(double **m, int filas, int columnas) {
  int i;
  for (i = 0; i < columnas; i++)
    free(m[i]);
  free(m);
}


x86 assembly (clang, -O0):
<destruye_matriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1154 <destruye_matriz+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <destruye_matriz+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destruye_matriz>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %edx,%edx
jle    1142 <destruye_matriz+0x32>
mov    %edx,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <destruye_matriz+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destruye_matriz(double** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds double*, double** %0, i64 %8
%10 = bitcast double** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = bitcast double** %0 to i8*
tail call void @free(i8* %15)
ret void
}
/* Variables and functions */
unsigned int hash_mem(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
unsigned int hash_string(const char *value) {
  return hash_mem(value, strlen(value));
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <hash_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <hash_mem@plt>

LLVM IR (-O0):
define i32 @hash_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @hash_mem(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @hash_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @hash_mem(i8* %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int ssl_prepare_serverhello_tlsext(SSL *s) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ssl_prepare_serverhello_tlsext(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main() { exit(5); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @exit(i32 5)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 5)
unreachable
}
double no_crash_reinterpret_double_as_ptr(double a) {
  *(void **)&a = 0;
  return a * a;
}


x86 assembly (clang, -O0):
<no_crash_reinterpret_double_as_ptr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movq   $0x0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_crash_reinterpret_double_as_ptr>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @no_crash_reinterpret_double_as_ptr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = bitcast double* %2 to i8**
store i8* null, i8** %3
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @no_crash_reinterpret_double_as_ptr(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\nusage: pdp11dasm [options] file\n\n"
         "'file' is the PDP-11 binary file to disassemble.\n"
         "Output will be written to 'file.das'.\n"
         "Options:\n"
         "  -v --version   Show version and exit.\n"
         "  -h --help      Display this message and exit.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [220 x i8] c"\0Ausage: pdp11dasm [options] file\0A\0A'file' is the PDP-11 binary file to disassemble.\0AOutput will be written to 'file.das'.\0AOptions:\0A -v --version Show version and exit.\0A -h --help Display this message and exit.\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([220 x i8], [220 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [219 x i8] c"\0Ausage: pdp11dasm [options] file\0A\0A'file' is the PDP-11 binary file to disassemble.\0AOutput will be written to 'file.das'.\0AOptions:\0A -v --version Show version and exit.\0A -h --help Display this message and exit.\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([219 x i8], [219 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ globalFree();
void clean_all(int sig) {
  globalFree();
  exit(5);
}


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

x86 assembly (clang, -O2):
<clean_all>:
push   %rax
xor    %eax,%eax
call   1030 <globalFree@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @clean_all(i32 %0) {
%2 = tail call i32 (...) @globalFree()
%3 = tail call i32 @exit(i32 5)
unreachable
}
int op_add(int arg1, int arg2) { return (arg1 + arg2); }


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

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

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

LLVM IR (-O2):
define i32 @op_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
char tolower(unsigned char);
void string_lower(char string[]) {
  int const length = strlen(string);
  int i;
  for (i = 0; i != length; ++i) {
    string[i] = tolower((unsigned char)string[i]);
  }
}


x86 assembly (clang, -O0):
<string_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1177 <string_lower+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <string_lower+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_lower>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
je     1157 <string_lower+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <string_lower+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @string_lower(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @tolower(i8 zeroext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
int test_imm_82uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x82 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_82uint64_highword_mem>:
testb  $0x82,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_82uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 558345748480
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ delay_ms(int);
int /*<<< orphan*/ loop(int, int);
int main() {
  loop(573, 158);
  delay_ms(1000);
  loop(500, 291);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23d,%edi
mov    $0x9e,%esi
call   1030 <loop@plt>
mov    $0x3e8,%edi
call   1040 <delay_ms@plt>
mov    $0x1f4,%edi
mov    $0x123,%esi
call   1030 <loop@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x23d,%edi
mov    $0x9e,%esi
call   1030 <loop@plt>
mov    $0x3e8,%edi
call   1040 <delay_ms@plt>
mov    $0x1f4,%edi
mov    $0x123,%esi
call   1030 <loop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @loop(i32 573, i32 158)
%2 = call i32 @delay_ms(i32 1000)
%3 = call i32 @loop(i32 500, i32 291)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @loop(i32 573, i32 158)
%2 = tail call i32 @delay_ms(i32 1000)
%3 = tail call i32 @loop(i32 500, i32 291)
ret i32 0
}
char *PlatformName() { return "Unix"; }


x86 assembly (clang, -O0):
<PlatformName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PlatformName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Unix\00"
define i8* @PlatformName() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"Unix\00"
define i8* @PlatformName() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ test_rtc_all();
void main() { test_rtc_all(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @test_rtc_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void BUG(const char *msg) {
  printf("%s", msg);
  fflush(stdout);
  while (1)
    sleep(100);
}


x86 assembly (clang, -O0):
<BUG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x64,%edi
call   1050 <sleep@plt>
jmp    115a <BUG+0x2a>

x86 assembly (clang, -O2):
<BUG>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xchg   %ax,%ax
mov    $0x64,%edi
call   1050 <sleep@plt>
jmp    1150 <BUG+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
define void @BUG(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
br label %7
7: ; preds = %1, %7
%8 = call i32 @sleep(i32 100)
br label %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
define void @BUG(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
br label %5
5: ; preds = %1, %5
%6 = tail call i32 @sleep(i32 100)
br label %5
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ stat(char const *, struct stat *);
off_t get_file_size(const char *f) {
  struct stat st[1];
  assert(stat(f, st) == 0);
  return st->st_size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_file_size(i8* %0) {
%2 = alloca i8*
%3 = alloca [1 x %struct.stat]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [1 x %struct.stat], [1 x %struct.stat]* %3, i64 0, i64 0
%6 = call i64 @stat(i8* %4, %struct.stat* %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = getelementptr inbounds [1 x %struct.stat], [1 x %struct.stat]* %3, i64 0, i64 0
%11 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i8* %0) {
%2 = alloca [1 x %struct.stat]
%3 = bitcast [1 x %struct.stat]* %2 to i8*
%4 = getelementptr inbounds [1 x %struct.stat], [1 x %struct.stat]* %2, i64 0, i64 0
%5 = call i64 @stat(i8* %0, %struct.stat* %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds [1 x %struct.stat], [1 x %struct.stat]* %2, i64 0, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
void gtk_layout_move() {}


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

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

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

LLVM IR (-O2):
define void @gtk_layout_move() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_quaddobl_target_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(261, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_target_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x105,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_target_system_to_container>:
mov    $0x105,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_target_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 261, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_target_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 261, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ erroFatalMemoria();
void *malloc(size_t);
void *xmalloc(size_t t) {
  void *p = malloc(t);
  if (!p)
    erroFatalMemoria();
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <erroFatalMemoria@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xmalloc+0x15>
xor    %eax,%eax
call   1030 <erroFatalMemoria@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @erroFatalMemoria()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @erroFatalMemoria()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
__attribute__((noipa)) void foo() { foo(); }


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

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

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

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
char *_trim(char *, char const *, int);
char *ltrim_chars(char *str, const char *rem) { return _trim(str, rem, 1); }


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

x86 assembly (clang, -O2):
<ltrim_chars>:
mov    $0x1,%edx
jmp    1030 <_trim@plt>

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

LLVM IR (-O2):
define i8* @ltrim_chars(i8* %0, i8* %1) {
%3 = tail call i8* @_trim(i8* %0, i8* %1, i32 1)
ret i8* %3
}
int test_imm_ACint8_mem(signed char *val) {
  return ((*val) & (-0xAC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ACint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff54,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ACint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff54,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ACint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -172
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
char *upperstring(s)
char *s;
{
  char *ss = s;
  while (*s) {
    if (islower(*s))
      *s = toupper(*s);
    s++;
  }
  return (ss);
}


x86 assembly (clang, -O0):
<upperstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     117b <upperstring+0x5b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     116a <upperstring+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <upperstring+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upperstring>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1165 <upperstring+0x45>
lea    0x1(%r14),%rbx
jmp    114b <upperstring+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <upperstring+0x45>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     1140 <upperstring+0x20>
mov    %ebp,%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <upperstring+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @upperstring(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @islower(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @toupper(i32 %7)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
br label %13
13: ; preds = %10, %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret i8* %0
}
__attribute__((always_)) int rt_prio(int prio) {
  if (__builtin_expect(!!(prio < 100), 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<rt_prio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
setl   %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     112f <rt_prio+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <rt_prio+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_prio>:
xor    %eax,%eax
cmp    $0x64,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @rt_prio(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 100
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @rt_prio(i32 %0) {
%2 = icmp slt i32 %0, 100
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(char const *prg) {
  fprintf(stderr, "usage: %s [-h] [-o] [-s <size of pipe>]\n", prg);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"usage: %s [-h] [-o] [-s <size of pipe>]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"usage: %s [-h] [-o] [-s <size of pipe>]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  while (1) {
    printf("wait for login\n");
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [16 x i8] c"wait for login\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@str = [15 x i8] c"wait for login\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ test34_TestMod_test__E();
void test34_TestProg_pollen__run__E() { test34_TestMod_test__E(); }


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

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

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

LLVM IR (-O2):
define void @test34_TestProg_pollen__run__E() {
%1 = tail call i32 (...) @test34_TestMod_test__E()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int main() {
  char a, *b, *c;
  b = &a - 2;
  c = &a + 2;
  printf("&a = \t %p \n&a - 2 = %p \n&a + 2 = %p\n", &a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x5(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x10(%rbp)
lea    -0x5(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeba(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x5(%rsp),%rdx
lea    0x9(%rsp),%rcx
lea    0xede(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [37 x i8] c"&a = \09 %p \0A&a - 2 = %p \0A&a + 2 = %p\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = getelementptr inbounds i8, i8* %1, i64 -2
%3 = getelementptr inbounds i8, i8* %1, i64 2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret i32 0
}
/* Type definitions */
struct VectorBase {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FreeVectorBase(struct VectorBase *);
void free_basev(struct VectorBase *basev) { FreeVectorBase(basev); }


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

x86 assembly (clang, -O2):
<free_basev>:
jmp    1030 <FreeVectorBase@plt>

LLVM IR (-O0):
%struct.VectorBase = type { i32 }
define void @free_basev(%struct.VectorBase* %0) {
%2 = alloca %struct.VectorBase*
store %struct.VectorBase* %0, %struct.VectorBase** %2
%3 = load %struct.VectorBase*, %struct.VectorBase** %2
%4 = call i32 @FreeVectorBase(%struct.VectorBase* %3)
ret void
}

LLVM IR (-O2):
%struct.VectorBase = type { i32 }
define void @free_basev(%struct.VectorBase* %0) {
%2 = tail call i32 @FreeVectorBase(%struct.VectorBase* %0)
ret void
}
int parse_surrogate(int start, int end) {
  return (((start - 0xD800) << 10) + (end - 0xDC00) + 0x0010000);
}


x86 assembly (clang, -O0):
<parse_surrogate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xd800,%eax
shl    $0xa,%eax
mov    -0x8(%rbp),%ecx
sub    $0xdc00,%ecx
add    %ecx,%eax
add    $0x10000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_surrogate>:
shl    $0xa,%edi
lea    (%rsi,%rdi,1),%eax
add    $0xfca02400,%eax
ret

LLVM IR (-O0):
define i32 @parse_surrogate(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 = sub nsw i32 %5, 55296
%7 = shl i32 %6, 10
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 56320
%10 = add nsw i32 %7, %9
%11 = add nsw i32 %10, 65536
ret i32 %11
}

LLVM IR (-O2):
define i32 @parse_surrogate(i32 %0, i32 %1) {
%3 = shl i32 %0, 10
%4 = add i32 %1, -56613888
%5 = add i32 %4, %3
ret i32 %5
}
int GetResolvedType(int action) { return action & 0xF; }


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

x86 assembly (clang, -O2):
<GetResolvedType>:
mov    %edi,%eax
and    $0xf,%eax
ret

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

LLVM IR (-O2):
define i32 @GetResolvedType(i32 %0) {
%2 = and i32 %0, 15
ret i32 %2
}
void foo(int x) { return; }


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

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

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

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_error_not_enough_mem() { printf("Error: not enough memory.\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Error: not enough memory.\0A\00"
define void @msg_error_not_enough_mem() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Error: not enough memory.\00"
define void @msg_error_not_enough_mem() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
void X509_NAME_print_ex_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_print_ex_fp() {
ret void
}
/* Variables and functions */
int rand();
int get_color() { return (rand() % 7) + 1; }


x86 assembly (clang, -O0):
<get_color>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_color>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_color() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 7
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_color() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 7
%3 = add nsw i32 %2, 1
ret i32 %3
}
void GSK_DO_NOTHING(void *arg0, ...) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XmbTextItem(void *_p) {
  if (_p == NULL)
    abort();
  free((XmbTextItem *)_p);
}


x86 assembly (clang, -O0):
<free_XmbTextItem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XmbTextItem+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XmbTextItem>:
test   %rdi,%rdi
je     112a <free_XmbTextItem+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XmbTextItem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XmbTextItem(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
};

/* Variables and functions */
int sin_addr_eq(struct sockaddr_in *a, struct sockaddr_in *b) {
  return a->sin_addr.s_addr == b->sin_addr.s_addr;
}


x86 assembly (clang, -O0):
<sin_addr_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_addr_eq>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
define i32 @sin_addr_eq(%struct.sockaddr_in* %0, %struct.sockaddr_in* %1) {
%3 = alloca %struct.sockaddr_in*
%4 = alloca %struct.sockaddr_in*
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
%5 = load %struct.sockaddr_in*, %struct.sockaddr_in** %3
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 0
%7 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = icmp eq i64 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
define i32 @sin_addr_eq(%struct.sockaddr_in* nocapture %0, %struct.sockaddr_in* nocapture %1) {
%3 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0, i32 0
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ HDMITX_WriteI2C_Byte(int, int);
void DisableVideoOutput(void) {
  HDMITX_WriteI2C_Byte(0x04, (1 << 3) | (1 << 2) | (1 << 4) | (1 << 0));
  HDMITX_WriteI2C_Byte(0x61, (1 << 5) | (1 << 6));
}


x86 assembly (clang, -O0):
<DisableVideoOutput>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x1d,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x61,%edi
mov    $0x60,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisableVideoOutput>:
push   %rax
mov    $0x4,%edi
mov    $0x1d,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x61,%edi
mov    $0x60,%esi
pop    %rax
jmp    1030 <HDMITX_WriteI2C_Byte@plt>

LLVM IR (-O0):
define void @DisableVideoOutput() {
%1 = call i32 @HDMITX_WriteI2C_Byte(i32 4, i32 29)
%2 = call i32 @HDMITX_WriteI2C_Byte(i32 97, i32 96)
ret void
}

LLVM IR (-O2):
define void @DisableVideoOutput() {
%1 = tail call i32 @HDMITX_WriteI2C_Byte(i32 4, i32 29)
%2 = tail call i32 @HDMITX_WriteI2C_Byte(i32 97, i32 96)
ret void
}
yyErr(n, l) { yyAbort(n, "verbose", l); }


x86 assembly (clang, -O0):
<yyErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <yyAbort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyErr>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <yyAbort@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"verbose\00"
define i32 @yyErr(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @yyAbort to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void yy_fatal_error(const char msg[]) {
  (void)fprintf(stderr, "%s\n", msg);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yy_fatal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct clad_sb {
  int dummy;
};

/* Variables and functions */
int clad_sb_cat_buf(struct clad_sb *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int clad_sb_cat_cstr(struct clad_sb *me, char *str) {
  return clad_sb_cat_buf(me, str, strlen(str));
}


x86 assembly (clang, -O0):
<clad_sb_cat_cstr>:
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 <clad_sb_cat_buf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_sb_cat_cstr>:
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 <clad_sb_cat_buf@plt>

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

LLVM IR (-O2):
%struct.clad_sb = type { i32 }
define i32 @clad_sb_cat_cstr(%struct.clad_sb* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @clad_sb_cat_buf(%struct.clad_sb* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ compute_moments(double *, int);
void blob_moments(double *res, int np) { compute_moments(res, np); }


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

x86 assembly (clang, -O2):
<blob_moments>:
jmp    1030 <compute_moments@plt>

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

LLVM IR (-O2):
define void @blob_moments(double* %0, i32 %1) {
%3 = tail call i32 @compute_moments(double* %0, i32 %1)
ret void
}
int *check_ptr_ATTRint(int *v) { return v; }


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

x86 assembly (clang, -O2):
<check_ptr_ATTRint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32* @check_ptr_ATTRint(i32* readnone returned %0) {
ret i32* %0
}
void testClosureDDrV(void (*closure)(double, double), double a1, double a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureDDrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureDDrV>:
jmp    *%rdi

LLVM IR (-O0):
define void @testClosureDDrV(void (double, double)* %0, double %1, double %2) {
%4 = alloca void (double, double)*
%5 = alloca double
%6 = alloca double
store void (double, double)* %0, void (double, double)** %4
store double %1, double* %5
store double %2, double* %6
%7 = load void (double, double)*, void (double, double)** %4
%8 = load double, double* %5
%9 = load double, double* %6
ret void
}

LLVM IR (-O2):
define void @testClosureDDrV(void (double, double)* nocapture %0, double %1, double %2) {
tail call void %0(double %1, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
int msx_is_mosix() { return (!access("/proc/mosix/", 0)); }


x86 assembly (clang, -O0):
<msx_is_mosix>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
call   1030 <access@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msx_is_mosix>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/proc/mosix/\00"
define i32 @msx_is_mosix() {
%1 = call i32 @access(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"/proc/mosix/\00"
define i32 @msx_is_mosix() {
%1 = tail call i32 @access(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}