xunge/DecIR huggingface dataset:
int isMulop(char c) { return '*' == c || '/' == c; }


x86 assembly (clang, -O0):
<isMulop>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
mov    $0x1,%al
mov    $0x2a,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     1131 <isMulop+0x31>
movsbl -0x1(%rbp),%ecx
mov    $0x2f,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isMulop>:
cmp    $0x2a,%dil
sete   %al
cmp    $0x2f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isMulop(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 42, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 47, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isMulop(i8 signext %0) {
%2 = icmp eq i8 %0, 42
%3 = icmp eq i8 %0, 47
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void TIM0_OC1_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM0_OC1_IRQHandler() {
ret void
}
void time_to_ymd(unsigned long time, int *y, int *m, int *d) {
  int year = time / 360;
  int month = time - year * 360;
  int day = month % 30 + 1;
  month = month / 30 + 1;
  *y = year;
  *m = month;
  *d = day;
}


x86 assembly (clang, -O0):
<time_to_ymd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x168,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x168,-0x24(%rbp),%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_to_ymd>:
push   %rbx
mov    %rdx,%r8
movabs $0x2d82d82d82d82d83,%rdx
d8 82 2d
mov    %rdi,%rax
mul    %rdx
shr    $0x6,%rdx
movabs $0x16800000000,%rax
imul   %rdx,%rax
shr    $0x20,%rax
sub    %rax,%rdi
movslq %edi,%r9
imul   $0xffffffff88888889,%r9,%rdi
shr    $0x20,%rdi
add    %r9d,%edi
mov    %edi,%r10d
shr    $0x1f,%r10d
sar    $0x4,%edi
lea    (%rdi,%r10,1),%r11d
mov    %r11d,%eax
shl    $0x5,%eax
mov    %r11d,%ebx
sub    %eax,%ebx
add    %r11d,%ebx
lea    (%r9,%rbx,1),%eax
add    $0x1,%eax
lea    0x1(%rdi,%r10,1),%edi
mov    %edx,(%rsi)
mov    %edi,(%r8)
mov    %eax,(%rcx)
pop    %rbx
ret

LLVM IR (-O0):
define void @time_to_ymd(i64 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i64 %0, i64* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%12 = load i64, i64* %5
%13 = udiv i64 %12, 360
%14 = trunc i64 %13 to i32
store i32 %14, i32* %9
%15 = load i64, i64* %5
%16 = load i32, i32* %9
%17 = mul nsw i32 %16, 360
%18 = sext i32 %17 to i64
%19 = sub i64 %15, %18
%20 = trunc i64 %19 to i32
store i32 %20, i32* %10
%21 = load i32, i32* %10
%22 = srem i32 %21, 30
%23 = add nsw i32 %22, 1
store i32 %23, i32* %11
%24 = load i32, i32* %10
%25 = sdiv i32 %24, 30
%26 = add nsw i32 %25, 1
store i32 %26, i32* %10
%27 = load i32, i32* %9
%28 = load i32*, i32** %6
store i32 %27, i32* %28
%29 = load i32, i32* %10
%30 = load i32*, i32** %7
store i32 %29, i32* %30
%31 = load i32, i32* %11
%32 = load i32*, i32** %8
store i32 %31, i32* %32
ret void
}

LLVM IR (-O2):
define void @time_to_ymd(i64 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = udiv i64 %0, 360
%6 = trunc i64 %5 to i32
%7 = mul i64 %5, 1546188226560
%8 = lshr exact i64 %7, 32
%9 = sub i64 %0, %8
%10 = trunc i64 %9 to i32
%11 = srem i32 %10, 30
%12 = add nsw i32 %11, 1
%13 = sdiv i32 %10, 30
%14 = add nsw i32 %13, 1
store i32 %6, i32* %1
store i32 %14, i32* %2
store i32 %12, i32* %3
ret void
}
void ap91_pci_setup_wmac_led(int pin) {}


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

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

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

LLVM IR (-O2):
define void @ap91_pci_setup_wmac_led(i32 %0) {
ret void
}
int code() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @code() {
ret i32 0
}
int Operand_uimm6_rtoa(unsigned int *valp, unsigned int pc) {
  *valp += pc;
  return 0;
}


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

x86 assembly (clang, -O2):
<Operand_uimm6_rtoa>:
add    %esi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_uimm6_rtoa(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, %1
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ jwPutch(int /*<<< orphan*/);
void jwPutraw(char *str) {
  while (*str != '\0')
    jwPutch(*str++);
}


x86 assembly (clang, -O0):
<jwPutraw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <jwPutraw+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <jwPutch@plt>
jmp    111c <jwPutraw+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jwPutraw>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <jwPutraw+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <jwPutch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <jwPutraw+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @jwPutraw(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @jwPutch(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dwrite_ascfile(char const *, double const, double const,
                                  int const, double const *);
void dwrite_ascfile_c(const char *name, const double *t0, const double *dt,
                      const int *n, const double *data) {
  dwrite_ascfile(name, *t0, *dt, *n, data);
}


x86 assembly (clang, -O0):
<dwrite_ascfile_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rdx
call   1030 <dwrite_ascfile@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwrite_ascfile_c>:
movsd  (%rsi),%xmm0
movsd  (%rdx),%xmm1
mov    (%rcx),%esi
mov    %r8,%rdx
jmp    1030 <dwrite_ascfile@plt>

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

LLVM IR (-O2):
define void @dwrite_ascfile_c(i8* %0, double* nocapture %1, double* nocapture %2, i32* nocapture %3, double* %4) {
%6 = load double, double* %1
%7 = load double, double* %2
%8 = load i32, i32* %3
%9 = tail call i32 @dwrite_ascfile(i8* %0, double %6, double %7, i32 %8, double* %4)
ret void
}
void ccp_fid_msg() { ; }


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

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

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

LLVM IR (-O2):
define void @ccp_fid_msg() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ save_posns();
void sighandler(int signum) {
  save_posns();
  exit(0);
}


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

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
xor    %eax,%eax
call   1040 <save_posns@plt>
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @sighandler(i32 %0) {
%2 = tail call i32 (...) @save_posns()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char next_c(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
bool next_c_matches(FILE *scene_file, char c) {
  ((void)0);
  char d = next_c(scene_file);
  ungetc(d, scene_file);
  if (c == d)
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<next_c_matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <next_c@plt>
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <ungetc@plt>
movsbl -0x11(%rbp),%eax
movsbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jne    1169 <next_c_matches+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1170 <next_c_matches+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_c_matches>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <next_c@plt>
movsbl %al,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
xor    %eax,%eax
cmp    %r14b,%bpl
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @next_c_matches(i32* %0, i8 signext %1) {
%3 = tail call signext i8 @next_c(i32* %0)
%4 = tail call i32 @ungetc(i8 signext %3, i32* %0)
%5 = icmp eq i8 %3, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_load_pd1(double const *);
__m128d test_mm_load_pd1(double const *A) { return _mm_load_pd1(A); }


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

x86 assembly (clang, -O2):
<test_mm_load_pd1>:
jmp    1030 <_mm_load_pd1@plt>

LLVM IR (-O0):
define i32 @test_mm_load_pd1(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @_mm_load_pd1(double* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_mm_load_pd1(double* %0) {
%2 = tail call i32 @_mm_load_pd1(double* %0)
ret i32 %2
}
/* Variables and functions */
int _ctype();
int main(int argc, char *argv[]) {
  int ret = 0;
  (void)argc;
  ret |= _ctype();
  return (ret == 0) ? 0 : 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <_ctype@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <_ctype@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = call i32 (...) @_ctype()
%9 = load i32, i32* %6
%10 = or i32 %9, %8
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 2
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @_ctype()
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 0, i32 2
ret i32 %5
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(void *);
void rb_free(struct libavl_allocator *allocator, void *block) {
  assert(allocator != NULL && block != NULL);
  free(block);
}


x86 assembly (clang, -O0):
<rb_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <rb_free+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define void @rb_free(%struct.libavl_allocator* %0, i8* %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i8*
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i8* %1, i8** %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define void @rb_free(%struct.libavl_allocator* readnone %0, i8* %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
double exp(double);
void exp_on_vec(double *vec, int length) {
  int i;
  for (i = 0; i < length; i++)
    vec[i] = exp(vec[i]);
}


x86 assembly (clang, -O0):
<exp_on_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <exp_on_vec+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <exp@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <exp_on_vec+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_on_vec>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <exp_on_vec+0x3a>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <exp_on_vec+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @exp_on_vec(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call double @exp(double %9)
store double %10, double* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int comp_descend(const void *s1, const void *s2) {
  double *ss1, *ss2;
  ss1 = (double *)s1;
  ss2 = (double *)s2;
  if ((ss1)[0] > (ss2)[0]) {
    return -1;
  } else if ((ss1)[0] < (ss2)[0]) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<comp_descend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    113e <comp_descend+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <comp_descend+0x70>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1164 <comp_descend+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1170 <comp_descend+0x70>
jmp    1169 <comp_descend+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_descend>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comp_descend(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double*, double** %7
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = fcmp ogt double %14, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %31
20: ; preds = %2
%21 = load double*, double** %6
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = load double*, double** %7
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = fcmp olt double %23, %26
br i1 %27, label %28, label %29
28: ; preds = %20
store i32 1, i32* %3
br label %31
29: ; preds = %20
br label %30
30: ; preds = %29
store i32 0, i32* %3
br label %31
31: ; preds = %30, %28, %19
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @comp_descend(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = fcmp olt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int, unsigned long *, unsigned long);
int shim_set_mempolicy(int mode, unsigned long *nodemask,
                       unsigned long maxnode) {
  return shim_enosys(0, mode, nodemask, maxnode);
}


x86 assembly (clang, -O0):
<shim_set_mempolicy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_set_mempolicy>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_set_mempolicy(i32 %0, i64* %1, i64 %2) {
%4 = tail call i32 @shim_enosys(i32 0, i32 %0, i64* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int test = 1234;
  char result[100];
  itoa(test, result);
  printf("%s\n", result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    $0x4d2,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 1234, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_is_socket_unix(int fd, int type,
                                                             int listening,
                                                             const char *path,
                                                             size_t length) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_is_socket_unix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
xor    %eax,%eax
mov    0x2ec2(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_is_socket_unix>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_is_socket_unix(i32 %0, i32 %1, i32 %2, i8* %3, i64 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_is_socket_unix(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3, i64 %4) {
%6 = load i32, i32* @EINVAL
%7 = sub nsw i32 0, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int sarwaitbar_close(void) {
  printf("\r100.000000\n");
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<sarwaitbar_close>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sarwaitbar_close>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"\0D100.000000\0A\00"
@stdout = global i32 0
define i32 @sarwaitbar_close() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [12 x i8] c"\0D100.000000\00"
define i32 @sarwaitbar_close() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret i32 0
}
void let_parking() {}


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

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

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

LLVM IR (-O2):
define void @let_parking() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
char *strdup(char *);
char *appaserver_link_source_directory(char *document_root_directory,
                                       char *application_name) {
  char source_directory[128];
  sprintf(source_directory, "%s/%s/%s/data", document_root_directory,
          "appaserver", application_name);
  return strdup(source_directory);
}


x86 assembly (clang, -O0):
<appaserver_link_source_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xeb7(%rip),%rsi
lea    0xebe(%rip),%rcx
call   1030 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_link_source_directory>:
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r8
mov    %rdi,%rdx
lea    0xecb(%rip),%rsi
lea    0xed2(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s/%s/%s/data\00"
@.str.1 = [11 x i8] c"appaserver\00"
define i8* @appaserver_link_source_directory(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i8* @strdup(i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s/%s/%s/data\00"
@.str.1 = [11 x i8] c"appaserver\00"
define noalias i8* @appaserver_link_source_directory(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%6 = call i8* @strdup(i8* %4)
ret i8* %6
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void writeMessageInSharedVariable(char *dest, char *message) {
  printf("El proceso P2 (PID=%d, Ej2) transmite un mensaje al proceso P3 a "
         "traves de una variable en memoria compartida\n",
         getpid());
  strncpy(dest, message, 1024 * 4);
  dest[1024 * 4 - 1] = '\0';
}


x86 assembly (clang, -O0):
<writeMessageInSharedVariable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1000,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,0xfff(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeMessageInSharedVariable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1000,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xfff(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [111 x i8] c"El proceso P2 (PID=%d, Ej2) transmite un mensaje al proceso P3 a traves de una variable en memoria compartida\0A\00"
define void @writeMessageInSharedVariable(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @strncpy(i8* %7, i8* %8, i32 4096)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 4095
store i8 0, i8* %11
ret void
}

LLVM IR (-O2):
@.str = [111 x i8] c"El proceso P2 (PID=%d, Ej2) transmite un mensaje al proceso P3 a traves de una variable en memoria compartida\0A\00"
define void @writeMessageInSharedVariable(i8* %0, i8* %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @strncpy(i8* %0, i8* %1, i32 4096)
%6 = getelementptr inbounds i8, i8* %0, i64 4095
store i8 0, i8* %6
ret void
}
void dbg_time_start(int type) {}


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

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

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

LLVM IR (-O2):
define void @dbg_time_start(i32 %0) {
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("Hello world from process ID: %d\n", getpid());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Hello world from process ID: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getpid()
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Hello world from process ID: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int VecEqual3iv(const int a[3], const int b[3]) {
  return (a[0] == b[0] && a[1] == b[1] && a[2] == b[2]);
}


x86 assembly (clang, -O0):
<VecEqual3iv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    (%rdx),%ecx
mov    %al,-0x11(%rbp)
jne    1150 <VecEqual3iv+0x50>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    0x4(%rdx),%ecx
mov    %al,-0x11(%rbp)
jne    1150 <VecEqual3iv+0x50>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    0x8(%rcx),%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecEqual3iv>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
jne    111b <VecEqual3iv+0x1b>
mov    0x4(%rdi),%ecx
cmp    0x4(%rsi),%ecx
jne    111b <VecEqual3iv+0x1b>
mov    0x8(%rdi),%ecx
xor    %eax,%eax
cmp    0x8(%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @VecEqual3iv(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
br i1 %11, label %12, label %28
12: ; preds = %2
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = icmp eq i32 %15, %18
br i1 %19, label %20, label %28
20: ; preds = %12
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 2
%26 = load i32, i32* %25
%27 = icmp eq i32 %23, %26
br label %28
28: ; preds = %20, %12, %2
%29 = phi i1 [ false, %12 ], [ false, %2 ], [ %27, %20 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @VecEqual3iv(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %19
6: ; preds = %2
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = icmp eq i32 %8, %10
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = getelementptr inbounds i32, i32* %1, i64 2
%16 = load i32, i32* %15
%17 = icmp eq i32 %14, %16
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %12, %6, %2
%20 = phi i32 [ 0, %6 ], [ 0, %2 ], [ %18, %12 ]
ret i32 %20
}
const char *Iter_Description(void) {
  return "The `Iter` class is implemented by types which can be looped over. "
         "This "
         "allows them to be used in conjunction with the `foreach` macro as "
         "well "
         "as various other components of Cello."
         "\n\n"
         "To signal that an interation has finished an iteration should return "
         "the "
         "Cello object `Terminal`. Due to this - the `Terminal` object cannot "
         "be "
         "placed inside of Tuples because it artificially shortens their "
         "length.";
}


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

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

LLVM IR (-O0):
@.str = [397 x i8] c"The `Iter` class is implemented by types which can be looped over. This allows them to be used in conjunction with the `foreach` macro as well as various other components of Cello.\0A\0ATo signal that an interation has finished an iteration should return the Cello object `Terminal`. Due to this - the `Terminal` object cannot be placed inside of Tuples because it artificially shortens their length.\00"
define i8* @Iter_Description() {
ret i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [397 x i8] c"The `Iter` class is implemented by types which can be looped over. This allows them to be used in conjunction with the `foreach` macro as well as various other components of Cello.\0A\0ATo signal that an interation has finished an iteration should return the Cello object `Terminal`. Due to this - the `Terminal` object cannot be placed inside of Tuples because it artificially shortens their length.\00"
define i8* @Iter_Description() {
ret i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str, i64 0, i64 0)
}
int cmp(const void *pa, const void *pb) {
  int a = *(int *)pa;
  int b = *(int *)pb;
  if (a < b) {
    return -1;
  } else if (a == b) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <cmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <cmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <cmp+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <cmp+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
char f_char(void) { return 128; }


x86 assembly (clang, -O0):
<f_char>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_char>:
mov    $0x80,%al
ret

LLVM IR (-O0):
define signext i8 @f_char() {
ret i8 -128
}

LLVM IR (-O2):
define signext i8 @f_char() {
ret i8 -128
}
/* Type definitions */
struct sock {
  int dummy;
};

/* Variables and functions */
void *kmalloc(int, int);
void *kmalloc_helperin(struct sock *sk, int len) {
  return kmalloc(len, (0x20 | 0x10 | 0x40 | 0x80 | 0x100));
}


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

x86 assembly (clang, -O2):
<kmalloc_helperin>:
mov    %esi,%edi
mov    $0x1f0,%esi
jmp    1030 <kmalloc@plt>

LLVM IR (-O0):
%struct.sock = type { i32 }
define i8* @kmalloc_helperin(%struct.sock* %0, i32 %1) {
%3 = alloca %struct.sock*
%4 = alloca i32
store %struct.sock* %0, %struct.sock** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i8* @kmalloc(i32 %5, i32 496)
ret i8* %6
}

LLVM IR (-O2):
%struct.sock = type { i32 }
define i8* @kmalloc_helperin(%struct.sock* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @kmalloc(i32 %1, i32 496)
ret i8* %3
}
void INT_Excep_SCI2_TEI2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI2_TEI2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void string_1(void) {
  char text[] = "Going! Going! Gone!";
  char *t;
  t = text;
  puts(t);
}


x86 assembly (clang, -O0):
<string_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_1>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x21656e,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <puts@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.string_1.text = [20 x i8] c"Going! Going! Gone!\00"
define void @string_1() {
%1 = alloca [20 x i8]
%2 = alloca i8*
%3 = bitcast [20 x i8]* %1 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @puts(i8* %5)
ret void
}

LLVM IR (-O2):
@__const.string_1.text = [20 x i8] c"Going! Going! Gone!\00"
define void @string_1() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
ret void
}
/* Variables and functions */
char *my_strdup(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *s = "Hello Friend!";
  char *ns = my_strdup(s);
  printf("s = %s\n", s);
  printf("s = %s\n", ns);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <my_strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xed4(%rip),%r14
mov    %r14,%rdi
call   1040 <my_strdup@plt>
mov    %rax,%rbx
lea    0xed0(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello Friend!\00"
@.str.1 = [8 x i8] c"s = %s\0A\00"
define i32 @main() {
%1 = tail call i8* @my_strdup(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
unsigned int s5p_gpio_part_max(int nr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @s5p_gpio_part_max(i32 %0) {
ret i32 0
}
void ECDSA_get_ex_data(void) {}


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

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

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

LLVM IR (-O2):
define void @ECDSA_get_ex_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void global(char *var) { printf("\tglobal %s; vfix %s\n", var, var); }


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"\09global %s; vfix %s\0A\00"
define void @global(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int mode;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
void set_XLeaveWindowEvent_mode(void *_p, int _v) {
  ((XLeaveWindowEvent *)_p)->mode = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XLeaveWindowEvent_mode>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XLeaveWindowEvent_mode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XLeaveWindowEvent_mode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}