xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ die_oom(size_t);
void *mem_calloc(size_t n, size_t size) {
  void *ptr = calloc(n, size);
  if (!ptr)
    die_oom(size);
  return ptr;
}


x86 assembly (clang, -O0):
<mem_calloc>:
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   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <mem_calloc+0x35>
mov    -0x10(%rbp),%rdi
call   1030 <die_oom@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <mem_calloc+0x1c>
mov    %r14,%rdi
call   1030 <die_oom@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @mem_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die_oom(i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
char *mystrcat(char *dst, const char *src) {
  char *ret = dst;
  while (*dst) {
    dst++;
  }
  while (*src) {
    *dst++ = *src++;
  }
  *dst = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<mystrcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <mystrcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <mystrcat+0x14>
jmp    1137 <mystrcat+0x37>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <mystrcat+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1137 <mystrcat+0x37>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
mov    %rcx,%rdi
add    $0x1,%rcx
cmpb   $0x0,(%rdi)
jne    1110 <mystrcat+0x10>
mov    (%rsi),%dl
test   %dl,%dl
je     1146 <mystrcat+0x46>
mov    $0xffffffffffffffff,%rdi
nopl   0x0(%rax)
mov    %dl,(%rcx,%rdi,1)
movzbl 0x2(%rsi,%rdi,1),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1130 <mystrcat+0x30>
add    %rdi,%rcx
mov    %rcx,%rdi
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @mystrcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %16, %11 ], [ %4, %8 ]
%14 = phi i8* [ %15, %11 ], [ %1, %8 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %13
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG(int /*<<< orphan*/, char *);
int /*<<< orphan*/ exit(int);
long sys_random(void) {
  DEBUG(0, ("Error - no random function available !\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<sys_random>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xed3(%rip),%rsi
call   1030 <DEBUG@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [40 x i8] c"Error - no random function available !\0A\00"
define i64 @sys_random() {
%1 = call i32 @DEBUG(i32 0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"Error - no random function available !\0A\00"
define i64 @sys_random() {
%1 = tail call i32 @DEBUG(i32 0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int cvtdouble();
int cvtfloat();
int main(void) { return cvtfloat() - cvtdouble(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <cvtfloat@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <cvtdouble@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <cvtfloat@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <cvtdouble@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @cvtfloat()
%3 = call i32 (...) @cvtdouble()
%4 = sub nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @cvtfloat()
%2 = tail call i32 (...) @cvtdouble()
%3 = sub nsw i32 %1, %2
ret i32 %3
}
char focus() { return 0b11111; }


x86 assembly (clang, -O0):
<focus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<focus>:
mov    $0x1f,%al
ret

LLVM IR (-O0):
define signext i8 @focus() {
ret i8 31
}

LLVM IR (-O2):
define signext i8 @focus() {
ret i8 31
}
/* Type definitions */
typedef void castable;

/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
void *try_cast_castable(struct castable *castable, const char *type_name) {
  if (strcmp(type_name, "castable") == 0)
    return castable;
  return NULL;
}


x86 assembly (clang, -O0):
<try_cast_castable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1147 <try_cast_castable+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <try_cast_castable+0x3f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_cast_castable>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.castable = type opaque
@.str = [9 x i8] c"castable\00"
define i8* @try_cast_castable(%struct.castable* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.castable*
%5 = alloca i8*
store %struct.castable* %0, %struct.castable** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load %struct.castable*, %struct.castable** %4
%11 = bitcast %struct.castable* %10 to i8*
store i8* %11, i8** %3
br label %13
12: ; preds = %2
store i8* null, i8** %3
br label %13
13: ; preds = %12, %9
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
%struct.castable = type opaque
@.str = [9 x i8] c"castable\00"
define i8* @try_cast_castable(%struct.castable* readnone %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = bitcast %struct.castable* %0 to i8*
%6 = select i1 %4, i8* %5, i8* null
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_kernel;

/* Variables and functions */
int CL_SUCCESS;
int /*<<< orphan*/ clReleaseKernel(int /*<<< orphan*/);
int clReleaseKernels(cl_kernel *kernels) {
  for (int i = 0; i < 1; i++) {
    clReleaseKernel(kernels[i]);
  }
  return CL_SUCCESS;
}


x86 assembly (clang, -O0):
<clReleaseKernels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    114b <clReleaseKernels+0x3b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <clReleaseKernel@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <clReleaseKernels+0x13>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clReleaseKernels>:
push   %rax
mov    (%rdi),%edi
call   1030 <clReleaseKernel@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@CL_SUCCESS = global i32 0
define i32 @clReleaseKernels(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @clReleaseKernel(i32 %2)
%4 = load i32, i32* @CL_SUCCESS
ret i32 %4
}
unsigned char dig_to_hex(unsigned char d) {
  return d < 10 ? d + '0' : d - 10 + 'A';
}


x86 assembly (clang, -O0):
<dig_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jge    1126 <dig_to_hex+0x26>
movzbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <dig_to_hex+0x33>
movzbl -0x1(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dig_to_hex>:
cmp    $0xa,%dil
mov    $0x30,%ecx
mov    $0x37,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @dig_to_hex(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = add nsw i32 %8, 48
br label %15
10: ; preds = %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = sub nsw i32 %12, 10
%14 = add nsw i32 %13, 65
br label %15
15: ; preds = %10, %6
%16 = phi i32 [ %9, %6 ], [ %14, %10 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @dig_to_hex(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = select i1 %2, i8 48, i8 55
%4 = add i8 %3, %0
ret i8 %4
}
void stellaris_default_int(void) {
  while (1)
    ;
}


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

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

LLVM IR (-O0):
define void @stellaris_default_int() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @stellaris_default_int() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void gloc_fs_read() { exit(1); }


x86 assembly (clang, -O0):
<gloc_fs_read>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<gloc_fs_read>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @gloc_fs_read() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @gloc_fs_read() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error(char *str) {
  printf("%s", str);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int fat(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d", fat(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <fat@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fat(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int rand();
int test(int a, int b) {
  int p = rand() & 31, q = rand() & 31, r = rand() & 31;
  return ((((p + q + r) * b) >> a) == (p + q + r) / 9);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %edi,%r14d
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebp
and    $0x1f,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
and    $0x1f,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x1f,%eax
add    %ebx,%eax
imul   %eax,%r15d
mov    %r14d,%ecx
sar    %cl,%r15d
imul   $0x39,%eax,%ecx
shr    $0x9,%ecx
xor    %eax,%eax
cmp    %ecx,%r15d
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = call i32 (...) @rand()
%9 = and i32 %8, 31
store i32 %9, i32* %5
%10 = call i32 (...) @rand()
%11 = and i32 %10, 31
store i32 %11, i32* %6
%12 = call i32 (...) @rand()
%13 = and i32 %12, 31
store i32 %13, i32* %7
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %4
%20 = mul nsw i32 %18, %19
%21 = load i32, i32* %3
%22 = ashr i32 %20, %21
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = add nsw i32 %23, %24
%26 = load i32, i32* %7
%27 = add nsw i32 %25, %26
%28 = sdiv i32 %27, 9
%29 = icmp eq i32 %22, %28
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = and i32 %3, 31
%5 = tail call i32 (...) @rand()
%6 = and i32 %5, 31
%7 = tail call i32 (...) @rand()
%8 = and i32 %7, 31
%9 = add nuw nsw i32 %6, %4
%10 = add nuw nsw i32 %9, %8
%11 = mul nsw i32 %10, %1
%12 = ashr i32 %11, %0
%13 = trunc i32 %10 to i8
%14 = udiv i8 %13, 9
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %12, %15
%17 = zext i1 %16 to i32
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ufree(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @ufree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ parser(char *);
int /*<<< orphan*/ printf(char *);
void main() {
  char expr[100];
  printf("\nDigite uma expressao: ");
  gets(expr);
  parser(expr);
  printf("Expressao sintaticamente correta");
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1040 <parser@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1050 <parser@plt>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0ADigite uma expressao: \00"
@.str.1 = [33 x i8] c"Expressao sintaticamente correta\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @parser(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0ADigite uma expressao: \00"
@.str.1 = [33 x i8] c"Expressao sintaticamente correta\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @parser(i8* %2)
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef scalar_t__ VISIT;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
scalar_t__ leaf;
scalar_t__ postorder;
int /*<<< orphan*/ stderr;
void print_starter_node(const void *ptr, VISIT order, int level) {
  if (order == postorder || order == leaf) {
    fprintf(stderr, "   %s\n", *(const char **)ptr);
  }
}


x86 assembly (clang, -O0):
<print_starter_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
je     114b <print_starter_node+0x3b>
mov    -0x10(%rbp),%rax
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <print_starter_node+0x57>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_starter_node>:
mov    0x2ec1(%rip),%rax
cmp    %rsi,(%rax)
je     1129 <print_starter_node+0x19>
mov    0x2ead(%rip),%rax
cmp    %rsi,(%rax)
je     1129 <print_starter_node+0x19>
ret
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xec4(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@postorder = global i64 0
@leaf = global i64 0
@stderr = global i32 0
@.str = [7 x i8] c" %s\0A\00"
define void @print_starter_node(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %5
%8 = load i64, i64* @postorder
%9 = icmp eq i64 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i64, i64* %5
%12 = load i64, i64* @leaf
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10, %3
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i8**
%18 = load i8*, i8** %17
%19 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
@postorder = global i64 0
@leaf = global i64 0
@stderr = global i32 0
@.str = [7 x i8] c" %s\0A\00"
define void @print_starter_node(i8* nocapture %0, i64 %1, i32 %2) {
%4 = load i64, i64* @postorder
%5 = icmp eq i64 %4, %1
%6 = load i64, i64* @leaf
%7 = icmp eq i64 %6, %1
%8 = select i1 %5, i1 true, i1 %7
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = bitcast i8* %0 to i8**
%12 = load i8*, i8** %11
%13 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %3, %9
ret void
}
/* Variables and functions */
double log10(float);
int mbLog(float x) {
  int t;
  if (x <= 1.18e-38f)
    return -37928;
  t = (int)(1000.0 * log10(x) + 0.5);
  return t;
}


x86 assembly (clang, -O0):
<mbLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     113b <mbLog+0x2b>
movl   $0xffff6bd8,-0x4(%rbp)
jmp    116a <mbLog+0x5a>
movss  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movsd  0xebb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb7(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbLog>:
push   %rax
mov    $0xffff6bd8,%eax
movss  0xee2(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    113c <mbLog+0x2c>
call   1030 <log10@plt>
mulsd  0xed8(%rip),%xmm0
addsd  0xed8(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mbLog(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = load float, float* %3
%6 = fcmp ole float %5, 0x38100FB320000000
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -37928, i32* %2
br label %14
8: ; preds = %1
%9 = load float, float* %3
%10 = call double @log10(float %9)
%11 = call double @llvm.fmuladd.f64(double 1.000000e+03, double %10, double 5.000000e-01)
%12 = fptosi double %11 to i32
store i32 %12, i32* %4
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @mbLog(float %0) {
%2 = fcmp ugt float %0, 0x38100FB320000000
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call double @log10(float %0)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.000000e+03, double 5.000000e-01)
%6 = fptosi double %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -37928, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vfs;

/* Variables and functions */
void (*scmDlSym(sqlite3_vfs *pVfs, void *pH, const char *z))(void) { return 0; }


x86 assembly (clang, -O0):
<scmDlSym>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define void ()* @scmDlSym(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void ()* null
}

LLVM IR (-O2):
define noalias void ()* @scmDlSym(i32* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret void ()* null
}
int odd_one(unsigned x) { return !!(x & 0xAAAAAAAA); }


x86 assembly (clang, -O0):
<odd_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaaaaaa,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<odd_one>:
xor    %eax,%eax
test   $0xaaaaaaaa,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @odd_one(i32 %0) {
%2 = and i32 %0, -1431655766
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int FeedCDDA(unsigned char *, int);
int SPUplayCDDAchannel(short *pcm, int nbytes) {
  if (!pcm)
    return -1;
  if (nbytes <= 0)
    return -1;
  return FeedCDDA((unsigned char *)pcm, nbytes);
}


x86 assembly (clang, -O0):
<SPUplayCDDAchannel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <SPUplayCDDAchannel+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <SPUplayCDDAchannel+0x4b>
cmpl   $0x0,-0x14(%rbp)
jg     114c <SPUplayCDDAchannel+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <SPUplayCDDAchannel+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <FeedCDDA@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPUplayCDDAchannel>:
test   %rdi,%rdi
je     111e <SPUplayCDDAchannel+0xe>
test   %esi,%esi
jle    111e <SPUplayCDDAchannel+0xe>
jmp    1030 <FeedCDDA@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @SPUplayCDDAchannel(i16* %0, i32 %1) {
%3 = icmp eq i16* %0, null
%4 = icmp slt i32 %1, 1
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = bitcast i16* %0 to i8*
%8 = tail call i32 @FeedCDDA(i8* %7, i32 %1)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *i2a(int i) {
  static char buf[12];
  sprintf(buf, "C%d", i);
  return buf;
}


x86 assembly (clang, -O0):
<i2a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f04(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2a>:
push   %rbx
mov    %edi,%edx
lea    0x2f0f(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@i2a.buf = internal global [12 x i8] zeroinitializer
@.str = [4 x i8] c"C%d\00"
define i8* @i2a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @i2a.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @i2a.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@i2a.buf = internal global [12 x i8] zeroinitializer
@.str = [4 x i8] c"C%d\00"
define i8* @i2a(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @i2a.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @i2a.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ print_eol();
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void storage_print_header_all_holidays() {
  printf("%s\t%s\t\t\t%s\t\t%s", "ID", "Description", "Type", "Price");
  print_eol();
  print_eol();
}


x86 assembly (clang, -O0):
<storage_print_header_all_holidays>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xed9(%rip),%rdx
lea    0xede(%rip),%rcx
lea    0xedc(%rip),%r8
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print_eol@plt>
mov    $0x0,%al
call   1040 <print_eol@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<storage_print_header_all_holidays>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee0(%rip),%rsi
lea    0xedc(%rip),%rdx
lea    0xee1(%rip),%rcx
lea    0xedf(%rip),%r8
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <print_eol@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <print_eol@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s\09%s\09\09\09%s\09\09%s\00"
@.str.1 = [3 x i8] c"ID\00"
@.str.2 = [12 x i8] c"Description\00"
@.str.3 = [5 x i8] c"Type\00"
@.str.4 = [6 x i8] c"Price\00"
define void @storage_print_header_all_holidays() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%2 = call i32 (...) @print_eol()
%3 = call i32 (...) @print_eol()
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s\09%s\09\09\09%s\09\09%s\00"
@.str.1 = [3 x i8] c"ID\00"
@.str.2 = [12 x i8] c"Description\00"
@.str.3 = [5 x i8] c"Type\00"
@.str.4 = [6 x i8] c"Price\00"
define void @storage_print_header_all_holidays() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%2 = tail call i32 (...) @print_eol()
%3 = tail call i32 (...) @print_eol()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_str(char const *);
int /*<<< orphan*/ putchar(char);
int puts(const char *p) {
  print_str(p);
  putchar('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <print_str@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1040 <print_str@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @print_str(i8* %4)
%6 = call i32 @putchar(i8 signext 10)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @print_str(i8* %0)
%3 = tail call i32 @putchar(i8 signext 10)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ remove_duplicates(char *);
scalar_t__ strcmp(char *, char *);
int test_only_duplicates() {
  char input[] = "aaaa";
  remove_duplicates(input);
  return strcmp(input, "a") == 0;
}


x86 assembly (clang, -O0):
<test_only_duplicates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
call   1040 <remove_duplicates@plt>
lea    -0x5(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_only_duplicates>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x61616161,0x8(%rsp)
61
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <remove_duplicates@plt>
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_only_duplicates.input = [5 x i8] c"aaaa\00"
@.str = [2 x i8] c"a\00"
define i32 @test_only_duplicates() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @remove_duplicates(i8* %3)
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@__const.test_only_duplicates.input = [5 x i8] c"aaaa\00"
@.str = [2 x i8] c"a\00"
define i32 @test_only_duplicates() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @remove_duplicates(i8* %2)
%4 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void trunnel_set_uint64(void *p, uint64_t v) { memcpy(p, &v, 8); }


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

x86 assembly (clang, -O2):
<trunnel_set_uint64>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @trunnel_set_uint64(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 = call i32 @memcpy(i8* %5, i32* %4, i32 8)
ret void
}

LLVM IR (-O2):
define void @trunnel_set_uint64(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_set_sleep_radio() {
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (10 << 9) | (5 << 5) | (5)));
  delay(100);
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (10 << 9) | (5 << 5) | (5)));
  delay(100);
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (2 << 9) | (2 << 5) | (5)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_set_sleep_radio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xd4a5,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xd4a5,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc445,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_sleep_radio>:
push   %rax
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xd4a5,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xd4a5,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc445,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_set_sleep_radio() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 54437)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 54437)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 50245)
%6 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_set_sleep_radio() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 54437)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 54437)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 50245)
%6 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("------------------\n");
  printf("| Reez Patel     |\n| 512,UB         |\n| Chennai-602302 |\n");
  printf("------------------\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf21(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"------------------\0A\00"
@.str.1 = [58 x i8] c"| Reez Patel |\0A| 512,UB |\0A| Chennai-602302 |\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str.2 = [57 x i8] c"| Reez Patel |\0A| 512,UB |\0A| Chennai-602302 |\00"
@str.3 = [19 x i8] c"------------------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
void *rt_init_scanlinereceives(struct anon$39$link111 *scene) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%"struct.anon$39$link111" = type opaque
define i8* @rt_init_scanlinereceives(%"struct.anon$39$link111"* %0) {
%2 = alloca %"struct.anon$39$link111"*
store %"struct.anon$39$link111"* %0, %"struct.anon$39$link111"** %2
ret i8* null
}

LLVM IR (-O2):
%"struct.anon$39$link111" = type opaque
define noalias i8* @rt_init_scanlinereceives(%"struct.anon$39$link111"* nocapture readnone %0) {
ret i8* null
}
int xmlUCSIsKhmerSymbols(int code) {
  return (((code >= 0x19E0) && (code <= 0x19FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsKhmerSymbols>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x19e0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsKhmerSymbols+0x26>
cmpl   $0x19ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsKhmerSymbols>:
and    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x19e0,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsKhmerSymbols(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 6624
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 6655
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsKhmerSymbols(i32 %0) {
%2 = and i32 %0, -32
%3 = icmp eq i32 %2, 6624
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int _random_int_func(int, int);
int16_t _random_16_from_int(int16_t min, int16_t max) {
  int ret = _random_int_func((int)min, (int)max);
  return (int16_t)ret;
}


x86 assembly (clang, -O0):
<_random_16_from_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1030 <_random_int_func@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_random_16_from_int>:
push   %rax
call   1030 <_random_int_func@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @_random_16_from_int(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = call i32 @_random_int_func(i32 %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @_random_16_from_int(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = tail call i32 @_random_int_func(i32 %3, i32 %4)
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int _pack2(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ cosf(short);
int /*<<< orphan*/ roundf(int /*<<< orphan*/);
int /*<<< orphan*/ sinf(short);
unsigned cis_fun_short(short t) {
  return _pack2(roundf(cosf(t)), roundf(sinf(t)));
}


x86 assembly (clang, -O0):
<cis_fun_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
call   1050 <cosf@plt>
mov    %eax,%edi
call   1060 <roundf@plt>
mov    %eax,-0x8(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
call   1030 <sinf@plt>
mov    %eax,%edi
call   1060 <roundf@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <_pack2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cis_fun_short>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1050 <cosf@plt>
mov    %eax,%edi
call   1060 <roundf@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <sinf@plt>
mov    %eax,%edi
call   1060 <roundf@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_pack2@plt>

LLVM IR (-O0):
define i32 @cis_fun_short(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @cosf(i16 signext %3)
%5 = call i32 @roundf(i32 %4)
%6 = load i16, i16* %2
%7 = call i32 @sinf(i16 signext %6)
%8 = call i32 @roundf(i32 %7)
%9 = call i32 @_pack2(i32 %5, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @cis_fun_short(i16 signext %0) {
%2 = tail call i32 @cosf(i16 signext %0)
%3 = tail call i32 @roundf(i32 %2)
%4 = tail call i32 @sinf(i16 signext %0)
%5 = tail call i32 @roundf(i32 %4)
%6 = tail call i32 @_pack2(i32 %3, i32 %5)
ret i32 %6
}
/* Type definitions */
struct proctal {
  int dummy;
};

/* Variables and functions */
int proctal_implementation_scan_address_next(struct proctal *, void **);
int proctal_scan_address_next(struct proctal *p, void **address) {
  return proctal_implementation_scan_address_next(p, address);
}


x86 assembly (clang, -O0):
<proctal_scan_address_next>:
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 <proctal_implementation_scan_address_next@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proctal_scan_address_next>:
jmp    1030 <proctal_implementation_scan_address_next@plt>

LLVM IR (-O0):
%struct.proctal = type { i32 }
define i32 @proctal_scan_address_next(%struct.proctal* %0, i8** %1) {
%3 = alloca %struct.proctal*
%4 = alloca i8**
store %struct.proctal* %0, %struct.proctal** %3
store i8** %1, i8*** %4
%5 = load %struct.proctal*, %struct.proctal** %3
%6 = load i8**, i8*** %4
%7 = call i32 @proctal_implementation_scan_address_next(%struct.proctal* %5, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.proctal = type { i32 }
define i32 @proctal_scan_address_next(%struct.proctal* %0, i8** %1) {
%3 = tail call i32 @proctal_implementation_scan_address_next(%struct.proctal* %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int **pgmRead(char **header, int *numRows, int *numCols, FILE *in) {}


x86 assembly (clang, -O0):
<pgmRead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i32** @pgmRead(i8** nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32** undef
}