xunge/DecIR huggingface dataset:
int swap(int *x, int *y) {
  int temp = *x;
  *x = *y;
  *y = temp;
}


x86 assembly (clang, -O0):
<swap>:
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),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 undef
}
int arm_cannot_store_register(int regno) { return (regno >= 26); }


x86 assembly (clang, -O0):
<arm_cannot_store_register>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1a,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_cannot_store_register>:
xor    %eax,%eax
cmp    $0x1a,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @arm_cannot_store_register(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @arm_cannot_store_register(i32 %0) {
%2 = icmp sgt i32 %0, 25
%3 = zext i1 %2 to i32
ret i32 %3
}
void *_Locale_monetary_create(const char *__DUMMY_PAR,
                              struct _Locale_name_hint *hint) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_name_hint = type opaque
define i8* @_Locale_monetary_create(i8* %0, %struct._Locale_name_hint* %1) {
%3 = alloca i8*
%4 = alloca %struct._Locale_name_hint*
store i8* %0, i8** %3
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %4
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type opaque
define noalias i8* @_Locale_monetary_create(i8* nocapture readnone %0, %struct._Locale_name_hint* nocapture readnone %1) {
ret i8* null
}
int ti_wilders_start(double const *options) { return (int)options[0] - 1; }


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

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

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

LLVM IR (-O2):
define i32 @ti_wilders_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
int get_bit(void *p, int i) {
  char *tab = (char *)p;
  char octet = *(tab + i / 8);
  return (octet >> i % 8) & 1;
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%eax
mov    %edx,%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
movsbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 8
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
store i8 %13, i8* %6
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = load i32, i32* %4
%17 = srem i32 %16, 8
%18 = ashr i32 %15, %17
%19 = and i32 %18, 1
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_bit(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %1, 7
%9 = lshr i32 %7, %8
%10 = and i32 %9, 1
ret i32 %10
}
void omap_vrfb_restore_context(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_vrfb_restore_context() {
ret void
}
int main() {
  int a;
  int b;
  int c;
  c = 5;
  a = 5;
  b = 5;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void VERBOSE_PRINT(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @VERBOSE_PRINT(i8* nocapture %0, ...) {
ret void
}
void workshare_enter() { ("workshare_enter"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"workshare_enter\00"
define void @workshare_enter() {
ret void
}

LLVM IR (-O2):
define void @workshare_enter() {
ret void
}
int ismonotonic(double val[], int ix) {
  int counter = ix - 1, output = 1;
  while (counter) {
    counter--;
    if (val[counter] - val[counter + 1] > 0) {
      counter = 0;
      output = 0;
    }
  }
  return output;
}


x86 assembly (clang, -O0):
<ismonotonic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     116d <ismonotonic+0x6d>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1168 <ismonotonic+0x68>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    111b <ismonotonic+0x1b>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ismonotonic>:
add    $0xffffffff,%esi
movslq %esi,%rcx
mov    $0x1,%eax
xorpd  %xmm0,%xmm0
mov    %rcx,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
sub    $0x1,%rdx
jb     113f <ismonotonic+0x3f>
movsd  (%rdi,%rdx,8),%xmm1
subsd  (%rdi,%rcx,8),%xmm1
ucomisd %xmm0,%xmm1
mov    %rdx,%rcx
jbe    1120 <ismonotonic+0x20>
xor    %ecx,%ecx
xor    %eax,%eax
jmp    110f <ismonotonic+0xf>
ret

LLVM IR (-O0):
define i32 @ismonotonic(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
store i32 1, i32* %6
br label %9
9: ; preds = %29, %2
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %30
12: ; preds = %9
%13 = load i32, i32* %5
%14 = add nsw i32 %13, -1
store i32 %14, i32* %5
%15 = load double*, double** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = load double*, double** %3
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %20, i64 %23
%25 = load double, double* %24
%26 = fsub double %19, %25
%27 = fcmp ogt double %26, 0.000000e+00
br i1 %27, label %28, label %29
28: ; preds = %12
store i32 0, i32* %5
store i32 0, i32* %6
br label %29
29: ; preds = %28, %12
br label %9
30: ; preds = %9
%31 = load i32, i32* %6
ret i32 %31
}

LLVM IR (-O2):
define i32 @ismonotonic(double* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
br label %5
5: ; preds = %11, %2
%6 = phi i64 [ %4, %2 ], [ 0, %11 ]
%7 = phi i32 [ 1, %2 ], [ 0, %11 ]
br label %8
8: ; preds = %5, %11
%9 = phi i64 [ %6, %5 ], [ %12, %11 ]
%10 = icmp eq i64 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8
%12 = add nsw i64 %9, -1
%13 = getelementptr inbounds double, double* %0, i64 %12
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %0, i64 %9
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = fcmp ogt double %17, 0.000000e+00
br i1 %18, label %5, label %8
19: ; preds = %8
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ HM_ASSERT(int);
int stbi__bitreverse16(int);
int stbi__bit_reverse(int v, int bits) {
  HM_ASSERT(bits <= 16);
  return stbi__bitreverse16(v) >> (16 - bits);
}


x86 assembly (clang, -O0):
<stbi__bit_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <HM_ASSERT@plt>
mov    -0x4(%rbp),%edi
call   1030 <stbi__bitreverse16@plt>
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__bit_reverse>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x11,%esi
setl   %dil
call   1040 <HM_ASSERT@plt>
mov    %ebp,%edi
call   1030 <stbi__bitreverse16@plt>
mov    $0x10,%cl
sub    %bl,%cl
sar    %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @stbi__bit_reverse(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 = icmp sle i32 %5, 16
%7 = zext i1 %6 to i32
%8 = call i32 @HM_ASSERT(i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @stbi__bitreverse16(i32 %9)
%11 = load i32, i32* %4
%12 = sub nsw i32 16, %11
%13 = ashr i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @stbi__bit_reverse(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 17
%4 = zext i1 %3 to i32
%5 = tail call i32 @HM_ASSERT(i32 %4)
%6 = tail call i32 @stbi__bitreverse16(i32 %0)
%7 = sub nsw i32 16, %1
%8 = ashr i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
char *grid_strerror(int);
int /*<<< orphan*/ stderr;
void grid_assert_errno(int flag, char *description) {
  int err;
  if (!flag) {
    err = errno;
    fprintf(stderr, "%s: %s\n", description, grid_strerror(err));
    exit(3);
  }
}


x86 assembly (clang, -O0):
<grid_assert_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1191 <grid_assert_errno+0x61>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <grid_strerror@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
lea    0xe7e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_assert_errno>:
test   %edi,%edi
je     1135 <grid_assert_errno+0x5>
ret
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    0x2e95(%rip),%rax
mov    (%rax),%ebp
call   1050 <grid_strerror@plt>
lea    0xea7(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @grid_assert_errno(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @errno
%6 = load i32, i32* @stderr
%7 = tail call i8* @grid_strerror(i32 %5)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %7)
%9 = tail call i32 @exit(i32 3)
unreachable
10: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glk_exit();
int /*<<< orphan*/ gln_fatal(char *);
void *realloc(void *, size_t);
void *gln_realloc(void *ptr, size_t size) {
  void *pointer;
  pointer = realloc(ptr, size);
  if (!pointer) {
    gln_fatal("GLK: Out of system memory");
    glk_exit();
  }
  return pointer;
}


x86 assembly (clang, -O0):
<gln_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <gln_realloc+0x3f>
lea    0xe9d(%rip),%rdi
call   1030 <gln_fatal@plt>
mov    $0x0,%al
call   1050 <glk_exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gln_realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1151 <gln_realloc+0x21>
lea    0xebb(%rip),%rdi
call   1030 <gln_fatal@plt>
xor    %eax,%eax
call   1050 <glk_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"GLK: Out of system memory\00"
define i8* @gln_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i32 @gln_fatal(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @glk_exit()
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [26 x i8] c"GLK: Out of system memory\00"
define noalias i8* @gln_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @gln_fatal(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @glk_exit()
br label %8
8: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ yyunput(int /*<<< orphan*/, char *);
int c_wrap(void) {
  {
    if (0) {
      yyunput(0, "");
    }
  }
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @c_wrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @c_wrap() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  while (1) {
    sleep(1);
    printf("waiting...");
    fflush(stdout);
  }
  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    $0x1,%edi
call   1050 <sleep@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
mov    0x2e9e(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [11 x i8] c"waiting...\00"
@stdout = global i32 0
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
br label %6
6: ; preds = %2, %6
%7 = call i32 @sleep(i32 1)
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
br label %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"waiting...\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
br label %3
}
/* Variables and functions */
unsigned long long __builtin_pextd(unsigned long long, unsigned long long);
unsigned long long int do_pextd(unsigned long long int source,
                                unsigned long long int mask) {
  return __builtin_pextd(source, mask);
}


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

x86 assembly (clang, -O2):
<do_pextd>:
jmp    1030 <__builtin_pextd@plt>

LLVM IR (-O0):
define i64 @do_pextd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @__builtin_pextd(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @do_pextd(i64 %0, i64 %1) {
%3 = tail call i64 @__builtin_pextd(i64 %0, i64 %1)
ret i64 %3
}
/* Type definitions */
struct _Unwind_Exception {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
__pnacl_eh_sjlj_cxa_call_unexpected(struct _Unwind_Exception *);
void __cxa_call_unexpected(struct _Unwind_Exception *exc) {
  __pnacl_eh_sjlj_cxa_call_unexpected(exc);
}


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

x86 assembly (clang, -O2):
<__cxa_call_unexpected>:
jmp    1030 <__pnacl_eh_sjlj_cxa_call_unexpected@plt>

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

LLVM IR (-O2):
%struct._Unwind_Exception = type { i32 }
define void @__cxa_call_unexpected(%struct._Unwind_Exception* %0) {
%2 = tail call i32 @__pnacl_eh_sjlj_cxa_call_unexpected(%struct._Unwind_Exception* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int _get_largest_pair_sum(int *, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int arr[] = {12, 34, 10, 6, 40};
  int x = 0;
  x = _get_largest_pair_sum(arr, sizeof(arr) / sizeof(int));
  printf("\n largest pair sum := %d\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <_get_largest_pair_sum@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <_get_largest_pair_sum@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 12, i32 34, i32 10, i32 6, i32 40]
@.str = [26 x i8] c"\0A largest pair sum := %d\0A\00"
define void @main() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = bitcast [5 x i32]* %1 to i8*
store i32 0, i32* %2
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @_get_largest_pair_sum(i32* %4, i32 5)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 12, i32 34, i32 10, i32 6, i32 40]
@.str = [26 x i8] c"\0A largest pair sum := %d\0A\00"
define void @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @_get_largest_pair_sum(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int indirect_part_size(struct virtual_item *vi, int first, int units) {
  return units;
}


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

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

LLVM IR (-O0):
%struct.virtual_item = type opaque
define i32 @indirect_part_size(%struct.virtual_item* %0, i32 %1, i32 %2) {
%4 = alloca %struct.virtual_item*
%5 = alloca i32
%6 = alloca i32
store %struct.virtual_item* %0, %struct.virtual_item** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.virtual_item = type opaque
define i32 @indirect_part_size(%struct.virtual_item* nocapture readnone %0, i32 %1, i32 returned %2) {
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *t2(void *arg) {
  int y;
  y = 0;
  assert(y == 0);
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define i8* @t2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @t2(i8* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 1)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ helper_double_24_recursive(double *, int);
void helper_double_24(double *buf) { helper_double_24_recursive(buf, 24); }


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

x86 assembly (clang, -O2):
<helper_double_24>:
mov    $0x18,%esi
jmp    1030 <helper_double_24_recursive@plt>

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

LLVM IR (-O2):
define void @helper_double_24(double* %0) {
%2 = tail call i32 @helper_double_24_recursive(double* %0, i32 24)
ret void
}
void kol_paint_pixel(unsigned x, unsigned y, unsigned c) {
  asm volatile("int $0x40" ::"a"(1), "b"(x), "c"(y), "d"(c));
}


x86 assembly (clang, -O0):
<kol_paint_pixel>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%edx
mov    $0x1,%eax
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_paint_pixel>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%ebx
mov    $0x1,%eax
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kol_paint_pixel(i32 %0, i32 %1, i32 %2) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 1, i32 %0, i32 %1, i32 %2)
ret void
}
int ft_isgraph(int c) { return ((c >= 33 && c <= 126) ? 1 : 0); }


x86 assembly (clang, -O0):
<ft_isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x21,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isgraph+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @ft_isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int hexToStr(char const *, char *);
int strlen(char const *);
int HexToObj(const char *hex, void *obj, int objlen) {
  int hexlen = strlen(hex);
  if (hexlen != objlen * 2)
    return -1;
  return hexToStr(hex, (char *)obj);
}


x86 assembly (clang, -O0):
<HexToObj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
je     115c <HexToObj+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <HexToObj+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <hexToStr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HexToObj>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
add    %ebp,%ebp
cmp    %ebp,%eax
jne    1146 <HexToObj+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <hexToStr@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @HexToObj(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = shl nsw i32 %2, 1
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @hexToStr(i8* %0, i8* %1)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ -1, %3 ]
ret i32 %10
}
void SPI_RP_RX_ISR(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_RP_RX_ISR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void printMenu(int optionsc, char **optionsv) {
  for (int option = 0; option < optionsc; option++) {
    printf("%i - %s\n", option + 1, optionsv[option]);
  }
}


x86 assembly (clang, -O0):
<printMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115e <printMenu+0x4e>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <printMenu+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMenu>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <printMenu+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
add    $0x1,%rbx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    %rbx,%r12
jne    1130 <printMenu+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%i - %s\0A\00"
define void @printMenu(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = load i8**, i8*** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%i - %s\0A\00"
define void @printMenu(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %9, %7 ]
%9 = add nuw nsw i64 %8, 1
%10 = getelementptr inbounds i8*, i8** %1, i64 %8
%11 = load i8*, i8** %10
%12 = trunc i64 %9 to i32
%13 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %11)
%14 = icmp eq i64 %9, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ memreg_init();
int main() {
  memreg_init();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @memreg_init()
ret i32 0
}
int putch_(char *vec, char *ch, int *i) {
  vec[*i - 1] = *ch;
  return 0;
}


x86 assembly (clang, -O0):
<putch_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch_>:
mov    (%rsi),%al
movslq (%rdx),%rcx
mov    %al,-0x1(%rcx,%rdi,1)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @putch_(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %5
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %9, i64 %13
store i8 %8, i8* %14
ret i32 0
}

LLVM IR (-O2):
define i32 @putch_(i8* nocapture writeonly %0, i8* nocapture %1, i32* nocapture %2) {
%4 = load i8, i8* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %4, i8* %8
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ diag(char *, int, char *, int);
void itf_create(int number) { diag("ITF", 3, "ITF CREATE %d", number); }


x86 assembly (clang, -O0):
<itf_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xedb(%rip),%rdi
mov    $0x3,%esi
lea    0xed3(%rip),%rdx
call   1030 <diag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itf_create>:
mov    %edi,%ecx
lea    0xee7(%rip),%rdi
lea    0xee4(%rip),%rdx
mov    $0x3,%esi
jmp    1030 <diag@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ITF\00"
@.str.1 = [14 x i8] c"ITF CREATE %d\00"
define void @itf_create(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @diag(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ITF\00"
@.str.1 = [14 x i8] c"ITF CREATE %d\00"
define void @itf_create(i32 %0) {
%2 = tail call i32 @diag(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char good_strchr(char *str) {
  char *pos = strchr(str, 'a');
  if (pos)
    return pos[1];
}


x86 assembly (clang, -O0):
<good_strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x61,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1143 <good_strchr+0x33>
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<good_strchr>:
push   %rax
mov    $0x61,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1125 <good_strchr+0x15>
mov    0x1(%rax),%al
pop    %rcx
ret
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @good_strchr(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 97)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
store i8 %12, i8* %2
br label %13
13: ; preds = %9, %1
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @good_strchr(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 97)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %4
%8 = phi i8 [ %6, %4 ], [ undef, %1 ]
ret i8 %8
}
int somar_todos(int matriz[3][3]) {
  int soma = 0, i, j;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      soma += matriz[i][j];
    }
  }
  return soma;
}


x86 assembly (clang, -O0):
<somar_todos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    116e <somar_todos+0x6e>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    115b <somar_todos+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <somar_todos+0x27>
jmp    1160 <somar_todos+0x60>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <somar_todos+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<somar_todos>:
movdqu 0x4(%rdi),%xmm0
movdqu 0x14(%rdi),%xmm1
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @somar_todos([3 x i32]* nocapture %0) {
%2 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 1
%5 = bitcast i32* %4 to <8 x i32>*
%6 = load <8 x i32>, <8 x i32>* %5
%7 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %6)
%8 = add nsw i32 %7, %3
ret i32 %8
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzUnaryFunc_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_DATAOFF_DELAYED(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ SEND_REQDOWN(int);
void BrzUnaryFunc_reqdown(struct comp *comp, int port) {
  struct BrzUnaryFunc_ *c = (struct BrzUnaryFunc_ *)comp;
  SEND_DATAOFF_DELAYED(0, 0);
  SEND_REQDOWN(1);
}


x86 assembly (clang, -O0):
<BrzUnaryFunc_reqdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <SEND_DATAOFF_DELAYED@plt>
mov    $0x1,%edi
call   1040 <SEND_REQDOWN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzUnaryFunc_reqdown>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <SEND_DATAOFF_DELAYED@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <SEND_REQDOWN@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzUnaryFunc_ = type { i32 }
define void @BrzUnaryFunc_reqdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzUnaryFunc_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzUnaryFunc_*
store %struct.BrzUnaryFunc_* %7, %struct.BrzUnaryFunc_** %5
%8 = call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 0)
%9 = call i32 @SEND_REQDOWN(i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzUnaryFunc_reqdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 0)
%4 = tail call i32 @SEND_REQDOWN(i32 1)
ret void
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzUnaryFunc_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_REQUP(int);
int /*<<< orphan*/ TRACE_FOLLOW_THREAD(int, int /*<<< orphan*/);
void BrzUnaryFunc_requp(struct comp *comp, int port) {
  struct BrzUnaryFunc_ *c = (struct BrzUnaryFunc_ *)comp;
  TRACE_FOLLOW_THREAD(1, 0);
  SEND_REQUP(1);
}


x86 assembly (clang, -O0):
<BrzUnaryFunc_requp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <TRACE_FOLLOW_THREAD@plt>
mov    $0x1,%edi
call   1040 <SEND_REQUP@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzUnaryFunc_requp>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <TRACE_FOLLOW_THREAD@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <SEND_REQUP@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzUnaryFunc_ = type { i32 }
define void @BrzUnaryFunc_requp(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzUnaryFunc_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzUnaryFunc_*
store %struct.BrzUnaryFunc_* %7, %struct.BrzUnaryFunc_** %5
%8 = call i32 @TRACE_FOLLOW_THREAD(i32 1, i32 0)
%9 = call i32 @SEND_REQUP(i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzUnaryFunc_requp(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @TRACE_FOLLOW_THREAD(i32 1, i32 0)
%4 = tail call i32 @SEND_REQUP(i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ ses_config_enclosure_descriptor_len(scalar_t__ *);
uint8_t ses_config_enclosure_descriptor_vendor_len(uint8_t *data) {
  return ses_config_enclosure_descriptor_len(data) + 4 - 40;
}


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

x86 assembly (clang, -O2):
<ses_config_enclosure_descriptor_vendor_len>:
push   %rax
call   1030 <ses_config_enclosure_descriptor_len@plt>
add    $0xffffffffffffffdc,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @ses_config_enclosure_descriptor_vendor_len(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = call i64 @ses_config_enclosure_descriptor_len(i64* %3)
%5 = add nsw i64 %4, 4
%6 = sub nsw i64 %5, 40
ret i64 %6
}

LLVM IR (-O2):
define i64 @ses_config_enclosure_descriptor_vendor_len(i64* %0) {
%2 = tail call i64 @ses_config_enclosure_descriptor_len(i64* %0)
%3 = add nsw i64 %2, -36
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void quitproc() {
  printf("ctrl-\\ pressed to quit \n");
  exit(0);
}


x86 assembly (clang, -O0):
<quitproc>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quitproc>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"ctrl-\\ pressed to quit \0A\00"
define void @quitproc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"ctrl-\\ pressed to quit \00"
define void @quitproc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
reg0adrx1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if (r0 <= (((double *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0adrx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm1
movslq -0x20(%rbp),%rcx
mov    $0xa98ac7,%eax
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1145 <reg0adrx1+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <reg0adrx1+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0adrx1>:
movslq %esi,%rax
movsd  0xa98ac7(,%rax,8),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @reg0adrx1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* %8
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %16
%18 = load double, double* %17
%19 = fcmp ole double %14, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @reg0adrx1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %7
%9 = load double, double* %8
%10 = fcmp oge double %9, %0
%11 = zext i1 %10 to i32
ret i32 %11
}
void cellgen_total_start() {}


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

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

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

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