xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fran32_print(int *);
void test_ref(void) {
  int idum;
  idum = -1;
  (void)fran32_print(&idum);
  idum = 99;
  (void)fran32_print(&idum);
  idum = -99;
  (void)fran32_print(&idum);
  idum = 99;
  (void)fran32_print(&idum);
}


x86 assembly (clang, -O0):
<test_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <fran32_print@plt>
movl   $0x63,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <fran32_print@plt>
movl   $0xffffff9d,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <fran32_print@plt>
movl   $0x63,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <fran32_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ref>:
push   %rbx
sub    $0x10,%rsp
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <fran32_print@plt>
movl   $0x63,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <fran32_print@plt>
movl   $0xffffff9d,0xc(%rsp)
ff
mov    %rbx,%rdi
call   1030 <fran32_print@plt>
movl   $0x63,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <fran32_print@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test_ref() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 @fran32_print(i32* %1)
store i32 99, i32* %1
%3 = call i32 @fran32_print(i32* %1)
store i32 -99, i32* %1
%4 = call i32 @fran32_print(i32* %1)
store i32 99, i32* %1
%5 = call i32 @fran32_print(i32* %1)
ret void
}

LLVM IR (-O2):
define void @test_ref() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
%3 = call i32 @fran32_print(i32* %1)
store i32 99, i32* %1
%4 = call i32 @fran32_print(i32* %1)
store i32 -99, i32* %1
%5 = call i32 @fran32_print(i32* %1)
store i32 99, i32* %1
%6 = call i32 @fran32_print(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
char *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
char *getLine() {
  char buf[8];
  char *result;
  gets(buf);
  result = malloc(strlen(buf));
  strcpy(result, buf);
  return result;
}


x86 assembly (clang, -O0):
<getLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLine>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <gets@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @getLine() {
%1 = alloca [8 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @getLine() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = call i8* @malloc(i32 %4)
%6 = call i32 @strcpy(i8* %5, i8* %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ flush_problems();
void retch(char *reason) {
  flush_problems();
  error(99, 0, "(internal error) %s!", reason);
}


x86 assembly (clang, -O0):
<retch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <flush_problems@plt>
mov    -0x8(%rbp),%rcx
mov    $0x63,%edi
xor    %esi,%esi
lea    0xebb(%rip),%rdx
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retch>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <flush_problems@plt>
lea    0xece(%rip),%rdx
mov    $0x63,%edi
xor    %esi,%esi
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"(internal error) %s!\00"
define void @retch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @flush_problems()
%4 = load i8*, i8** %2
%5 = call i32 @error(i32 99, i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"(internal error) %s!\00"
define void @retch(i8* %0) {
%2 = tail call i32 (...) @flush_problems()
%3 = tail call i32 @error(i32 99, i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double randDecimal(void) { return (double)rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<randDecimal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randDecimal>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @randDecimal() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @randDecimal() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
int main(void) {
  unsigned char uc;
  signed char sc;
  uc = -1;
  uc = '\x23';
  uc = 1u;
  uc = 1025;
  uc = 'A';
  sc = -1;
  sc = '\x23';
  sc = 1u;
  sc = 1025;
  sc = 'A';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movb   $0xff,-0x1(%rbp)
movb   $0x23,-0x1(%rbp)
movb   $0x1,-0x1(%rbp)
movb   $0x1,-0x1(%rbp)
movb   $0x41,-0x1(%rbp)
movb   $0xff,-0x2(%rbp)
movb   $0x23,-0x2(%rbp)
movb   $0x1,-0x2(%rbp)
movb   $0x1,-0x2(%rbp)
movb   $0x41,-0x2(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int length_fast(char *string) {
  int i;
  for (i = 0; '\0' != *string; ++i) {
    ++string;
  }
  return i;
}


x86 assembly (clang, -O0):
<length_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     113a <length_fast+0x3a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length_fast+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_fast>:
cmpb   $0x0,(%rdi)
je     111c <length_fast+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <length_fast+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @length_fast(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
struct sockaddr_in6 {
  scalar_t__ sin6_family;
};
struct ndm_ip_sockaddr_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ AF_INET6;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(struct ndm_ip_sockaddr_t *,
                          struct sockaddr_in6 const *const, int);
void ndm_ip_sockaddr_assign6(struct ndm_ip_sockaddr_t *sa,
                             const struct sockaddr_in6 *const in6) {
  assert(in6->sin6_family == AF_INET6);
  memcpy(sa, in6, sizeof(*in6));
}


x86 assembly (clang, -O0):
<ndm_ip_sockaddr_assign6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndm_ip_sockaddr_assign6>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%rax
mov    0x2eb4(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%rax
sete   %dil
call   1030 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
%struct.ndm_ip_sockaddr_t = type { i32 }
%struct.sockaddr_in6 = type { i64 }
@AF_INET6 = global i64 0
define void @ndm_ip_sockaddr_assign6(%struct.ndm_ip_sockaddr_t* %0, %struct.sockaddr_in6* %1) {
%3 = alloca %struct.ndm_ip_sockaddr_t*
%4 = alloca %struct.sockaddr_in6*
store %struct.ndm_ip_sockaddr_t* %0, %struct.ndm_ip_sockaddr_t** %3
store %struct.sockaddr_in6* %1, %struct.sockaddr_in6** %4
%5 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %4
%6 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = load i64, i64* @AF_INET6
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load %struct.ndm_ip_sockaddr_t*, %struct.ndm_ip_sockaddr_t** %3
%13 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %4
%14 = call i32 @memcpy(%struct.ndm_ip_sockaddr_t* %12, %struct.sockaddr_in6* %13, i32 8)
ret void
}

LLVM IR (-O2):
%struct.ndm_ip_sockaddr_t = type { i32 }
%struct.sockaddr_in6 = type { i64 }
@AF_INET6 = global i64 0
define void @ndm_ip_sockaddr_assign6(%struct.ndm_ip_sockaddr_t* %0, %struct.sockaddr_in6* %1) {
%3 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %1, i64 0, i32 0
%4 = load i64, i64* %3
%5 = load i64, i64* @AF_INET6
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @memcpy(%struct.ndm_ip_sockaddr_t* %0, %struct.sockaddr_in6* %1, i32 8)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_uint32_t(uint32_t const k1, uint32_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_uint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_uint32_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_uint32_t(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 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_uint32_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void gdk_colormap_alloc_color() {}


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

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

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

LLVM IR (-O2):
define void @gdk_colormap_alloc_color() {
ret void
}
/* Variables and functions */
int RGBclamp(int);
int YCrCb2B(int Y, int Cr, int Cb) {
  return RGBclamp((500 + 1164 * (Y - 16) + 2018 * (Cb - 128)) / 1000);
}


x86 assembly (clang, -O0):
<YCrCb2B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x10,%eax
imul   $0x48c,%eax,%eax
add    $0x1f4,%eax
mov    -0xc(%rbp),%ecx
sub    $0x80,%ecx
imul   $0x7e2,%ecx,%ecx
add    %ecx,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <RGBclamp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<YCrCb2B>:
imul   $0x48c,%edi,%eax
imul   $0x7e2,%edx,%ecx
add    %ecx,%eax
add    $0xfffbc834,%eax
cltq
imul   $0x10624dd3,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x26,%rdi
add    %eax,%edi
jmp    1030 <RGBclamp@plt>

LLVM IR (-O0):
define i32 @YCrCb2B(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 = sub nsw i32 %7, 16
%9 = mul nsw i32 1164, %8
%10 = add nsw i32 500, %9
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 128
%13 = mul nsw i32 2018, %12
%14 = add nsw i32 %10, %13
%15 = sdiv i32 %14, 1000
%16 = call i32 @RGBclamp(i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @YCrCb2B(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %0, 1164
%5 = mul i32 %2, 2018
%6 = add i32 %4, -276428
%7 = add i32 %6, %5
%8 = sdiv i32 %7, 1000
%9 = tail call i32 @RGBclamp(i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_atexit_fun2(void) { printf("I am in my_atexit_fun2\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"I am in my_atexit_fun2\0A\00"
define void @my_atexit_fun2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"I am in my_atexit_fun2\00"
define void @my_atexit_fun2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
void debug_check_no_obj_freed(const void *address, unsigned long size) {}


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

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

LLVM IR (-O0):
define void @debug_check_no_obj_freed(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @debug_check_no_obj_freed(i8* nocapture %0, i64 %1) {
ret void
}
double f1(double x) { return __builtin_sin(x); }


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

x86 assembly (clang, -O2):
<f1>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @f1(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
read_cpa() {}


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

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

LLVM IR (-O0):
define i32 @read_cpa() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @read_cpa() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ out_of_memory();
void check_malloc_return(void *p) {
  if (!p)
    out_of_memory();
}


x86 assembly (clang, -O0):
<check_malloc_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112e <check_malloc_return+0x1e>
mov    $0x0,%al
call   1030 <out_of_memory@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_malloc_return>:
test   %rdi,%rdi
je     1116 <check_malloc_return+0x6>
ret
xor    %eax,%eax
jmp    1030 <out_of_memory@plt>

LLVM IR (-O0):
define void @check_malloc_return(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (...) @out_of_memory()
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @check_malloc_return(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @out_of_memory()
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
char const *ffm_error(int /*<<< orphan*/ *);
const char *ffm_geterror(void) { return ffm_error(NULL); }


x86 assembly (clang, -O0):
<ffm_geterror>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <ffm_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffm_geterror>:
xor    %edi,%edi
jmp    1030 <ffm_error@plt>

LLVM IR (-O0):
define i8* @ffm_geterror() {
%1 = call i8* @ffm_error(i32* null)
ret i8* %1
}

LLVM IR (-O2):
define i8* @ffm_geterror() {
%1 = tail call i8* @ffm_error(i32* null)
ret i8* %1
}
/* Variables and functions */
double funcAngCor_alpha0_0plus_0plus_14032_L0(double *, double *);
double sin(double);
double fitAngDist_alpha0_0plus_0plus_14032_L0(double *x, double *par) {
  double result;
  result = funcAngCor_alpha0_0plus_0plus_14032_L0(x, &par[0]) *
           sin(x[0] * 0.0174533);
  return result;
}


x86 assembly (clang, -O0):
<fitAngDist_alpha0_0plus_0plus_14032_L0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <funcAngCor_alpha0_0plus_0plus_14032_L0@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeb2(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitAngDist_alpha0_0plus_0plus_14032_L0>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <funcAngCor_alpha0_0plus_0plus_14032_L0@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mulsd  0xec1(%rip),%xmm0
call   1040 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fitAngDist_alpha0_0plus_0plus_14032_L0(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** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = call double @funcAngCor_alpha0_0plus_0plus_14032_L0(double* %6, double* %8)
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %12, 1.745330e-02
%14 = call double @sin(double %13)
%15 = fmul double %9, %14
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @fitAngDist_alpha0_0plus_0plus_14032_L0(double* %0, double* %1) {
%3 = tail call double @funcAngCor_alpha0_0plus_0plus_14032_L0(double* %0, double* %1)
%4 = load double, double* %0
%5 = fmul double %4, 1.745330e-02
%6 = tail call double @sin(double %5)
%7 = fmul double %3, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int isatty(int /*<<< orphan*/);
int bb_should_colorize(void) { return isatty(STDOUT_FILENO); }


x86 assembly (clang, -O0):
<bb_should_colorize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <isatty@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_should_colorize>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <isatty@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define i32 @bb_should_colorize() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @isatty(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define i32 @bb_should_colorize() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @isatty(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ replaceFirst(char *, char *, char *);
int /*<<< orphan*/ *strstr(char *, char *);
void replace(char *str1, char *str2, char *str3) {
  while (strstr(str1, str2) != NULL) {
    replaceFirst(str1, str2, str3);
  }
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1161 <replace+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <replaceFirst@plt>
jmp    1134 <replace+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xchg   %ax,%ax
call   1040 <strstr@plt>
test   %rax,%rax
je     1150 <replace+0x30>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <replaceFirst@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
jmp    1130 <replace+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @replace(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%5 = icmp eq i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3, %6
%7 = tail call i32 @replaceFirst(i8* %0, i8* %1, i8* %2)
%8 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %6
10: ; preds = %6, %3
ret void
}
int main() {
  char arr[3];
  arr[0] = 'c';
  arr[1] = 2;
  arr[2] = arr[0] - arr[1];
  return (int)(arr[0] + arr[1] + arr[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x63,-0x7(%rbp)
movb   $0x2,-0x6(%rbp)
movsbl -0x7(%rbp),%eax
movsbl -0x6(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x5(%rbp)
movsbl -0x7(%rbp),%eax
movsbl -0x6(%rbp),%ecx
add    %ecx,%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
store i8 99, i8* %3
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 2, i8* %4
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 %12, i8* %13
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = add nsw i32 %16, %19
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %20, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
ret i32 198
}
/* Variables and functions */
scalar_t__ foo(int, int);
int main(int argc, char **argv) { return (foo(argc, (int)argv) == 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1030 <foo@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <foo@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = ptrtoint i8** %7 to i32
%9 = call i64 @foo(i32 %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = ptrtoint i8** %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i64 @foo(i32 %0, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t u32(uint64_t x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @u32(i32 returned %0) {
ret i32 %0
}
int main(void) {
  int *arr[3] = {1, 2, 3};
  printf("%d\n", *arr[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = load i32, i32* inttoptr (i64 2 to i32*)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_add_fallback(void *bus, void **slot, const char *prefix, void *callback,
                    void *userdata) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_add_fallback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
mov    0x2ebf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_add_fallback>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_add_fallback(i8* %0, i8** %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_add_fallback(i8* nocapture readnone %0, i8** nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
%6 = load i32, i32* @EINVAL
%7 = sub nsw i32 0, %6
ret i32 %7
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int y = __VERIFIER_nondet_int();
  int x = y + 42;
  while (x >= 0) {
    y = 2 * y - x;
    x = (y + x) / 2;
  }
  return 0;
}


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@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2a,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     115e <main+0x4e>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1132 <main+0x22>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 42
store i32 %6, i32* %3
br label %7
7: ; preds = %10, %0
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %2
%12 = mul nsw i32 2, %11
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
%18 = sdiv i32 %17, 2
store i32 %18, i32* %3
br label %7
19: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ use(int *);
void test_most_zeros() {
  int a[16] = {0, 0, 1};
  use(a);
}


x86 assembly (clang, -O0):
<test_most_zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
movl   $0x1,-0x38(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <use@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_most_zeros>:
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x1,0x8(%rsp)
mov    %rsp,%rdi
call   1030 <use@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @test_most_zeros() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = bitcast i8* %2 to <{ i32, i32, i32, [13 x i32] }>*
%4 = getelementptr inbounds <{ i32, i32, i32, [13 x i32] }>, <{ i32, i32, i32, [13 x i32] }>* %3, i32 0, i32 2
store i32 1, i32* %4
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%6 = call i32 @use(i32* %5)
ret void
}

LLVM IR (-O2):
define void @test_most_zeros() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 2
store i32 1, i32* %3
%4 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%5 = call i32 @use(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ copy_dir(char const *, char const *);
int /*<<< orphan*/ printf(char *);
int test_copy_dir(const char *from, const char *to) {
  printf("Testing copy_dir().\n");
  copy_dir(from, to);
  printf("Done!\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_copy_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <copy_dir@plt>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_copy_dir>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <copy_dir@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Testing copy_dir().\0A\00"
@.str.1 = [8 x i8] c"Done!\0A\0A\00"
define i32 @test_copy_dir(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @copy_dir(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"Testing copy_dir().\00"
@str.2 = [7 x i8] c"Done!\0A\00"
define i32 @test_copy_dir(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @copy_dir(i8* %0, i8* %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  while (1) {
    printf("I'm Bad MF");
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <main+0x9>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"I'm Bad MF\00"
define i32 @main() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"I'm Bad MF\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void vfree(void **vec) {
  int i;
  for (i = 0; vec[i] != NULL; i++)
    free(vec[i]);
}


x86 assembly (clang, -O0):
<vfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <vfree+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <vfree+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfree>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <vfree+0x21>
add    $0x8,%rbx
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <vfree+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @vfree(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %21
11: ; preds = %4
%12 = load i8**, i8*** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @free(i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @vfree(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @free(i8* %6)
%8 = add nuw nsw i64 %5, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long long dummy_number_generator();
int main(void) {
  long long int num = dummy_number_generator();
  if (num > 0)
    abort();
  if (num / 69313094915135 != -5)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <dummy_number_generator@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    114c <main+0x2c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
movabs $0x3f0a3666943f,%rcx
cqto
idiv   %rcx
cmp    $0xfffffffffffffffb,%rax
je     1170 <main+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <dummy_number_generator@plt>
test   %rax,%rax
jg     114d <main+0x2d>
movabs $0x17a3d46677979,%rcx
add    %rcx,%rax
movabs $0x3f0a3666943f,%rcx
cmp    %rcx,%rax
jae    114d <main+0x2d>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @dummy_number_generator()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i64, i64* %2
%10 = sdiv i64 %9, 69313094915135
%11 = icmp ne i64 %10, -5
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @dummy_number_generator()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = add nsw i64 %1, 415878569490809
%7 = icmp ult i64 %6, 69313094915135
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ consumer(char const *);
void file(const char *fn) { consumer(fn); }


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

x86 assembly (clang, -O2):
<file>:
jmp    1030 <consumer@plt>

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

LLVM IR (-O2):
define void @file(i8* %0) {
%2 = tail call i32 @consumer(i8* %0)
ret void
}
/* Variables and functions */
int rit_var_set(char *, char *);
int set(char *path, char *value) {
  if (path == NULL || *path == '\0' || value == NULL || *value == '\0')
    return 1;
  return rit_var_set(path, value);
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <set+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <set+0x46>
cmpq   $0x0,-0x18(%rbp)
je     1156 <set+0x46>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1162 <set+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1172 <set+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <rit_var_set@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
test   %rdi,%rdi
je     1129 <set+0x19>
test   %rsi,%rsi
je     1129 <set+0x19>
cmpb   $0x0,(%rdi)
je     1129 <set+0x19>
cmpb   $0x0,(%rsi)
je     1129 <set+0x19>
jmp    1030 <rit_var_set@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @set(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8* %1, null
%8 = or i1 %7, %6
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = load i8, i8* %1
%11 = icmp eq i8 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 @rit_var_set(i8* %0, i8* %1)
br label %14
14: ; preds = %2, %4, %9, %12
%15 = phi i32 [ %13, %12 ], [ 1, %9 ], [ 1, %4 ], [ 1, %2 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ perror(char const *);
void pabort(const char *s) {
  perror(s);
  abort();
}


x86 assembly (clang, -O0):
<pabort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define void @pabort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @pabort(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 (...) @abort()
unreachable
}
unsigned long long tsc() {
  unsigned long long ret;
  asm volatile("rdtsc" : "=A"(ret));
  return ret;
}


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

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

LLVM IR (-O0):
define i64 @tsc() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @tsc() {
%1 = tail call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ XFontStruct;

/* Variables and functions */
int XTextWidth(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int string_width(XFontStruct *font, char *s) {
  return XTextWidth(font, s, strlen(s));
}


x86 assembly (clang, -O0):
<string_width>:
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 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <XTextWidth@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_width>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <XTextWidth@plt>

LLVM IR (-O0):
define i32 @string_width(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @XTextWidth(i32* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @string_width(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @XTextWidth(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int get_input() {
  int decimal;
  printf("Please enter an integer: ");
  scanf("%d", &decimal);
  return decimal;
}


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

x86 assembly (clang, -O2):
<get_input>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Please enter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_input() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [26 x i8] c"Please enter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_input() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int BIT(int);
int wpa_key_mgmt_sha384(int akm) { return !!(akm & BIT(17)); }


x86 assembly (clang, -O0):
<wpa_key_mgmt_sha384>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x11,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_sha384>:
push   %rbx
mov    %edi,%ebx
mov    $0x11,%edi
call   1030 <BIT@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_sha384(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @BIT(i32 17)
%5 = and i32 %3, %4
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_sha384(i32 %0) {
%2 = tail call i32 @BIT(i32 17)
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructPPForm(void *, struct constructHeader *);
const char *EnvGetDefgenericPPForm(void *theEnv, void *theDefgeneric) {
  return GetConstructPPForm(theEnv, (struct constructHeader *)theDefgeneric);
}


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

x86 assembly (clang, -O2):
<EnvGetDefgenericPPForm>:
jmp    1030 <GetConstructPPForm@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDefgenericPPForm(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 = bitcast i8* %6 to %struct.constructHeader*
%8 = call i8* @GetConstructPPForm(i8* %5, %struct.constructHeader* %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDefgenericPPForm(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructPPForm(i8* %0, %struct.constructHeader* %3)
ret i8* %4
}