xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int /*<<< orphan*/ fesetenv(int /*<<< orphan*/ *);
void nullPointer_fesetenv(void) {
  fenv_t *envp = 0;
  (void)fesetenv(envp);
  (void)fesetenv(0);
}


x86 assembly (clang, -O0):
<nullPointer_fesetenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fesetenv@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <fesetenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullPointer_fesetenv>:
push   %rax
xor    %edi,%edi
call   1030 <fesetenv@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <fesetenv@plt>

LLVM IR (-O0):
define void @nullPointer_fesetenv() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
%3 = call i32 @fesetenv(i32* %2)
%4 = call i32 @fesetenv(i32* null)
ret void
}

LLVM IR (-O2):
define void @nullPointer_fesetenv() {
%1 = tail call i32 @fesetenv(i32* null)
%2 = tail call i32 @fesetenv(i32* null)
ret void
}
/* Variables and functions */
int LNS_Length();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Дължина на най-дългата ненамаляваща подредица: %u\n", LNS_Length());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [91 x i8] c"\D0\94\D1\8A\D0\BB\D0\B6\D0\B8\D0\BD\D0\B0 \D0\BD\D0\B0 \D0\BD\D0\B0\D0\B9-\D0\B4\D1\8A\D0\BB\D0\B3\D0\B0\D1\82\D0\B0 \D0\BD\D0\B5\D0\BD\D0\B0\D0\BC\D0\B0\D0\BB\D1\8F\D0\B2\D0\B0\D1\89\D0\B0 \D0\BF\D0\BE\D0\B4\D1\80\D0\B5\D0\B4\D0\B8\D1\86\D0\B0: %u\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @LNS_Length()
%3 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [91 x i8] c"\D0\94\D1\8A\D0\BB\D0\B6\D0\B8\D0\BD\D0\B0 \D0\BD\D0\B0 \D0\BD\D0\B0\D0\B9-\D0\B4\D1\8A\D0\BB\D0\B3\D0\B0\D1\82\D0\B0 \D0\BD\D0\B5\D0\BD\D0\B0\D0\BC\D0\B0\D0\BB\D1\8F\D0\B2\D0\B0\D1\89\D0\B0 \D0\BF\D0\BE\D0\B4\D1\80\D0\B5\D0\B4\D0\B8\D1\86\D0\B0: %u\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @LNS_Length()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void __up_write(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__up_write>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__up_write>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__up_write = [11 x i8] c"__up_write\00"
define void @__up_write() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.__up_write, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__up_write = [11 x i8] c"__up_write\00"
define void @__up_write() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.__up_write, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ clearArray(char *, int);
int /*<<< orphan*/ copyArray(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ skipBlank(int /*<<< orphan*/ *, char *, int);
void nextText(FILE *f, char *regex, char *result, char *buffer, int size) {
  fscanf(f, regex, buffer);
  copyArray(buffer, result);
  clearArray(buffer, size);
  skipBlank(f, buffer, size);
}


x86 assembly (clang, -O0):
<nextText>:
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    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <copyArray@plt>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <clearArray@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1050 <skipBlank@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextText>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r15d
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rdi,%rbp
mov    %rcx,%rdx
call   1040 <fscanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <copyArray@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1030 <clearArray@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <skipBlank@plt>

LLVM IR (-O0):
define void @nextText(i32* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %9
%14 = call i32 @fscanf(i32* %11, i8* %12, i8* %13)
%15 = load i8*, i8** %9
%16 = load i8*, i8** %8
%17 = call i32 @copyArray(i8* %15, i8* %16)
%18 = load i8*, i8** %9
%19 = load i32, i32* %10
%20 = call i32 @clearArray(i8* %18, i32 %19)
%21 = load i32*, i32** %6
%22 = load i8*, i8** %9
%23 = load i32, i32* %10
%24 = call i32 @skipBlank(i32* %21, i8* %22, i32 %23)
ret void
}

LLVM IR (-O2):
define void @nextText(i32* %0, i8* nocapture %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i32 @fscanf(i32* %0, i8* %1, i8* %3)
%7 = tail call i32 @copyArray(i8* %3, i8* %2)
%8 = tail call i32 @clearArray(i8* %3, i32 %4)
%9 = tail call i32 @skipBlank(i32* %0, i8* %3, i32 %4)
ret void
}
double max(double a, double b) {
  if (a < b) {
    return b;
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <max+0x31>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <max+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
double atan(double);
double Double_atan(double x) { return atan(x); }


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

x86 assembly (clang, -O2):
<Double_atan>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define double @Double_atan(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_client_new_string() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_client_new_string"
         "\n");
}


x86 assembly (clang, -O0):
<pa_socket_client_new_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"NOT IMPLEMENTED:pa_socket_client_new_string\0A\00"
define i32 @pa_socket_client_new_string() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [44 x i8] c"NOT IMPLEMENTED:pa_socket_client_new_string\00"
define i32 @pa_socket_client_new_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
size_t eh_fmt_unsigned_len(register unsigned n, const unsigned b) {
  register unsigned l = 1;
  for (; n > (b - 1); n /= b, l++)
    ;
  return l;
}


x86 assembly (clang, -O0):
<eh_fmt_unsigned_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jbe    1142 <eh_fmt_unsigned_len+0x42>
jmp    1127 <eh_fmt_unsigned_len+0x27>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <eh_fmt_unsigned_len+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eh_fmt_unsigned_len>:
mov    %edi,%eax
lea    -0x1(%rsi),%edi
mov    $0x1,%ecx
cmp    %eax,%edi
jae    112d <eh_fmt_unsigned_len+0x2d>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edx,%edx
div    %esi
add    $0x1,%ecx
cmp    %edi,%eax
ja     1120 <eh_fmt_unsigned_len+0x20>
mov    %ecx,%ecx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @eh_fmt_unsigned_len(i32 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, %0
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 1, %2 ]
%7 = phi i32 [ %8, %5 ], [ %0, %2 ]
%8 = udiv i32 %7, %1
%9 = add i32 %6, 1
%10 = icmp ugt i32 %8, %3
br i1 %10, label %5, label %11
11: ; preds = %5
%12 = zext i32 %9 to i64
br label %13
13: ; preds = %11, %2
%14 = phi i64 [ 1, %2 ], [ %12, %11 ]
ret i64 %14
}
/* Type definitions */
struct cart {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _cartVarDbName(char *, char *);
char *cartNonemptyString(struct cart *, int /*<<< orphan*/);
char *cartNonemptyStringDb(struct cart *cart, char *db, char *name) {
  return cartNonemptyString(cart, _cartVarDbName(db, name));
}


x86 assembly (clang, -O0):
<cartNonemptyStringDb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <_cartVarDbName@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <cartNonemptyString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cartNonemptyStringDb>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <_cartVarDbName@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <cartNonemptyString@plt>

LLVM IR (-O0):
%struct.cart = type { i32 }
define i8* @cartNonemptyStringDb(%struct.cart* %0, i8* %1, i8* %2) {
%4 = alloca %struct.cart*
%5 = alloca i8*
%6 = alloca i8*
store %struct.cart* %0, %struct.cart** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.cart*, %struct.cart** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @_cartVarDbName(i8* %8, i8* %9)
%11 = call i8* @cartNonemptyString(%struct.cart* %7, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
%struct.cart = type { i32 }
define i8* @cartNonemptyStringDb(%struct.cart* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_cartVarDbName(i8* %1, i8* %2)
%5 = tail call i8* @cartNonemptyString(%struct.cart* %0, i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ t_exit(int);
int /*<<< orphan*/ t_print_backtrace();
void t_abort(void) {
  t_print_backtrace();
  abort();
  t_exit(1);
}


x86 assembly (clang, -O0):
<t_abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <t_print_backtrace@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<t_abort>:
push   %rax
xor    %eax,%eax
call   1040 <t_print_backtrace@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @t_abort() {
%1 = call i32 (...) @t_print_backtrace()
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @t_abort() {
%1 = tail call i32 (...) @t_print_backtrace()
%2 = tail call i32 (...) @abort()
unreachable
}
int test_imm_82uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x82 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_82uint64_lowword_reg>:
test   $0x82,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_82uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 130
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t);
void printf_bits(size_t *bits, size_t size) {
  size_t i;
  for (i = 0; i < size; i++) {
    printf("%d", bits[i]);
  }
}


x86 assembly (clang, -O0):
<printf_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115f <printf_bits+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printf_bits+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_bits>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1145 <printf_bits+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printf_bits+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printf_bits(i64* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
unsigned long PAPI_thread_id();
void papif_thread_id_(unsigned long *id) { *id = PAPI_thread_id(); }


x86 assembly (clang, -O0):
<papif_thread_id_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PAPI_thread_id@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_thread_id_>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_thread_id@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_thread_id_(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @PAPI_thread_id()
%4 = load i64*, i64** %2
store i64 %3, i64* %4
ret void
}

LLVM IR (-O2):
define void @papif_thread_id_(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_thread_id()
store i64 %2, i64* %0
ret void
}
/* Type definitions */
struct fd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fd_pop(struct fd *);
int /*<<< orphan*/ source_pop();
void source_popfd(struct fd *fd) {
  source_pop();
  fd_pop(fd);
}


x86 assembly (clang, -O0):
<source_popfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <source_pop@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fd_pop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<source_popfd>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <source_pop@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fd_pop@plt>

LLVM IR (-O0):
%struct.fd = type { i32 }
define void @source_popfd(%struct.fd* %0) {
%2 = alloca %struct.fd*
store %struct.fd* %0, %struct.fd** %2
%3 = call i32 (...) @source_pop()
%4 = load %struct.fd*, %struct.fd** %2
%5 = call i32 @fd_pop(%struct.fd* %4)
ret void
}

LLVM IR (-O2):
%struct.fd = type { i32 }
define void @source_popfd(%struct.fd* %0) {
%2 = tail call i32 (...) @source_pop()
%3 = tail call i32 @fd_pop(%struct.fd* %0)
ret void
}
void modulo_signed_Bad(int i) {
  char arr[5];
  arr[i % 5] = 123;
}


x86 assembly (clang, -O0):
<modulo_signed_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movb   $0x7b,-0x9(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @modulo_signed_Bad(i32 %0) {
%2 = alloca i32
%3 = alloca [5 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 5
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 %6
store i8 123, i8* %7
ret void
}

LLVM IR (-O2):
define void @modulo_signed_Bad(i32 %0) {
ret void
}
/* Type definitions */
struct sembuf {
  int sem_op;
  int /*<<< orphan*/ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int semop(int, struct sembuf *, int);
int semaphore_post(int semid) {
  struct sembuf sem_b;
  sem_b.sem_num = 0;
  sem_b.sem_op = 1;
  sem_b.sem_flg = SEM_UNDO;
  return semop(semid, &sem_b, 1);
}


x86 assembly (clang, -O0):
<semaphore_post>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semaphore_post>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0x1,0x8(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
@SEM_UNDO = global i32 0
define i32 @semaphore_post(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sembuf
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 2
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 0
store i32 1, i32* %5
%6 = load i32, i32* @SEM_UNDO
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 1
store i32 %6, i32* %7
%8 = load i32, i32* %2
%9 = call i32 @semop(i32 %8, %struct.sembuf* %3, i32 1)
ret i32 %9
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
@SEM_UNDO = global i32 0
define i32 @semaphore_post(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 2
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 0
store i32 1, i32* %5
%6 = load i32, i32* @SEM_UNDO
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 1
store i32 %6, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
ret i32 %8
}
short read_short(const unsigned char *p) { return (p[0] << 8) | p[1]; }


x86 assembly (clang, -O0):
<read_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_short>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @read_short(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define signext i16 @read_short(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
ISR(TIMER0_OVF_vect) {}


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

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

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

LLVM IR (-O2):
define i32 @ISR(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ execve(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argc == 0)
    exit(EXIT_SUCCESS);
  execve("/proc/self/exe", NULL, NULL);
  exit(EXIT_FAILURE);
}


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)
cmpl   $0x0,-0x8(%rbp)
jne    114e <main+0x2e>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
lea    0xeab(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <execve@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
test   %edi,%edi
jne    1133 <main+0x13>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
lea    0xec6(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <execve@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@.str = [15 x i8] c"/proc/self/exe\00"
@EXIT_FAILURE = 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
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EXIT_SUCCESS
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = call i32 @execve(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@.str = [15 x i8] c"/proc/self/exe\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %2
%8 = tail call i32 @execve(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/
internal_quick_sort(char *, char *, int,
                    int (*)(void const *, void const *, void *), void *);
void qsort_reentrant(void *base, int count, int size,
                     int (*compare)(const void *, const void *, void *),
                     void *pointer) {
  if (count > 1) {
    internal_quick_sort((char *)base, (char *)base + (count - 1) * size, size,
                        compare, pointer);
  }
}


x86 assembly (clang, -O0):
<qsort_reentrant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    115b <qsort_reentrant+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
imul   -0x10(%rbp),%eax
cltq
add    %rax,%rsi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <internal_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_reentrant>:
cmp    $0x2,%esi
jl     1126 <qsort_reentrant+0x16>
add    $0xffffffff,%esi
imul   %edx,%esi
movslq %esi,%rsi
add    %rdi,%rsi
jmp    1030 <internal_quick_sort@plt>
ret

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

LLVM IR (-O2):
define void @qsort_reentrant(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*, i8*)* %3, i8* %4) {
%6 = icmp sgt i32 %1, 1
br i1 %6, label %7, label %13
7: ; preds = %5
%8 = add nsw i32 %1, -1
%9 = mul nsw i32 %8, %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = tail call i32 @internal_quick_sort(i8* %0, i8* %11, i32 %2, i32 (i8*, i8*, i8*)* %3, i8* %4)
br label %13
13: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_bat_comment_entities();
int /*<<< orphan*/ test_bat_comments();
void all_bat_tests() {
  test_bat_comments();
  test_bat_comment_entities();
}


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

x86 assembly (clang, -O2):
<all_bat_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_bat_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_bat_comment_entities@plt>

LLVM IR (-O0):
define void @all_bat_tests() {
%1 = call i32 (...) @test_bat_comments()
%2 = call i32 (...) @test_bat_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_bat_tests() {
%1 = tail call i32 (...) @test_bat_comments()
%2 = tail call i32 (...) @test_bat_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initpotential_();
void InitPotential() { initpotential_(); }


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

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

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

LLVM IR (-O2):
define void @InitPotential() {
%1 = tail call i32 (...) @initpotential_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BLE_1_bless_isr_Disable();
void CyBleHal_DisableGlobalInterrupts(void) { BLE_1_bless_isr_Disable(); }


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

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

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

LLVM IR (-O2):
define void @CyBleHal_DisableGlobalInterrupts() {
%1 = tail call i32 (...) @BLE_1_bless_isr_Disable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_MAKE_GIO2_OUTPUT();
void HUMIDITY_MAKE_CLOCK_OUTPUT() { TOSH_MAKE_GIO2_OUTPUT(); }


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

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

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

LLVM IR (-O2):
define void @HUMIDITY_MAKE_CLOCK_OUTPUT() {
%1 = tail call i32 (...) @TOSH_MAKE_GIO2_OUTPUT()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *cmd) {
  printf("Usage: %s [options] host port\n"
         "\n"
         "Options:\n"
         "  -c certificate-file\n"
         "  -k key-file          specifies the credentials to be used for "
         "running the\n"
         "                       server. If omitted, the command runs as a "
         "client.\n"
         "  -l log-file          file to log traffic secrets\n"
         "  -s session-file      file to read/write the session ticket\n"
         "  -e                   when resuming a session, send first 8,192 "
         "bytes of input\n"
         "                       as early data\n"
         "  -v                   verify peer using the default certificates\n"
         "  -h                   print this help\n"
         "\n",
         cmd);
}


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

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

LLVM IR (-O0):
@.str = [547 x i8] c"Usage: %s [options] host port\0A\0AOptions:\0A -c certificate-file\0A -k key-file specifies the credentials to be used for running the\0A server. If omitted, the command runs as a client.\0A -l log-file file to log traffic secrets\0A -s session-file file to read/write the session ticket\0A -e when resuming a session, send first 8,192 bytes of input\0A as early data\0A -v verify peer using the default certificates\0A -h print this help\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([547 x i8], [547 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [547 x i8] c"Usage: %s [options] host port\0A\0AOptions:\0A -c certificate-file\0A -k key-file specifies the credentials to be used for running the\0A server. If omitted, the command runs as a client.\0A -l log-file file to log traffic secrets\0A -s session-file file to read/write the session ticket\0A -e when resuming a session, send first 8,192 bytes of input\0A as early data\0A -v verify peer using the default certificates\0A -h print this help\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([547 x i8], [547 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
float rand01();
float randfr(float min, float max) {
  float r = min + ((max - min + 1) * rand01());
  return r;
}


x86 assembly (clang, -O0):
<randfr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  0xec2(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand01@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randfr>:
push   %rax
movss  %xmm0,0x4(%rsp)
subss  %xmm0,%xmm1
addss  0xedd(%rip),%xmm1
movss  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <rand01@plt>
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @randfr(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %3
%9 = fsub float %7, %8
%10 = fadd float %9, 1.000000e+00
%11 = call float (...) @rand01()
%12 = call float @llvm.fmuladd.f32(float %10, float %11, float %6)
store float %12, float* %5
%13 = load float, float* %5
ret float %13
}

LLVM IR (-O2):
define float @randfr(float %0, float %1) {
%3 = fsub float %1, %0
%4 = fadd float %3, 1.000000e+00
%5 = tail call float (...) @rand01()
%6 = tail call float @llvm.fmuladd.f32(float %4, float %5, float %0)
ret float %6
}
/* Variables and functions */
double ***malloc(int);
int arrayAlloc2D(int dim1, int dim2, double (**array)[dim1][dim2]) {
  (*array) = malloc(sizeof(**array));
  if ((*array) == NULL) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<arrayAlloc2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   %rcx,%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    115b <arrayAlloc2D+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <arrayAlloc2D+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayAlloc2D>:
push   %rbx
mov    %rdx,%rbx
imul   %esi,%edi
shl    $0x3,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @arrayAlloc2D(i32 %0, i32 %1, double** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double**
store i32 %0, i32* %5
store i32 %1, i32* %6
store double** %2, double*** %7
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = load i32, i32* %6
%11 = zext i32 %10 to i64
%12 = load double**, double*** %7
%13 = load double*, double** %12
%14 = mul nuw i64 %9, %11
%15 = mul nuw i64 8, %14
%16 = trunc i64 %15 to i32
%17 = call double*** @malloc(i32 %16)
%18 = bitcast double*** %17 to double*
%19 = load double**, double*** %7
store double* %18, double** %19
%20 = load double**, double*** %7
%21 = load double*, double** %20
%22 = icmp eq double* %21, null
br i1 %22, label %23, label %24
23: ; preds = %3
store i32 -1, i32* %4
br label %25
24: ; preds = %3
store i32 0, i32* %4
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @arrayAlloc2D(i32 %0, i32 %1, double** nocapture writeonly %2) {
%4 = shl i32 %0, 3
%5 = mul i32 %4, %1
%6 = tail call double*** @malloc(i32 %5)
%7 = bitcast double** %2 to double****
store double*** %6, double**** %7
%8 = icmp eq double*** %6, null
%9 = sext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EA_AY_AI_32();
int /*<<< orphan*/ m68ki_jump(int /*<<< orphan*/);
void m68k_op_jmp_32_ai(void) { m68ki_jump(EA_AY_AI_32()); }


x86 assembly (clang, -O0):
<m68k_op_jmp_32_ai>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <EA_AY_AI_32@plt>
mov    %eax,%edi
call   1030 <m68ki_jump@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_jmp_32_ai>:
push   %rax
xor    %eax,%eax
call   1040 <EA_AY_AI_32@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <m68ki_jump@plt>

LLVM IR (-O0):
define void @m68k_op_jmp_32_ai() {
%1 = call i32 (...) @EA_AY_AI_32()
%2 = call i32 @m68ki_jump(i32 %1)
ret void
}

LLVM IR (-O2):
define void @m68k_op_jmp_32_ai() {
%1 = tail call i32 (...) @EA_AY_AI_32()
%2 = tail call i32 @m68ki_jump(i32 %1)
ret void
}
const char *get_build_version(void) {
  return "BUILD VERSION: "
         "1.4.4"
         " Build date: "
         "Mar 18 2022"
         " "
         "03:21:57";
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"BUILD VERSION: 1.4.4 Build date: Mar 18 2022 03:21:57\00"
define i8* @get_build_version() {
ret i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [54 x i8] c"BUILD VERSION: 1.4.4 Build date: Mar 18 2022 03:21:57\00"
define i8* @get_build_version() {
ret i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int rand();
int randInt(int min, int max) { return (rand() % (max + 1 - min)) + min; }


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

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

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

LLVM IR (-O2):
define i32 @randInt(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
double f4_sum_pre_double_double_double_double_double_double_double_double_short(
    double v0, double v1, double v2, double v3, double v4, double v5, double v6,
    double v7, short v) {
  return v0 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_double_double_double_double_double_double_double_double_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
mov    %ax,-0x42(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
addsd  %xmm1,%xmm0
movswl -0x42(%rbp),%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_double_double_double_double_double_double_double_short>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm7,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_double_double_double_double_double_double_double_short(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i16 signext %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca i16
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store i16 %8, i16* %18
%19 = load double, double* %10
%20 = load double, double* %11
%21 = fadd double %19, %20
%22 = load double, double* %12
%23 = fadd double %21, %22
%24 = load double, double* %13
%25 = fadd double %23, %24
%26 = load double, double* %14
%27 = fadd double %25, %26
%28 = load double, double* %15
%29 = fadd double %27, %28
%30 = load double, double* %16
%31 = fadd double %29, %30
%32 = load double, double* %17
%33 = fadd double %31, %32
%34 = load i16, i16* %18
%35 = sitofp i16 %34 to double
%36 = fadd double %33, %35
ret double %36
}

LLVM IR (-O2):
define double @f4_sum_pre_double_double_double_double_double_double_double_double_short(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i16 signext %8) {
%10 = fadd double %0, %1
%11 = fadd double %10, %2
%12 = fadd double %11, %3
%13 = fadd double %12, %4
%14 = fadd double %13, %5
%15 = fadd double %14, %6
%16 = fadd double %15, %7
%17 = sitofp i16 %8 to double
%18 = fadd double %16, %17
ret double %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 10, y = 20;
  if (y > x)
    printf("y: %d is greater than x: %d", y, x);
  else
    printf("comparison is false");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1152 <main+0x42>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1160 <main+0x50>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x14,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"y: %d is greater than x: %d\00"
@.str.1 = [20 x i8] c"comparison is false\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = icmp sgt i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"y: %d is greater than x: %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 20, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add(char *);
void autoData() {
  add("Guionardo");
  add("Marines");
  add("Joao");
  add("Benjamin");
}


x86 assembly (clang, -O0):
<autoData>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <add@plt>
lea    0xee3(%rip),%rdi
call   1030 <add@plt>
lea    0xedf(%rip),%rdi
call   1030 <add@plt>
lea    0xed8(%rip),%rdi
call   1030 <add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<autoData>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <add@plt>
lea    0xee6(%rip),%rdi
call   1030 <add@plt>
lea    0xee2(%rip),%rdi
call   1030 <add@plt>
lea    0xedb(%rip),%rdi
pop    %rax
jmp    1030 <add@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Guionardo\00"
@.str.1 = [8 x i8] c"Marines\00"
@.str.2 = [5 x i8] c"Joao\00"
@.str.3 = [9 x i8] c"Benjamin\00"
define void @autoData() {
%1 = call i32 @add(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @add(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @add(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @add(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Guionardo\00"
@.str.1 = [8 x i8] c"Marines\00"
@.str.2 = [5 x i8] c"Joao\00"
@.str.3 = [9 x i8] c"Benjamin\00"
define void @autoData() {
%1 = tail call i32 @add(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @add(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @add(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @add(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
long double C_Utils_max_longdouble(const long double item1,
                                   const long double item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_max_longdouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1132 <C_Utils_max_longdouble+0x32>
jmp    1127 <C_Utils_max_longdouble+0x27>
fldt   -0x10(%rbp)
fstpt  -0x2c(%rbp)
jmp    1138 <C_Utils_max_longdouble+0x38>
fldt   -0x20(%rbp)
fstpt  -0x2c(%rbp)
fldt   -0x2c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_max_longdouble>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fucomi %st(1),%st
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @C_Utils_max_longdouble(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp ogt x86_fp80 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load x86_fp80, x86_fp80* %3
br label %12
10: ; preds = %2
%11 = load x86_fp80, x86_fp80* %4
br label %12
12: ; preds = %10, %8
%13 = phi x86_fp80 [ %9, %8 ], [ %11, %10 ]
ret x86_fp80 %13
}

LLVM IR (-O2):
define x86_fp80 @C_Utils_max_longdouble(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ogt x86_fp80 %0, %1
%4 = select i1 %3, x86_fp80 %0, x86_fp80 %1
ret x86_fp80 %4
}