xunge/DecIR huggingface dataset:
/* Type definitions */
struct dfu_file {
  int dummy;
};

/* Variables and functions */
int parse_dfu_suffix(struct dfu_file *);
int /*<<< orphan*/ printf(char *);
int remove_suffix(struct dfu_file *file) {
  int ret;
  ret = parse_dfu_suffix(file);
  if (ret <= 0)
    return 0;
  printf("Suffix removal not implemented on this platform\n");
  return 1;
}


x86 assembly (clang, -O0):
<remove_suffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <parse_dfu_suffix@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     114e <remove_suffix+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1161 <remove_suffix+0x41>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_suffix>:
push   %rax
call   1040 <parse_dfu_suffix@plt>
test   %eax,%eax
jle    113d <remove_suffix+0x1d>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dfu_file = type { i32 }
@.str = [49 x i8] c"Suffix removal not implemented on this platform\0A\00"
define i32 @remove_suffix(%struct.dfu_file* %0) {
%2 = alloca i32
%3 = alloca %struct.dfu_file*
%4 = alloca i32
store %struct.dfu_file* %0, %struct.dfu_file** %3
%5 = load %struct.dfu_file*, %struct.dfu_file** %3
%6 = call i32 @parse_dfu_suffix(%struct.dfu_file* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.dfu_file = type { i32 }
@str = [48 x i8] c"Suffix removal not implemented on this platform\00"
define i32 @remove_suffix(%struct.dfu_file* %0) {
%2 = tail call i32 @parse_dfu_suffix(%struct.dfu_file* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef double int16_t;

/* Variables and functions */
double convert_int16_to_double(void *buf, int i) { return ((int16_t *)buf)[i]; }


x86 assembly (clang, -O0):
<convert_int16_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_int16_to_double>:
movslq %esi,%rax
movsd  (%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @convert_int16_to_double(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to double*
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds double, double* %6, i64 %8
%10 = load double, double* %9
ret double %10
}

LLVM IR (-O2):
define double @convert_int16_to_double(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to double*
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds double, double* %3, i64 %4
%6 = load double, double* %5
ret double %6
}
int test_select_(int a, int b, int c) { return a ? b : c; }


x86 assembly (clang, -O0):
<test_select_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1122 <test_select_+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <test_select_+0x28>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_select_>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_select_(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
ret i32 %5
}
/* Variables and functions */
void WinPrint(char *str, ...) {}


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

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

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

LLVM IR (-O2):
define void @WinPrint(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
double flexible_cylinder_ex_kernel(double, double, double, double, double,
                                   double, double);
double Iq(double q, double length, double kuhn_length, double radius,
          double axis_ratio, double sld, double solvent_sld) {
  double result = flexible_cylinder_ex_kernel(q, length, kuhn_length, radius,
                                              axis_ratio, sld, solvent_sld);
  return result;
}


x86 assembly (clang, -O0):
<Iq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
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  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
movsd  -0x38(%rbp),%xmm6
call   1030 <flexible_cylinder_ex_kernel@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Iq>:
jmp    1030 <flexible_cylinder_ex_kernel@plt>

LLVM IR (-O0):
define double @Iq(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%16 = load double, double* %8
%17 = load double, double* %9
%18 = load double, double* %10
%19 = load double, double* %11
%20 = load double, double* %12
%21 = load double, double* %13
%22 = load double, double* %14
%23 = call double @flexible_cylinder_ex_kernel(double %16, double %17, double %18, double %19, double %20, double %21, double %22)
store double %23, double* %15
%24 = load double, double* %15
ret double %24
}

LLVM IR (-O2):
define double @Iq(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = tail call double @flexible_cylinder_ex_kernel(double %0, double %1, double %2, double %3, double %4, double %5, double %6)
ret double %8
}
void DSP_Stop(void) {}


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

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

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

LLVM IR (-O2):
define void @DSP_Stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_word_string(char *, char);
int main(int argc, char **argv) {
  char input[] = "the sky is blue";
  printf("[before] input : %s\n", input);
  reverse_word_string(input, ' ');
  printf("[after]  input : %s\n", input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x20,%esi
call   1040 <reverse_word_string@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <reverse_word_string@plt>
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.input = [16 x i8] c"the sky is blue\00"
@.str = [21 x i8] c"[before] input : %s\0A\00"
@.str.1 = [21 x i8] c"[after] input : %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [16 x i8]* %6 to i8*
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%11 = call i32 @reverse_word_string(i8* %10, i8 signext 32)
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.input = [16 x i8] c"the sky is blue\00"
@.str = [21 x i8] c"[before] input : %s\0A\00"
@.str.1 = [21 x i8] c"[after] input : %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @reverse_word_string(i8* %4, i8 signext 32)
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
void SteamAPI_ISteamUtils_StartVRDashboard(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamUtils_StartVRDashboard>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUtils_StartVRDashboard = [38 x i8] c"SteamAPI_ISteamUtils_StartVRDashboard\00"
define void @SteamAPI_ISteamUtils_StartVRDashboard(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamUtils_StartVRDashboard, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUtils_StartVRDashboard = [38 x i8] c"SteamAPI_ISteamUtils_StartVRDashboard\00"
define void @SteamAPI_ISteamUtils_StartVRDashboard(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamUtils_StartVRDashboard, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ __m128;

/* Variables and functions */
__m128 __attribute__((__always___, __nodebug__))
_mm_add_ps(__m128 a, __m128 b) {
  return a + b;
}


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

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

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

LLVM IR (-O2):
define i64 @_mm_add_ps(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ error_and_exit(char *, char *, int, char *);
void *cmalloc_aligned_alloc(size_t alignment, size_t size) {
  error_and_exit("CMalloc: Error at %s:%d %s.\n",
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/maokelong/cmalloc/refs/"
                 "heads/master/sources/cmalloc.c",
                 106, "aligned_alloc() called but not implemented");
  return NULL;
}


x86 assembly (clang, -O0):
<cmalloc_aligned_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
lea    0xeef(%rip),%rsi
mov    $0x6a,%edx
lea    0xf73(%rip),%rcx
call   1030 <error_and_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmalloc_aligned_alloc>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xefe(%rip),%rsi
lea    0xf87(%rip),%rcx
mov    $0x6a,%edx
call   1030 <error_and_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"CMalloc: Error at %s:%d %s.\0A\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/maokelong/cmalloc/refs/heads/master/sources/cmalloc.c\00"
@.str.2 = [43 x i8] c"aligned_alloc() called but not implemented\00"
define i8* @cmalloc_aligned_alloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 @error_and_exit(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 106, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [29 x i8] c"CMalloc: Error at %s:%d %s.\0A\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/maokelong/cmalloc/refs/heads/master/sources/cmalloc.c\00"
@.str.2 = [43 x i8] c"aligned_alloc() called but not implemented\00"
define noalias i8* @cmalloc_aligned_alloc(i64 %0, i64 %1) {
%3 = tail call i32 @error_and_exit(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 106, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void sigHandler(int sigNo) {
  printf("Recieved signal alarm\n");
  exit(1);
}


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [23 x i8] c"Recieved signal alarm\0A\00"
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Recieved signal alarm\00"
define void @sigHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ tabulate();
int main() {
  int ch;
  while ((ch = getchar()) != EOF) {
    if (ch == '\t') {
      tabulate();
    } else {
      putchar(ch);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     117b <main+0x4b>
cmpl   $0x9,-0x8(%rbp)
jne    116e <main+0x3e>
mov    $0x0,%al
call   1050 <tabulate@plt>
jmp    1176 <main+0x46>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea9(%rip),%rbx
jmp    115e <main+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1170 <main+0x40>
cmp    $0x9,%eax
jne    1150 <main+0x20>
xor    %eax,%eax
call   1050 <tabulate@plt>
jmp    1157 <main+0x27>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 9
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @tabulate()
br label %15
12: ; preds = %7
%13 = load i32, i32* %2
%14 = call i32 @putchar(i32 %13)
br label %15
15: ; preds = %12, %10
br label %3
16: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %15, label %4
4: ; preds = %0, %11
%5 = phi i32 [ %12, %11 ], [ %1, %0 ]
%6 = icmp eq i32 %5, 9
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @tabulate()
br label %11
9: ; preds = %4
%10 = tail call i32 @putchar(i32 %5)
br label %11
11: ; preds = %9, %7
%12 = tail call i32 (...) @getchar()
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %4
15: ; preds = %11, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ U4(unsigned char *);
int I4(unsigned char *p) { return (int)U4(p); }


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

x86 assembly (clang, -O2):
<I4>:
jmp    1030 <U4@plt>

LLVM IR (-O0):
define i32 @I4(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @U4(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @I4(i8* %0) {
%2 = tail call i64 @U4(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ wNotYet(char *);
char *wPopString();
void wBasRmDir() {
  char *name;
  name = wPopString();
  wNotYet("RmDir");
  free(name);
}


x86 assembly (clang, -O0):
<wBasRmDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb6(%rip),%rdi
call   1050 <wNotYet@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasRmDir>:
push   %rbx
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
call   1050 <wNotYet@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"RmDir\00"
define void @wBasRmDir() {
%1 = alloca i8*
%2 = call i8* (...) @wPopString()
store i8* %2, i8** %1
%3 = call i32 @wNotYet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"RmDir\00"
define void @wBasRmDir() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i32 @wNotYet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello from file2.c\n");
  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    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Hello from file2.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int Ack(int, int);
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  if (x < 0) {
    return 0;
  }
  int r = Ack(x, y);
  return r;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1159 <main+0x39>
movl   $0x0,-0x4(%rbp)
jmp    116d <main+0x4d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <Ack@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %ebx,%ebx
js     113f <main+0x1f>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <Ack@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %15
10: ; preds = %0
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @Ack(i32 %11, i32 %12)
store i32 %13, i32* %4
%14 = load i32, i32* %4
store i32 %14, i32* %1
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp slt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @Ack(i32 %1, i32 %2)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ %5, %4 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ GETVAL;
scalar_t__ semctl(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
bool qsem_check(int semid, int semno) {
  if (semctl(semid, semno, GETVAL, 0) == 0)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<qsem_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <semctl@plt>
cmp    $0x0,%rax
jne    114a <qsem_check+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <qsem_check+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsem_check>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <semctl@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@GETVAL = global i32 0
define i32 @qsem_check(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = load i32, i32* @GETVAL
%9 = call i64 @semctl(i32 %6, i32 %7, i32 %8, i32 0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@GETVAL = global i32 0
define i32 @qsem_check(i32 %0, i32 %1) {
%3 = load i32, i32* @GETVAL
%4 = tail call i64 @semctl(i32 %0, i32 %1, i32 %3, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int math_max(int arg1, int arg2) { return arg1 > arg2 ? arg1 : arg2; }


x86 assembly (clang, -O0):
<math_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <math_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <math_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @math_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec bench_start(void) {
  struct timespec start_t;
  clock_gettime(CLOCK_REALTIME, &start_t);
  return start_t;
}


x86 assembly (clang, -O0):
<bench_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_start>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @bench_start() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @bench_start() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int superfatorial(int);
int main() {
  printf("O superfatorial de 4: %d", superfatorial(4));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"O superfatorial de 4: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @superfatorial(i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"O superfatorial de 4: %d\00"
define i32 @main() {
%1 = tail call i32 @superfatorial(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
double magnitude(float *);
float *scale(float *, float *, double);
float *normalize(float v[3], float a[3]) {
  return scale(v, a, 1.0 / magnitude(a));
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <magnitude@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movaps %xmm0,%xmm1
movsd  0xea4(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1040 <scale@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <magnitude@plt>
movsd  0xec6(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    %r14,%rdi
mov    %rbx,%rsi
movapd %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <scale@plt>

LLVM IR (-O0):
define float* @normalize(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = load float*, float** %4
%8 = call double @magnitude(float* %7)
%9 = fdiv double 1.000000e+00, %8
%10 = call float* @scale(float* %5, float* %6, double %9)
ret float* %10
}

LLVM IR (-O2):
define float* @normalize(float* %0, float* %1) {
%3 = tail call double @magnitude(float* %1)
%4 = fdiv double 1.000000e+00, %3
%5 = tail call float* @scale(float* %0, float* %1, double %4)
ret float* %5
}
void foo757(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo757(i32 %0) {
ret void
}
/* Variables and functions */
double pow(double, double);
double linear_to_srgb(double v_linear) {
  if (v_linear <= 0.0031308) {
    return v_linear * 12.92;
  } else {
    return 1.055 * pow(v_linear, 1.0 / 2.4) - 0.055;
  }
}


x86 assembly (clang, -O0):
<linear_to_srgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1147 <linear_to_srgb+0x37>
movsd  0xee8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <linear_to_srgb+0x66>
movsd  -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xea7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_to_srgb>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    113e <linear_to_srgb+0x2e>
movsd  0xee9(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee4(%rip),%xmm0
addsd  0xee4(%rip),%xmm0
pop    %rax
ret
mulsd  0xec2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @linear_to_srgb(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 3.130800e-03
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double %7, 1.292000e+01
store double %8, double* %2
br label %13
9: ; preds = %1
%10 = load double, double* %3
%11 = call double @pow(double %10, double 0x3FDAAAAAAAAAAAAB)
%12 = call double @llvm.fmuladd.f64(double 1.055000e+00, double %11, double -5.500000e-02)
store double %12, double* %2
br label %13
13: ; preds = %9, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @linear_to_srgb(double %0) {
%2 = fcmp ugt double %0, 3.130800e-03
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fmul double %0, 1.292000e+01
br label %8
5: ; preds = %1
%6 = tail call double @pow(double %0, double 0x3FDAAAAAAAAAAAAB)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.055000e+00, double -5.500000e-02)
br label %8
8: ; preds = %5, %3
%9 = phi double [ %4, %3 ], [ %7, %5 ]
ret double %9
}
double __NAN() {
  typedef union {
    unsigned char b[8];
    double d;
  } kjs_double_t;
  static const kjs_double_t NaN_Bytes = {{0, 0, 0, 0, 0, 0, 0xf8, 0x7f}};
  const double NaN = NaN_Bytes.d;
  return NaN;
}


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

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

LLVM IR (-O0):
@__NAN.NaN_Bytes = internal constant { [8 x i8] } { [8 x i8] c"\00\00\00\00\00\00\F8\7F" }
define double @__NAN() {
%1 = alloca double
%2 = load double, double* bitcast ({ [8 x i8] }* @__NAN.NaN_Bytes to double*)
store double %2, double* %1
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @__NAN() {
ret double 0x7FF8000000000000
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int test_memcpy() {
  char x[10];
  strcpy(x, "foobar");
  if (x[3] == 'b') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<test_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xe(%rbp),%rdi
lea    0xedd(%rip),%rsi
call   1030 <strcpy@plt>
movsbl -0xb(%rbp),%eax
cmp    $0x62,%eax
jne    1141 <test_memcpy+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <test_memcpy+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_memcpy>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
cmpb   $0x62,0x11(%rsp)
sete   %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"foobar\00"
define i32 @test_memcpy() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 98
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"foobar\00"
define i32 @test_memcpy() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 98
%7 = zext i1 %6 to i32
ret i32 %7
}
const char *kokrot_api_version() { return "1.0-arkona"; }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"1.0-arkona\00"
define i8* @kokrot_api_version() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
signed char to_sign_char(__float128 a) { return (signed char)a; }


x86 assembly (clang, -O0):
<to_sign_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
call   1120 <__fixtfsi>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret
xchg   %ax,%ax

x86 assembly (clang, -O2):
<to_sign_char>:
push   %rax
call   1110 <__fixtfsi>
pop    %rcx
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define signext i8 @to_sign_char(fp128 %0) {
%2 = alloca fp128
store fp128 %0, fp128* %2
%3 = load fp128, fp128* %2
%4 = fptosi fp128 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @to_sign_char(fp128 %0) {
%2 = fptosi fp128 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ fmt_strlen(char const *);
int /*<<< orphan*/ print(char const *, int /*<<< orphan*/);
void print_str(const char *str) { print(str, fmt_strlen(str)); }


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

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

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

LLVM IR (-O2):
define void @print_str(i8* %0) {
%2 = tail call i32 @fmt_strlen(i8* %0)
%3 = tail call i32 @print(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  int i;
  int rand_num;
  for (i = 1; i <= 20; i++) {
    rand_num = (rand() % (4 - (-4))) + (-4);
    printf("%d\n", rand_num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jg     11a2 <main+0x62>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0xfffffffc,%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x14,%ebp
lea    0xea3(%rip),%rbx
nopl   (%rax)
xor    %eax,%eax
call   1060 <rand@plt>
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0xfffffffc,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1160 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 1, %0 ], [ %9, %3 ]
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 8
%7 = add nsw i32 %6, -4
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, 21
br i1 %10, label %11, label %3
11: ; preds = %3
ret i32 0
}
void cmov2i_(x, y) int *x, *y;
{ cmov((float)*x, (float)*y, 0.0); }


x86 assembly (clang, -O0):
<cmov2i_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
call   1030 <cmov@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmov2i_>:
cvtsi2ssl (%rdi),%xmm0
cvtsi2ssl (%rsi),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <cmov@plt>

LLVM IR (-O0):
define void @cmov2i_(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to float
%8 = fpext float %7 to double
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to float
%12 = fpext float %11 to double
%13 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cmov to i32 (double, double, double, ...)*)(double %8, double %12, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @cmov2i_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = sitofp i32 %3 to float
%5 = fpext float %4 to double
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = fpext float %7 to double
%9 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cmov to i32 (double, double, double, ...)*)(double %5, double %8, double 0.000000e+00)
ret void
}
/* Variables and functions */
int power2(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", power2(4));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @power2(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ swap(char **, char **);
int main(void) {
  char *string1 = "This is the first string.";
  char *string2 = "This is the second string.";
  swap(&string1, &string2);
  printf("string1 = %s and string2 = %s\n", string1, string2);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xee3(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap@plt>
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rdx
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"This is the first string.\00"
@.str.1 = [27 x i8] c"This is the second string.\00"
@.str.2 = [31 x i8] c"string1 = %s and string2 = %s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = call i32 @swap(i8** %1, i8** %2)
%4 = load i8*, i8** %1
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %4, i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"This is the first string.\00"
@.str.1 = [27 x i8] c"This is the second string.\00"
@.str.2 = [31 x i8] c"string1 = %s and string2 = %s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = bitcast i8** %1 to i8*
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = bitcast i8** %2 to i8*
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %2
%5 = call i32 @swap(i8** %1, i8** %2)
%6 = load i8*, i8** %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %7)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void coap_option_nibble(uint8_t value, uint8_t *nibble) {
  if (value < 13) {
    *nibble = (0xFF & value);
  } else if (value <= 0xFF + 13) {
    *nibble = 13;
  } else if (value <= 0xFFFF + 269) {
    *nibble = 14;
  }
}


x86 assembly (clang, -O0):
<coap_option_nibble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xd,-0x4(%rbp)
jge    1129 <coap_option_nibble+0x29>
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1166 <coap_option_nibble+0x66>
cmpl   $0x10c,-0x4(%rbp)
jg     1145 <coap_option_nibble+0x45>
mov    -0x10(%rbp),%rax
movl   $0xd,(%rax)
jmp    1161 <coap_option_nibble+0x61>
cmpl   $0x1010c,-0x4(%rbp)
jg     115c <coap_option_nibble+0x5c>
mov    -0x10(%rbp),%rax
movl   $0xe,(%rax)
jmp    1161 <coap_option_nibble+0x61>
jmp    1166 <coap_option_nibble+0x66>
pop    %rbp
ret

x86 assembly (clang, -O2):
<coap_option_nibble>:
cmp    $0xc,%edi
jg     110b <coap_option_nibble+0xb>
movzbl %dil,%eax
jmp    1125 <coap_option_nibble+0x25>
mov    $0xd,%eax
cmp    $0x10d,%edi
jb     1125 <coap_option_nibble+0x25>
mov    $0xe,%eax
cmp    $0x1010c,%edi
ja     1127 <coap_option_nibble+0x27>
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @coap_option_nibble(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 = icmp slt i32 %5, 13
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = and i32 255, %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
br label %23
11: ; preds = %2
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 268
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32*, i32** %4
store i32 13, i32* %15
br label %22
16: ; preds = %11
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 65804
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load i32*, i32** %4
store i32 14, i32* %20
br label %21
21: ; preds = %19, %16
br label %22
22: ; preds = %21, %14
br label %23
23: ; preds = %22, %7
ret void
}

LLVM IR (-O2):
define void @coap_option_nibble(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 13
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = and i32 %0, 255
br label %10
6: ; preds = %2
%7 = icmp ult i32 %0, 269
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = icmp ult i32 %0, 65805
br i1 %9, label %10, label %12
10: ; preds = %8, %6, %4
%11 = phi i32 [ %5, %4 ], [ 13, %6 ], [ 14, %8 ]
store i32 %11, i32* %1
br label %12
12: ; preds = %10, %8
ret void
}