xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
double to_fahrenheit(double temp_c) {
  if (temp_c < -273.15) {
    perror("Temperature under absolute zero");
    return 0;
  }
  return ((9.0 / 5) * temp_c) + 32;
}


x86 assembly (clang, -O0):
<to_fahrenheit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1149 <to_fahrenheit+0x39>
lea    0xee1(%rip),%rdi
call   1030 <perror@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116b <to_fahrenheit+0x5b>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_fahrenheit>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1131 <to_fahrenheit+0x21>
mulsd  0xee1(%rip),%xmm0
addsd  0xee1(%rip),%xmm0
pop    %rax
ret
lea    0xee0(%rip),%rdi
call   1030 <perror@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Temperature under absolute zero\00"
define double @to_fahrenheit(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, -2.731500e+02
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store double 0.000000e+00, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %9, double 3.200000e+01)
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
@.str = [32 x i8] c"Temperature under absolute zero\00"
define double @to_fahrenheit(double %0) {
%2 = fcmp olt double %0, -2.731500e+02
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call double @llvm.fmuladd.f64(double %0, double 1.800000e+00, double 3.200000e+01)
br label %7
7: ; preds = %5, %3
%8 = phi double [ 0.000000e+00, %3 ], [ %6, %5 ]
ret double %8
}
void *g_pg(void *arg, int m) {
  if (m == 2) {
    return (char *)arg;
  }
  return ((char **)arg)[0];
}


x86 assembly (clang, -O0):
<g_pg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    1122 <g_pg+0x22>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112d <g_pg+0x2d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_pg>:
mov    %rdi,%rax
cmp    $0x2,%esi
je     110b <g_pg+0xb>
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i8* @g_pg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i8*, i8** %4
store i8* %9, i8** %3
br label %15
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i8**
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
store i8* %14, i8** %3
br label %15
15: ; preds = %10, %8
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @g_pg(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to i8**
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ %0, %2 ]
ret i8* %8
}
char doSomething(int successful) {
  if (successful > 0) {
    return 'a';
  }
  return -1;
}


x86 assembly (clang, -O0):
<doSomething>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111a <doSomething+0x1a>
movb   $0x61,-0x1(%rbp)
jmp    111e <doSomething+0x1e>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doSomething>:
test   %edi,%edi
mov    $0x61,%ecx
mov    $0xff,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @doSomething(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 97, i8* %2
br label %8
7: ; preds = %1
store i8 -1, i8* %2
br label %8
8: ; preds = %7, %6
%9 = load i8, i8* %2
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @doSomething(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i8 97, i8 -1
ret i8 %3
}
void mus_set_little_endian_unsigned_short(unsigned char *j, unsigned short x) {
  unsigned char *ox;
  ox = (unsigned char *)&x;
  j[0] = ox[1];
  j[1] = ox[0];
}


x86 assembly (clang, -O0):
<mus_set_little_endian_unsigned_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_set_little_endian_unsigned_short>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @mus_set_little_endian_unsigned_short(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8*
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = bitcast i16* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @mus_set_little_endian_unsigned_short(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
store i8 %5, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %6
ret void
}
void ResetBuffersGPU() {}


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

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

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

LLVM IR (-O2):
define void @ResetBuffersGPU() {
ret void
}
unsigned int f35(unsigned int x, int y __attribute__((unused))) {
  return (x >> 1) | (x << (8 * 4 - 1));
}


x86 assembly (clang, -O0):
<f35>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f35(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = lshr i32 %5, 1
%7 = load i32, i32* %3
%8 = shl i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f35(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
double testm1(void) { return -1.0; }


x86 assembly (clang, -O0):
<testm1>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<testm1>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @testm1() {
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @testm1() {
ret double -1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ lib_service();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sayHello(char *);
int main(int ac, char *av[]) {
  printf("Calling libservice.so: \n");
  lib_service();
  printf("Calling libtest.so: \n");
  sayHello("main");
  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)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <lib_service@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <sayHello@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <lib_service@plt>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
lea    0xea9(%rip),%rdi
call   1030 <sayHello@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Calling libservice.so: \0A\00"
@.str.1 = [22 x i8] c"Calling libtest.so: \0A\00"
@.str.2 = [5 x i8] c"main\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @lib_service()
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @sayHello(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [5 x i8] c"main\00"
@str = [24 x i8] c"Calling libservice.so: \00"
@str.3 = [21 x i8] c"Calling libtest.so: \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @lib_service()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @sayHello(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void mixedSignedness11(int a) {
  int min = 0;
  clang_analyzer_eval(a < min);
  clang_analyzer_eval((a + 2) < min);
  clang_analyzer_eval((a + 2U) < min);
}


x86 assembly (clang, -O0):
<mixedSignedness11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    -0x8(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixedSignedness11>:
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmp    $0xfffffffe,%ebx
setl   %dil
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
pop    %rbx
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @mixedSignedness11(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp slt i32 %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 2
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
%15 = load i32, i32* %2
%16 = add i32 %15, 2
%17 = load i32, i32* %3
%18 = icmp ult i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @clang_analyzer_eval(i32 %19)
ret void
}

LLVM IR (-O2):
define void @mixedSignedness11(i32 %0) {
%2 = lshr i32 %0, 31
%3 = tail call i32 @clang_analyzer_eval(i32 %2)
%4 = icmp slt i32 %0, -2
%5 = zext i1 %4 to i32
%6 = tail call i32 @clang_analyzer_eval(i32 %5)
%7 = tail call i32 @clang_analyzer_eval(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sla_eqgal_(double *, double *, double *, double *);
void slaEqgal(double dr, double dd, double *dl, double *db) {
  double DR;
  double DD;
  double DL;
  double DB;
  DR = dr;
  DD = dd;
  sla_eqgal_(&DR, &DD, &DL, &DB);
  *dl = DL;
  *db = DB;
}


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

x86 assembly (clang, -O2):
<slaEqgal>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <sla_eqgal_@plt>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @slaEqgal(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %5 to i8*
%10 = bitcast double* %6 to i8*
%11 = bitcast double* %7 to i8*
%12 = bitcast double* %8 to i8*
store double %0, double* %5
store double %1, double* %6
%13 = call i32 @sla_eqgal_(double* %5, double* %6, double* %7, double* %8)
%14 = load double, double* %7
store double %14, double* %2
%15 = load double, double* %8
store double %15, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die(char const *msg) {
  fprintf(stderr,
          "bindtextdomain.so"
          ": %s\n",
          msg);
  exit(1);
}


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

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

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

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

/* Variables and functions */
size_t fwrite(void const *, size_t, size_t, int /*<<< orphan*/ *);
size_t c_fwrite(const void *ptr, size_t size, size_t nmemb, void *stream) {
  return fwrite(ptr, size, nmemb, (FILE *)stream);
}


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

x86 assembly (clang, -O2):
<c_fwrite>:
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define i64 @c_fwrite(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i8*, i8** %8
%13 = bitcast i8* %12 to i32*
%14 = call i64 @fwrite(i8* %9, i64 %10, i64 %11, i32* %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @c_fwrite(i8* nocapture %0, i64 %1, i64 %2, i8* nocapture %3) {
%5 = bitcast i8* %3 to i32*
%6 = tail call i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %5)
ret i64 %6
}
/* Type definitions */
struct mrb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mrb *);
void mrb_destroy(struct mrb *m) { free(m); }


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

x86 assembly (clang, -O2):
<mrb_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.mrb = type { i32 }
define void @mrb_destroy(%struct.mrb* nocapture %0) {
%2 = tail call i32 @free(%struct.mrb* %0)
ret void
}
unsigned int entryPoint2(unsigned int nbVectors, unsigned long *vectorSizes,
                         unsigned elemSize, void **vectors) {
  (void)nbVectors;
  (void)vectorSizes;
  (void)elemSize;
  (void)vectors;
  return 0;
}


x86 assembly (clang, -O0):
<entryPoint2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @entryPoint2(i32 %0, i64* nocapture readnone %1, i32 %2, i8** nocapture readnone %3) {
ret i32 0
}
__attribute__((section(".isr_handler"))) void fault_isr_handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<fault_isr_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fault_isr_handler+0x9>
jmp    1109 <fault_isr_handler+0x9>

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

LLVM IR (-O0):
define void @fault_isr_handler() section ".isr_handler" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @fault_isr_handler() section ".isr_handler" {
br label %1
1: ; preds = %0, %1
br label %1
}
int _close(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 0
}
int to_digit(int c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  else if (c >= 'A' && c <= 'Z')
    return c - 'A' + 10;
  else if (c >= 'a' && c <= 'z')
    return c - 'a' + 10;
  else
    return 36;
}


x86 assembly (clang, -O0):
<to_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <to_digit+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <to_digit+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <to_digit+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     114e <to_digit+0x4e>
cmpl   $0x5a,-0x8(%rbp)
jg     114e <to_digit+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <to_digit+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     1173 <to_digit+0x73>
cmpl   $0x7a,-0x8(%rbp)
jg     1173 <to_digit+0x73>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <to_digit+0x7a>
movl   $0x24,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_digit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <to_digit+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x19,%eax
ja     1116 <to_digit+0x16>
add    $0xffffffc9,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x1a,%eax
mov    $0x24,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @to_digit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 90
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 122
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 97
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 36, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @to_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 26
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -55
br label %14
9: ; preds = %4
%10 = add i32 %0, -97
%11 = icmp ult i32 %10, 26
%12 = add nsw i32 %0, -87
%13 = select i1 %11, i32 %12, i32 36
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ debug_printf(char *, void const *);
void debug_symbol_print(const void *addr) { debug_printf("\t%p\n", addr); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\09%p\0A\00"
define void @debug_symbol_print(i8* %0) {
%2 = tail call i32 @debug_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void test_five(int x, int y, int z) {
#pragma omp taskloop simd collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      for (int i = 0; i < z; i++)
        ;
}


x86 assembly (clang, -O0):
<test_five>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117f <test_five+0x7f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <test_five+0x6c>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <test_five+0x59>
jmp    114b <test_five+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <test_five+0x3a>
jmp    115e <test_five+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <test_five+0x27>
jmp    1171 <test_five+0x71>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <test_five+0x14>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_five(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void printErr(char *msg) {
  fprintf(stderr, "%s\n", msg);
  printf("Pro ziskani napovedy pouzijte: ./proj2 --help\n");
}


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

x86 assembly (clang, -O2):
<printErr>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xec4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [47 x i8] c"Pro ziskani napovedy pouzijte: ./proj2 --help\0A\00"
define void @printErr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@str = [46 x i8] c"Pro ziskani napovedy pouzijte: ./proj2 --help\00"
define void @printErr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_version() {
  fprintf(stdout, "getopts coding template V"
                  "1.0"
                  "\n");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [30 x i8] c"getopts coding template V1.0\0A\00"
define void @print_version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [30 x i8] c"getopts coding template V1.0\0A\00"
define void @print_version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
void XkbNoteMapChanges() {}


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

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

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

LLVM IR (-O2):
define void @XkbNoteMapChanges() {
ret void
}
double aFahrenheit(double valor) {
  double f = (double)(valor * 9 / 5) + 32;
  return f;
}


x86 assembly (clang, -O0):
<aFahrenheit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<aFahrenheit>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @aFahrenheit(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 9.000000e+00
%6 = fdiv double %5, 5.000000e+00
%7 = fadd double %6, 3.200000e+01
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @aFahrenheit(double %0) {
%2 = fmul double %0, 9.000000e+00
%3 = fdiv double %2, 5.000000e+00
%4 = fadd double %3, 3.200000e+01
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float a;
  float r;
  r = 98;
  a = 3.14159265359 * r * r;
  printf("%.3f\n", a);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 9.800000e+01, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fmul double 0x400921FB54442EEA, %5
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fmul double %6, %8
%10 = fptrunc double %9 to float
store float %10, float* %2
%11 = load float, float* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.3f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 0x40DD76F6C0000000)
ret i32 0
}
void kvm_cma_reserve(void) {}


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

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

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

LLVM IR (-O2):
define void @kvm_cma_reserve() {
ret void
}
int stat(const char *path, struct stat *st) {
  int r;
  __asm__ __volatile__("\tint $0x80\n"
                       : "=a"(r)
                       : "a"(106), "b"(path), "c"(st)
                       : "memory");
  return set_errno(r);
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x18(%rbp),%rcx
mov    $0x6a,%eax
int    $0x80
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x0,%al
call   1030 <set_errno@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    $0x6a,%eax
int    $0x80
mov    %eax,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <set_errno@plt>

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 106, i8* %6, %struct.stat* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 106, i8* %0, %struct.stat* %1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}
void tchk_noderefchook_free(void *hook) { return; }


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

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

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

LLVM IR (-O2):
define void @tchk_noderefchook_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callocExample(int);
int /*<<< orphan*/ mallocExample(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  mallocExample(1024 * 1024 * 1024);
  printf("\n");
  callocExample(1024 * 1024 * 1024);
  printf("\n");
  mallocExample(1024 * 1024 * 1024 * 1024L);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40000000,%edi
call   1050 <mallocExample@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x40000000,%edi
call   1040 <callocExample@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <mallocExample@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x40000000,%edi
call   1050 <mallocExample@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x40000000,%edi
call   1040 <callocExample@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <mallocExample@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = call i32 @mallocExample(i32 1073741824)
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @callocExample(i32 1073741824)
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @mallocExample(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mallocExample(i32 1073741824)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @callocExample(i32 1073741824)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @mallocExample(i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
scalar_t__ __glibc_unlikely(int);
int /*<<< orphan*/ *__wcsncpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                              size_t);
wchar_t *__wcsncpy_chk(wchar_t *dest, const wchar_t *src, size_t n,
                       size_t destlen) {
  if (__glibc_unlikely(destlen < n))
    __chk_fail();
  return __wcsncpy(dest, src, n);
}


x86 assembly (clang, -O0):
<__wcsncpy_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__glibc_unlikely@plt>
cmp    $0x0,%rax
je     116e <__wcsncpy_chk+0x3e>
mov    $0x0,%al
call   1030 <__chk_fail@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <__wcsncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wcsncpy_chk>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
cmp    %rdx,%rcx
setb   %dil
call   1040 <__glibc_unlikely@plt>
test   %rax,%rax
je     1158 <__wcsncpy_chk+0x28>
xor    %eax,%eax
call   1030 <__chk_fail@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <__wcsncpy@plt>

LLVM IR (-O0):
define i32* @__wcsncpy_chk(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %7
%11 = icmp ult i64 %9, %10
%12 = zext i1 %11 to i32
%13 = call i64 @__glibc_unlikely(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %4
%16 = call i32 (...) @__chk_fail()
br label %17
17: ; preds = %15, %4
%18 = load i32*, i32** %5
%19 = load i32*, i32** %6
%20 = load i64, i64* %7
%21 = call i32* @__wcsncpy(i32* %18, i32* %19, i64 %20)
ret i32* %21
}

LLVM IR (-O2):
define i32* @__wcsncpy_chk(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = icmp ult i64 %3, %2
%6 = zext i1 %5 to i32
%7 = tail call i64 @__glibc_unlikely(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 (...) @__chk_fail()
br label %11
11: ; preds = %9, %4
%12 = tail call i32* @__wcsncpy(i32* %0, i32* %1, i64 %2)
ret i32* %12
}
void get_cstr(s, buf) unsigned *s;
char *buf;
{
  int n, i;
  n = getbyte(s, 0);
  for (i = 1; i <= n; i++)
    *buf++ = getbyte(s, i);
  *buf = 0;
}


x86 assembly (clang, -O0):
<get_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <getbyte@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1172 <get_cstr+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    $0x0,%al
call   1030 <getbyte@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1137 <get_cstr+0x27>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cstr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
xor    %esi,%esi
xor    %eax,%eax
call   1030 <getbyte@plt>
test   %eax,%eax
jle    1167 <get_cstr+0x57>
mov    %eax,%r15d
neg    %r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <getbyte@plt>
mov    %al,(%r12)
add    $0x1,%r12
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <get_cstr+0x30>
movb   $0x0,(%r12)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @get_cstr(i32* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @getbyte to i32 (i32*, i32, ...)*)(i32* %0, i32 0)
%4 = icmp slt i32 %3, 1
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ 1, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @getbyte to i32 (i32*, i32, ...)*)(i32* %0, i32 %6)
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %9, i8* %7
%11 = add nuw i32 %6, 1
%12 = icmp eq i32 %6, %3
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
char cmplt64(double x, double y) { return x < y; }


x86 assembly (clang, -O0):
<cmplt64>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmplt64>:
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define signext i8 @cmplt64(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @cmplt64(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, unsigned int const);
bool cutils_cdar_DynamicArray_unsigned_int_format(const unsigned int *i,
                                                  char **b, size_t *s) {
  snprintf(*b, *s, "%uu", *i);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_unsigned_int_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
lea    0xec1(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_unsigned_int_format>:
push   %rax
mov    (%rsi),%rax
mov    (%rdx),%rsi
mov    (%rdi),%ecx
lea    0xee0(%rip),%rdx
mov    %rax,%rdi
call   1030 <snprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%uu\00"
define i32 @cutils_cdar_DynamicArray_unsigned_int_format(i32* %0, i8** %1, i64* %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i64*
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = load i64*, i64** %6
%10 = load i64, i64* %9
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = call i32 @snprintf(i8* %8, i64 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%uu\00"
define i32 @cutils_cdar_DynamicArray_unsigned_int_format(i32* nocapture %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = load i32, i32* %0
%7 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 1
}
unsigned int imul_lo_op_08(char a, char b) { return a * b; }


x86 assembly (clang, -O0):
<imul_lo_op_08>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
imul   %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @imul_lo_op_08(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = mul nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @imul_lo_op_08(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = mul nsw i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef float GLfloat;

/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
void matrix_identity(GLfloat m[]) {
  memset(m, 0, sizeof(GLfloat) * 16);
  m[0] = 1.0f;
  m[5] = 1.0f;
  m[10] = 1.0f;
  m[15] = 1.0f;
}


x86 assembly (clang, -O0):
<matrix_identity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movss  0xec8(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0xeb8(%rip),%xmm0
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
movss  0xea7(%rip),%xmm0
movss  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movss  0xe96(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_identity>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movl   $0x3f800000,(%rbx)
movl   $0x3f800000,0x14(%rbx)
movl   $0x3f800000,0x28(%rbx)
movl   $0x3f800000,0x3c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @matrix_identity(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @memset(float* %3, i32 0, i32 64)
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 0
store float 1.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 5
store float 1.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 10
store float 1.000000e+00, float* %10
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 15
store float 1.000000e+00, float* %12
ret void
}

LLVM IR (-O2):
define void @matrix_identity(float* %0) {
%2 = tail call i32 @memset(float* %0, i32 0, i32 64)
store float 1.000000e+00, float* %0
%3 = getelementptr inbounds float, float* %0, i64 5
store float 1.000000e+00, float* %3
%4 = getelementptr inbounds float, float* %0, i64 10
store float 1.000000e+00, float* %4
%5 = getelementptr inbounds float, float* %0, i64 15
store float 1.000000e+00, float* %5
ret void
}