xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ options_print();
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: clQueue [options]\n");
  options_print();
  return;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <options_print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <options_print@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: clQueue [options]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @options_print()
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Usage: clQueue [options]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @options_print()
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_replace_quaddobl_solution(int n, int k, int m, double *sol) {
  int b[2], fail;
  b[0] = n;
  b[1] = m;
  fail = _ada_use_c2phc(395, &k, b, sol);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_replace_quaddobl_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x18b,%edi
lea    -0x8(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_replace_quaddobl_solution>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    %edi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0x18b,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @solcon_replace_quaddobl_solution(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca [2 x i32]
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
%11 = load i32, i32* %5
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %7
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load double*, double** %8
%17 = call i32 @_ada_use_c2phc(i32 395, i32* %6, i32* %15, double* %16)
store i32 %17, i32* %10
%18 = load i32, i32* %10
ret i32 %18
}

LLVM IR (-O2):
define i32 @solcon_replace_quaddobl_solution(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %1, i32* %5
%7 = bitcast [2 x i32]* %6 to i8*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 %0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %2, i32* %9
%10 = call i32 @_ada_use_c2phc(i32 395, i32* %5, i32* %8, double* %3)
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int L_tmpnam;
int /*<<< orphan*/ *fopen(char *, char *);
char *tmpnam(char *);
FILE *tmpfile() {
  char name[L_tmpnam];
  if (tmpnam(name) != name)
    return NULL;
  return fopen(name, "wb+");
}


x86 assembly (clang, -O0):
<tmpfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1040 <tmpnam@plt>
mov    -0x28(%rbp),%rcx
cmp    %rcx,%rax
je     117a <tmpfile+0x5a>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    1195 <tmpfile+0x75>
mov    -0x28(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpfile>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <tmpnam@plt>
cmp    %rbx,%rax
je     1151 <tmpfile+0x31>
xor    %eax,%eax
jmp    1160 <tmpfile+0x40>
lea    0xea8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <fopen@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@L_tmpnam = global i32 0
@.str = [4 x i8] c"wb+\00"
define i32* @tmpfile() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
%5 = load i32, i32* @L_tmpnam
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i8, i64 %6
store i64 %6, i64* %3
%9 = call i8* @tmpnam(i8* %8)
%10 = icmp ne i8* %9, %8
br i1 %10, label %11, label %12
11: ; preds = %0
store i32* null, i32** %1
store i32 1, i32* %4
br label %14
12: ; preds = %0
%13 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32* %13, i32** %1
store i32 1, i32* %4
br label %14
14: ; preds = %12, %11
%15 = load i8*, i8** %2
%16 = load i32*, i32** %1
ret i32* %16
}

LLVM IR (-O2):
@L_tmpnam = global i32 0
@.str = [4 x i8] c"wb+\00"
define noalias i32* @tmpfile() {
%1 = load i32, i32* @L_tmpnam
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = call i8* @tmpnam(i8* %3)
%5 = icmp eq i8* %4, %3
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
%9 = phi i32* [ %7, %6 ], [ null, %0 ]
ret i32* %9
}
/* Variables and functions */
int nbDigits(int x) { return (x != 0) ? (int)(log10(abs(x))) + 1 : 1; }


x86 assembly (clang, -O0):
<nbDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1155 <nbDigits+0x35>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
cvtsi2sd %eax,%xmm0
call   1040 <log10@plt>
cvttsd2si %xmm0,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <nbDigits+0x42>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <nbDigits+0x42>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nbDigits>:
test   %edi,%edi
je     1131 <nbDigits+0x21>
push   %rax
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
cvtsi2sd %eax,%xmm0
call   1030 <log10@plt>
cvttsd2si %xmm0,%eax
add    $0x1,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @nbDigits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%5 = sitofp i32 %4 to double
%6 = tail call double @log10(double %5)
%7 = fptosi double %6 to i32
%8 = add nsw i32 %7, 1
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ 1, %1 ]
ret i32 %10
}
void Byt_TYPE_dummy__() { ; }


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

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

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

LLVM IR (-O2):
define void @Byt_TYPE_dummy__() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() { printf("%x\n", sizeof(unsigned short)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = 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"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
char *memory_Malloc(int);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *string_Prefix(const char *s, int i) {
  char *dst;
  dst = memory_Malloc(i + 1);
  strncpy(dst, s, i);
  dst[i] = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<string_Prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1030 <memory_Malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_Prefix>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1030 <memory_Malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <strncpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @string_Prefix(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i8* @memory_Malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @strncpy(i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @string_Prefix(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @memory_Malloc(i32 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int stderr_close(void) {
  fflush(stderr);
  return 0;
}


x86 assembly (clang, -O0):
<stderr_close>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stderr_close>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
define i32 @stderr_close() {
%1 = load i32, i32* @stderr
%2 = call i32 @fflush(i32 %1)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @stderr_close() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fflush(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void ZSTD_copy16(void *dst, const void *src) { memcpy(dst, src, 16); }


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

x86 assembly (clang, -O2):
<ZSTD_copy16>:
mov    $0x10,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @ZSTD_copy16(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 16)
ret void
}

LLVM IR (-O2):
define void @ZSTD_copy16(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 16)
ret void
}
const char *CFilterFactoryName(void *arg) { return "foo"; }


x86 assembly (clang, -O0):
<CFilterFactoryName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i8* @CFilterFactoryName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @CFilterFactoryName(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__18__IO__set();
void LedsP__Led0__set(void) { HplAtm128GeneralIOPinP__18__IO__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__18__IO__set()
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int_val();
int main() {
  int x = __VERIFIER_nondet_int_val();
  int y = __VERIFIER_nondet_int_val();
  int z = 0;
  while (x > 0) {
    x--;
    if (x == y)
      z = 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int_val@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int_val@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1165 <main+0x55>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1160 <main+0x50>
movl   $0x1,-0x10(%rbp)
jmp    113a <main+0x2a>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int_val@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int_val@plt>
xor    %eax,%eax
pop    %rcx
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_val()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int_val()
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, -1
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %4
br label %17
17: ; preds = %16, %10
br label %7
18: ; preds = %7
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int_val()
%2 = tail call i32 (...) @__VERIFIER_nondet_int_val()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MQTTStrncpy(char *, char const *, size_t);
char *mymalloc(char *, int, size_t);
int strlen(char const *);
char *MQTTStrdup(const char *src) {
  size_t mlen = strlen(src) + 1;
  char *temp = mymalloc(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/taidalab/openwrt_widora/refs/heads/master/"
      "package/iot_gw_nxp/src/IotCommon/mqtt/MQTTProtocolClient.c",
      772, mlen);
  MQTTStrncpy(temp, src, mlen);
  return temp;
}


x86 assembly (clang, -O0):
<MQTTStrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xea7(%rip),%rdi
mov    $0x304,%esi
call   1050 <mymalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <MQTTStrncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MQTTStrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
lea    0xeb6(%rip),%rdi
mov    $0x304,%esi
mov    %r15,%rdx
call   1050 <mymalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <MQTTStrncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [191 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/taidalab/openwrt_widora/refs/heads/master/package/iot_gw_nxp/src/IotCommon/mqtt/MQTTProtocolClient.c\00"
define i8* @MQTTStrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @mymalloc(i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str, i64 0, i64 0), i32 772, i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @MQTTStrncpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
@.str = [191 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/taidalab/openwrt_widora/refs/heads/master/package/iot_gw_nxp/src/IotCommon/mqtt/MQTTProtocolClient.c\00"
define i8* @MQTTStrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @mymalloc(i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str, i64 0, i64 0), i32 772, i64 %4)
%6 = tail call i32 @MQTTStrncpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
float sinf(float);
float _sin(float n) { return sinf(n); }


x86 assembly (clang, -O0):
<_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sin>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @_sin(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
int main() { return 255; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 255
}
/* Variables and functions */
int /*<<< orphan*/ outop2str(char *);
void outsub() { outop2str("SUB"); }


x86 assembly (clang, -O0):
<outsub>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <outop2str@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"SUB\00"
define void @outsub() {
%1 = call i32 @outop2str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"SUB\00"
define void @outsub() {
%1 = tail call i32 @outop2str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ twoDsim_useTimeDelay(unsigned int);
void use_time_delay(unsigned int on) { twoDsim_useTimeDelay(on); }


x86 assembly (clang, -O0):
<use_time_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <twoDsim_useTimeDelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_time_delay>:
jmp    1030 <twoDsim_useTimeDelay@plt>

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

LLVM IR (-O2):
define void @use_time_delay(i32 %0) {
%2 = tail call i32 @twoDsim_useTimeDelay(i32 %0)
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, int);
void check_error() {
  if (errno) {
    printf("ERR %d\n", errno);
    errno = 0;
  }
}


x86 assembly (clang, -O0):
<check_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
cmpl   $0x0,(%rax)
je     1146 <check_error+0x36>
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_error>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
test   %esi,%esi
je     1130 <check_error+0x20>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [8 x i8] c"ERR %d\0A\00"
define void @check_error() {
%1 = load i32, i32* @errno
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @errno
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 0, i32* @errno
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [8 x i8] c"ERR %d\0A\00"
define void @check_error() {
%1 = load i32, i32* @errno
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
store i32 0, i32* @errno
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
unsigned char cpu_get_r8(struct cpu *, int);
unsigned char cpu_get_e(struct cpu *cpu) { return cpu_get_r8(cpu, (4)); }


x86 assembly (clang, -O0):
<cpu_get_e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <cpu_get_r8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_get_e>:
mov    $0x4,%esi
jmp    1030 <cpu_get_r8@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define zeroext i8 @cpu_get_e(%struct.cpu* %0) {
%2 = alloca %struct.cpu*
store %struct.cpu* %0, %struct.cpu** %2
%3 = load %struct.cpu*, %struct.cpu** %2
%4 = call zeroext i8 @cpu_get_r8(%struct.cpu* %3, i32 4)
ret i8 %4
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define zeroext i8 @cpu_get_e(%struct.cpu* %0) {
%2 = tail call zeroext i8 @cpu_get_r8(%struct.cpu* %0, i32 4)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
scalar_t__ ceph_frag_mask(int /*<<< orphan*/);
scalar_t__ ceph_frag_value(int /*<<< orphan*/);
int ceph_frag_is_rightmost(__u32 f) {
  return ceph_frag_value(f) == ceph_frag_mask(f);
}


x86 assembly (clang, -O0):
<ceph_frag_is_rightmost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ceph_frag_value@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ceph_frag_mask@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_frag_is_rightmost>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <ceph_frag_value@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1040 <ceph_frag_mask@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ceph_frag_is_rightmost(i32 %0) {
%2 = tail call i64 @ceph_frag_value(i32 %0)
%3 = tail call i64 @ceph_frag_mask(i32 %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sleep(int);
void *safe_malloc(unsigned int siz) {
  void *p;
  if (siz == 0)
    return 0;
  if ((p = (void *)malloc(siz)) == 0) {
    perror("Out of memory!");
    sleep(1);
    exit(1);
  }
  return (p);
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1162 <safe_malloc+0x22>
movq   $0x0,-0x8(%rbp)
jmp    11a0 <safe_malloc+0x60>
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1198 <safe_malloc+0x58>
lea    0xe81(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rax
test   %edi,%edi
je     1151 <safe_malloc+0x11>
call   1030 <malloc@plt>
test   %rax,%rax
je     1155 <safe_malloc+0x15>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
lea    0xea4(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory!\00"
define i8* @safe_malloc(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @sleep(i32 1)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %8
%18 = load i8*, i8** %4
store i8* %18, i8** %2
br label %19
19: ; preds = %17, %7
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory!\00"
define i8* @safe_malloc(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i64 @malloc(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @sleep(i32 1)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
%11 = inttoptr i64 %4 to i8*
br label %12
12: ; preds = %1, %10
%13 = phi i8* [ %11, %10 ], [ null, %1 ]
ret i8* %13
}
/* Variables and functions */
char *fm_abs(char *);
int /*<<< orphan*/ free(char *);
int unlink(char *);
int fm_rm(char *fname, char *opts) {
  int r;
  char *fpath = fm_abs(fname);
  if (fpath == NULL)
    return -1;
  r = unlink(fpath);
  do {
    if ((fpath) != NULL) {
      free(fpath);
      (fpath) = NULL;
    }
  } while (0);
  return r;
}


x86 assembly (clang, -O0):
<fm_rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <fm_abs@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1164 <fm_rm+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1197 <fm_rm+0x67>
mov    -0x28(%rbp),%rdi
call   1040 <unlink@plt>
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     118c <fm_rm+0x5c>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x28(%rbp)
jmp    1191 <fm_rm+0x61>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fm_rm>:
push   %rbp
push   %rbx
push   %rax
call   1050 <fm_abs@plt>
test   %rax,%rax
je     1156 <fm_rm+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <unlink@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    115b <fm_rm+0x2b>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fm_rm(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i8* @fm_abs(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @unlink(i8* %3)
%7 = tail call i32 @free(i8* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
void *pattern_search(void const *, int, int, int, int);
void *bl_search_down(const void *start_addr, int len) {
  return pattern_search(start_addr, len, 0xD000F000, 0xD000F800, 1);
}


x86 assembly (clang, -O0):
<bl_search_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0xd000f000,%edx
mov    $0xd000f800,%ecx
mov    $0x1,%r8d
call   1030 <pattern_search@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bl_search_down>:
mov    $0xd000f000,%edx
mov    $0xd000f800,%ecx
mov    $0x1,%r8d
jmp    1030 <pattern_search@plt>

LLVM IR (-O0):
define i8* @bl_search_down(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 = load i32, i32* %4
%7 = call i8* @pattern_search(i8* %5, i32 %6, i32 -805244928, i32 -805242880, i32 1)
ret i8* %7
}

LLVM IR (-O2):
define i8* @bl_search_down(i8* %0, i32 %1) {
%3 = tail call i8* @pattern_search(i8* %0, i32 %1, i32 -805244928, i32 -805242880, i32 1)
ret i8* %3
}
float speedController(float input) { return input / 100; }


x86 assembly (clang, -O0):
<speedController>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @speedController(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 1.000000e+02
ret float %4
}

LLVM IR (-O2):
define float @speedController(float %0) {
%2 = fdiv float %0, 1.000000e+02
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int capitest() {
  printf("capi called\n");
  return 1;
}


x86 assembly (clang, -O0):
<capitest>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"capi called\0A\00"
define i32 @capitest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [12 x i8] c"capi called\00"
define i32 @capitest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void lb_abort(void) { abort(); }


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

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

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

LLVM IR (-O2):
define void @lb_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
void foo(float *a, float *b) { a[0] = b[0]; }


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

x86 assembly (clang, -O2):
<foo>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @foo(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
ret void
}

LLVM IR (-O2):
define void @foo(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call(char *);
asl() { call("ccasl"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"ccasl\00"
define i32 @asl() {
%1 = tail call i32 @call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  int i;
  char *a[] = {"Carrot", "Onion", "Potato"};
  char **p = a;
  for (i = 0; i < 3; i++) {
    printf("%c\n", p[i][1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cd7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cd4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1183 <main+0x73>
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
lea    0xea8(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <main+0x3f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6e,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6f,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.3 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext 97)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext 110)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext 111)
ret i32 0
}
/* Variables and functions */
int isalpha(int);
int Characters__isalpha(char c) { return isalpha((int)c); }


x86 assembly (clang, -O0):
<Characters__isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Characters__isalpha>:
jmp    1030 <isalpha@plt>

LLVM IR (-O0):
define i32 @Characters__isalpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i32 @isalpha(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @Characters__isalpha(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 @isalpha(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, ...);
void debug_print_vec(const char *fmt, const char *data, int len) {
  int i;
  for (i = 0; i < len; ++i)
    printf(fmt, data[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<debug_print_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <debug_print_vec+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <debug_print_vec+0x1a>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_print_vec>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1158 <debug_print_vec+0x38>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <debug_print_vec+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @debug_print_vec(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
%16 = tail call i32 @putchar(i32 10)
ret void
}
int test_imm_09int32_mem(int *val) {
  return ((*val) & (0x09 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_09int32_mem>:
testb  $0x9,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_09int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 9
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *calloc(unsigned int, unsigned int);
int /*<<< orphan*/ no_space();
char *allocate(unsigned int n) {
  register char *p;
  p = NULL;
  if (n) {
    p = (calloc((unsigned)(1), (unsigned)(n)));
    if (!p)
      no_space();
  }
  return (p);
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1165 <allocate+0x45>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <allocate+0x40>
mov    $0x0,%al
call   1030 <no_space@plt>
jmp    1165 <allocate+0x45>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rbx
test   %edi,%edi
je     1144 <allocate+0x24>
mov    %edi,%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <allocate+0x26>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <no_space@plt>
jmp    1146 <allocate+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @allocate(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @calloc(i32 1, i32 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @no_space()
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ %4, %3 ], [ null, %6 ], [ null, %1 ]
ret i8* %9
}
double calc_cool_obj(temp, tempcrit)
double temp, tempcrit;
{
  double value;
  value = (temp * temp) / (tempcrit * tempcrit * 10);
  return (value);
}


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

x86 assembly (clang, -O2):
<calc_cool_obj>:
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
mulsd  0xef0(%rip),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calc_cool_obj(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = fmul double %11, 1.000000e+01
%13 = fdiv double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @calc_cool_obj(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fmul double %1, %1
%5 = fmul double %4, 1.000000e+01
%6 = fdiv double %3, %5
ret double %6
}
/* Variables and functions */
float __ocml_rint_f32(float);
float rintf(float x) { return __ocml_rint_f32(x); }


x86 assembly (clang, -O0):
<rintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__ocml_rint_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintf>:
jmp    1030 <__ocml_rint_f32@plt>

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

LLVM IR (-O2):
define float @rintf(float %0) {
%2 = tail call float @__ocml_rint_f32(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
void volatile_fetch_xor_u16(uint16_t *dest, uint16_t val) {
  *((volatile uint16_t *)dest) ^= val;
}


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

x86 assembly (clang, -O2):
<volatile_fetch_xor_u16>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
xor    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @volatile_fetch_xor_u16(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = load volatile i32, i32* %0
%6 = xor i32 %5, %4
store volatile i32 %6, i32* %0
ret void
}
/* Variables and functions */
char *alloca(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ system(char *);
void reap_user(int uid) {
  char *tmp = alloca(100);
  snprintf(tmp, 100, "ps --no-headers -o pid -u %d | xargs -r -n 1 kill -9",
           uid);
  system(tmp);
}


x86 assembly (clang, -O0):
<reap_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x64,%edi
call   1050 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x64,%esi
lea    0xea4(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reap_user>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x64,%edi
call   1050 <alloca@plt>
mov    %rax,%rbx
lea    0xeb7(%rip),%rdx
mov    %rax,%rdi
mov    $0x64,%esi
mov    %ebp,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"ps --no-headers -o pid -u %d | xargs -r -n 1 kill -9\00"
define void @reap_user(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @alloca(i32 100)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* %5, i32 100, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @system(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"ps --no-headers -o pid -u %d | xargs -r -n 1 kill -9\00"
define void @reap_user(i32 %0) {
%2 = tail call i8* @alloca(i32 100)
%3 = tail call i32 @snprintf(i8* %2, i32 100, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @system(i8* %2)
ret void
}