xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: tread aname infile outfile\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: tread aname infile outfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: tread aname infile outfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void InitPar(pargc, pargv, penvp) int *pargc;
char ***pargv;
char ***penvp;
{}


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

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

LLVM IR (-O0):
define void @InitPar(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
}

LLVM IR (-O2):
define void @InitPar(i32* nocapture %0, i8*** nocapture %1, i8*** nocapture %2) {
ret void
}
double computeAE(double AB, double AC, double AD) { return AC * AD / AB; }


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

x86 assembly (clang, -O2):
<computeAE>:
mulsd  %xmm2,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @computeAE(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %6
%9 = fmul double %7, %8
%10 = load double, double* %4
%11 = fdiv double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @computeAE(double %0, double %1, double %2) {
%4 = fmul double %1, %2
%5 = fdiv double %4, %0
ret double %5
}
/* Variables and functions */
scalar_t__ __ucmpdi2(long long, long long);
int _COM_CMPLT64u(long long a, long long b) { return __ucmpdi2(a, b) == 0; }


x86 assembly (clang, -O0):
<_COM_CMPLT64u>:
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 <__ucmpdi2@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_COM_CMPLT64u(i64 %0, i64 %1) {
%3 = tail call i64 @__ucmpdi2(i64 %0, i64 %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void pad_n(char *s, int n, char c) {
  int i;
  for (i = 0; i < n; i++)
    s[i] = c;
}


x86 assembly (clang, -O0):
<pad_n>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <pad_n+0x3f>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <pad_n+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad_n>:
test   %esi,%esi
jle    1126 <pad_n+0x16>
push   %rax
mov    %esi,%eax
movzbl %dl,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @pad_n(i8* nocapture writeonly %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %3
ret void
}
void init_sub_rel_pixel_color_pt_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_sub_rel_pixel_color_pt_funcs_c() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ obter_string(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char string[255];
  obter_string(string, 255);
  printf("string lida: %s\n", string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
mov    $0xff,%esi
call   1040 <obter_string@plt>
lea    -0x100(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1040 <obter_string@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"string lida: %s\0A\00"
define i32 @main() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @obter_string(i8* %2, i32 255)
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int Alloc_Shmem(unit, shmem_size, type)
int unit;
int shmem_size;
int type;
{ return Attach_Shmem(unit, shmem_size, 0, type); }


x86 assembly (clang, -O0):
<Alloc_Shmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
mov    $0x0,%al
call   1030 <Attach_Shmem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Alloc_Shmem>:
mov    %edx,%ecx
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <Attach_Shmem@plt>

LLVM IR (-O0):
define i32 @Alloc_Shmem(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @Attach_Shmem to i32 (i32, i32, i32, i32, ...)*)(i32 %7, i32 %8, i32 0, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @Alloc_Shmem(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @Attach_Shmem to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 0, i32 %2)
ret i32 %4
}
/* Variables and functions */
int f362(int *);
int f363(int *p) { return f362(p); }


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

x86 assembly (clang, -O2):
<f363>:
jmp    1030 <f362@plt>

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

LLVM IR (-O2):
define i32 @f363(i32* %0) {
%2 = tail call i32 @f362(i32* %0)
ret i32 %2
}
/* Variables and functions */
int __real_pthread_yield();
int /*<<< orphan*/ idle_metric_blame_shift_idle();
int /*<<< orphan*/ idle_metric_blame_shift_work();
int __wrap_pthread_yield() {
  int ret;
  ;
  idle_metric_blame_shift_idle();
  ret = __real_pthread_yield();
  idle_metric_blame_shift_work();
  ;
  return ret;
}


x86 assembly (clang, -O0):
<__wrap_pthread_yield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <idle_metric_blame_shift_idle@plt>
mov    $0x0,%al
call   1040 <__real_pthread_yield@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <idle_metric_blame_shift_work@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_pthread_yield>:
push   %rbx
xor    %eax,%eax
call   1050 <idle_metric_blame_shift_idle@plt>
xor    %eax,%eax
call   1040 <__real_pthread_yield@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <idle_metric_blame_shift_work@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__wrap_pthread_yield() {
%1 = alloca i32
%2 = call i32 (...) @idle_metric_blame_shift_idle()
%3 = call i32 (...) @__real_pthread_yield()
store i32 %3, i32* %1
%4 = call i32 (...) @idle_metric_blame_shift_work()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @__wrap_pthread_yield() {
%1 = tail call i32 (...) @idle_metric_blame_shift_idle()
%2 = tail call i32 (...) @__real_pthread_yield()
%3 = tail call i32 (...) @idle_metric_blame_shift_work()
ret i32 %2
}
int para_segundos(int hora, int minuto) {
  return (hora * 60 * 60) + (minuto * 60);
}


x86 assembly (clang, -O0):
<para_segundos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
imul   $0x3c,%eax,%eax
imul   $0x3c,-0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<para_segundos>:
imul   $0xe10,%edi,%ecx
imul   $0x3c,%esi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @para_segundos(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = mul nsw i32 %5, 60
%7 = mul nsw i32 %6, 60
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 60
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @para_segundos(i32 %0, i32 %1) {
%3 = mul i32 %0, 3600
%4 = mul nsw i32 %1, 60
%5 = add nsw i32 %4, %3
ret i32 %5
}
void free_c_imatrix(m, nrl, nrh, ncl, nch) int **m;
long nch, ncl, nrh, nrl;
{
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_c_imatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_c_imatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_c_imatrix(i32** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i32**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i32** %0, i32*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i32**, i32*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds i32*, i32** %11, i64 %12
%14 = load i32*, i32** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = getelementptr inbounds i32, i32* %16, i64 -1
%18 = bitcast i32* %17 to i8*
%19 = load i32**, i32*** %6
%20 = load i64, i64* %7
%21 = getelementptr inbounds i32*, i32** %19, i64 %20
%22 = getelementptr inbounds i32*, i32** %21, i64 -1
%23 = bitcast i32** %22 to i8*
ret void
}

LLVM IR (-O2):
define void @free_c_imatrix(i32** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i32*, i32** %0, i64 %1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 %3
%9 = getelementptr inbounds i32, i32* %8, i64 -1
%10 = bitcast i32* %9 to i8*
tail call void @free(i8* %10)
%11 = getelementptr inbounds i32*, i32** %6, i64 -1
%12 = bitcast i32** %11 to i8*
tail call void @free(i8* %12)
ret void
}
int thermal_notify_cdev_add(int cdev_id, const char *name, int max_state) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @thermal_notify_cdev_add(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ putint(int);
int f(int n) {
  putint(n);
  n = 10;
  putchar(n);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @putint(i32 %0)
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
void clockevents_suspend(void) {}


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

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

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

LLVM IR (-O2):
define void @clockevents_suspend() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_rectangle(int /*<<< orphan*/, float, float, float, float);
void g2_rectangle_(float *dev, float *x1, float *y1, float *x2, float *y2) {
  g2_rectangle(dtoi(*dev), *x1, *y1, *x2, *y2);
}


x86 assembly (clang, -O0):
<g2_rectangle_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <dtoi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm3
call   1040 <g2_rectangle@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_rectangle_>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <dtoi@plt>
movss  (%rbx),%xmm0
movss  (%r12),%xmm1
movss  (%r15),%xmm2
movss  (%r14),%xmm3
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <g2_rectangle@plt>

LLVM IR (-O0):
define void @g2_rectangle_(float* %0, float* %1, float* %2, float* %3, float* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
store float* %4, float** %10
%11 = load float*, float** %6
%12 = load float, float* %11
%13 = call i32 @dtoi(float %12)
%14 = load float*, float** %7
%15 = load float, float* %14
%16 = load float*, float** %8
%17 = load float, float* %16
%18 = load float*, float** %9
%19 = load float, float* %18
%20 = load float*, float** %10
%21 = load float, float* %20
%22 = call i32 @g2_rectangle(i32 %13, float %15, float %17, float %19, float %21)
ret void
}

LLVM IR (-O2):
define void @g2_rectangle_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, float* nocapture %4) {
%6 = load float, float* %0
%7 = tail call i32 @dtoi(float %6)
%8 = load float, float* %1
%9 = load float, float* %2
%10 = load float, float* %3
%11 = load float, float* %4
%12 = tail call i32 @g2_rectangle(i32 %7, float %8, float %9, float %10, float %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fillout(char, int);
int takedown(int n, int r) {
  if (r > 0) {
    fillout(' ', r);
    fillout('\b', r);
  }
  if (n > 0) {
    fillout('\b', n);
    fillout(' ', n);
    fillout('\b', n);
  }
  return (0);
}


x86 assembly (clang, -O0):
<takedown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1142 <takedown+0x32>
mov    -0x8(%rbp),%esi
mov    $0x20,%edi
call   1030 <fillout@plt>
mov    -0x8(%rbp),%esi
mov    $0x8,%edi
call   1030 <fillout@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1173 <takedown+0x63>
mov    -0x4(%rbp),%esi
mov    $0x8,%edi
call   1030 <fillout@plt>
mov    -0x4(%rbp),%esi
mov    $0x20,%edi
call   1030 <fillout@plt>
mov    -0x4(%rbp),%esi
mov    $0x8,%edi
call   1030 <fillout@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<takedown>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
test   %esi,%esi
jle    1131 <takedown+0x21>
mov    %esi,%ebp
mov    $0x20,%edi
call   1030 <fillout@plt>
mov    $0x8,%edi
mov    %ebp,%esi
call   1030 <fillout@plt>
test   %ebx,%ebx
jle    1159 <takedown+0x49>
mov    $0x8,%edi
mov    %ebx,%esi
call   1030 <fillout@plt>
mov    $0x20,%edi
mov    %ebx,%esi
call   1030 <fillout@plt>
mov    $0x8,%edi
mov    %ebx,%esi
call   1030 <fillout@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @takedown(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @fillout(i8 signext 32, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @fillout(i8 signext 8, i32 %10)
br label %12
12: ; preds = %7, %2
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = call i32 @fillout(i8 signext 8, i32 %16)
%18 = load i32, i32* %3
%19 = call i32 @fillout(i8 signext 32, i32 %18)
%20 = load i32, i32* %3
%21 = call i32 @fillout(i8 signext 8, i32 %20)
br label %22
22: ; preds = %15, %12
ret i32 0
}

LLVM IR (-O2):
define i32 @takedown(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @fillout(i8 signext 32, i32 %1)
%6 = tail call i32 @fillout(i8 signext 8, i32 %1)
br label %7
7: ; preds = %4, %2
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %13
9: ; preds = %7
%10 = tail call i32 @fillout(i8 signext 8, i32 %0)
%11 = tail call i32 @fillout(i8 signext 32, i32 %0)
%12 = tail call i32 @fillout(i8 signext 8, i32 %0)
br label %13
13: ; preds = %9, %7
ret i32 0
}
int getFrameForPage(int *table, int page) { return *(table + page); }


x86 assembly (clang, -O0):
<getFrameForPage>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFrameForPage>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @getFrameForPage(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int test_imm_C3uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xC3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C3uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0xc3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_C3uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 837518622720
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int rekur_euk(int a, int b) {
  if (b == 0) {
    return a;
  } else {
    return rekur_euk(b, (a % b));
  }
}


x86 assembly (clang, -O0):
<rekur_euk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <rekur_euk+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <rekur_euk+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <rekur_euk@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rekur_euk>:
mov    %edi,%eax
test   %esi,%esi
je     111d <rekur_euk+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <rekur_euk+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @rekur_euk(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ factorial(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_divexact(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void choose(mpz_t ans, int n, int r) {
  factorial(ans, n);
  mpz_t smaller;
  factorial(smaller, r);
  mpz_t third;
  factorial(third, n - r);
  mpz_mul(smaller, smaller, third);
  mpz_divexact(ans, ans, smaller);
}


x86 assembly (clang, -O0):
<choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <factorial@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <factorial@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
call   1030 <factorial@plt>
mov    -0x10(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mpz_mul@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <mpz_divexact@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <factorial@plt>
mov    %r14d,%esi
call   1030 <factorial@plt>
sub    %r14d,%ebp
mov    %ebp,%esi
call   1030 <factorial@plt>
call   1040 <mpz_mul@plt>
mov    %ebx,%edi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <mpz_divexact@plt>

LLVM IR (-O0):
define void @choose(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @factorial(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = call i32 @factorial(i32 %12, i32 %13)
%15 = load i32, i32* %8
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = sub nsw i32 %16, %17
%19 = call i32 @factorial(i32 %15, i32 %18)
%20 = load i32, i32* %7
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call i32 @mpz_mul(i32 %20, i32 %21, i32 %22)
%24 = load i32, i32* %4
%25 = load i32, i32* %4
%26 = load i32, i32* %7
%27 = call i32 @mpz_divexact(i32 %24, i32 %25, i32 %26)
ret void
}

LLVM IR (-O2):
define void @choose(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @factorial(i32 %0, i32 %1)
%5 = tail call i32 @factorial(i32 undef, i32 %2)
%6 = sub nsw i32 %1, %2
%7 = tail call i32 @factorial(i32 undef, i32 %6)
%8 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%9 = tail call i32 @mpz_divexact(i32 %0, i32 %0, i32 undef)
ret void
}
long I2SRxDataGetNonBlocking(unsigned long ulBase, unsigned long *pulData) {
  ;
  if ((*((volatile unsigned long *)(ulBase + 0x00000818))) != 0) {
    *pulData = (*((volatile unsigned long *)(ulBase + 0x00000800)));
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<I2SRxDataGetNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x818(%rax),%rax
cmp    $0x0,%rax
je     1140 <I2SRxDataGetNonBlocking+0x40>
mov    -0x10(%rbp),%rax
mov    0x800(%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x1,-0x8(%rbp)
jmp    1148 <I2SRxDataGetNonBlocking+0x48>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SRxDataGetNonBlocking>:
cmpq   $0x0,0x818(%rdi)
je     111a <I2SRxDataGetNonBlocking+0x1a>
mov    0x800(%rdi),%rax
mov    %rax,(%rsi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @I2SRxDataGetNonBlocking(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
%6 = load i64, i64* %4
%7 = add i64 %6, 2072
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i64, i64* %4
%13 = add i64 %12, 2048
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = load i64*, i64** %5
store i64 %15, i64* %16
store i64 1, i64* %3
br label %18
17: ; preds = %2
store i64 0, i64* %3
br label %18
18: ; preds = %17, %11
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @I2SRxDataGetNonBlocking(i64 %0, i64* nocapture writeonly %1) {
%3 = add i64 %0, 2072
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = add i64 %0, 2048
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
store i64 %10, i64* %1
br label %11
11: ; preds = %2, %7
%12 = phi i64 [ 1, %7 ], [ 0, %2 ]
ret i64 %12
}
/* Variables and functions */
int TerminateOscString(char *const oscString, size_t *const oscStringSize,
                       const size_t maxOscStringSize) {
  do {
    if (*oscStringSize >= maxOscStringSize) {
      return 1;
    }
    oscString[(*oscStringSize)++] = '\0';
  } while (*oscStringSize % 4 != 0);
  return 0;
}


x86 assembly (clang, -O0):
<TerminateOscString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jb     112d <TerminateOscString+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1162 <TerminateOscString+0x62>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
and    $0x3,%rax
cmp    $0x0,%rax
jne    1110 <TerminateOscString+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TerminateOscString>:
mov    (%rsi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %rdx,%rax
jae    112a <TerminateOscString+0x2a>
lea    0x1(%rax),%rcx
mov    %rcx,(%rsi)
movb   $0x0,(%rdi,%rax,1)
mov    (%rsi),%rax
test   $0x3,%al
jne    1110 <TerminateOscString+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @TerminateOscString(i8* nocapture writeonly %0, i64* nocapture %1, i64 %2) {
%4 = load i64, i64* %1
br label %5
5: ; preds = %8, %3
%6 = phi i64 [ %11, %8 ], [ %4, %3 ]
%7 = icmp ult i64 %6, %2
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = add nuw i64 %6, 1
store i64 %9, i64* %1
%10 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %10
%11 = load i64, i64* %1
%12 = and i64 %11, 3
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %8, %5
%15 = phi i32 [ 1, %5 ], [ 0, %8 ]
ret i32 %15
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int /*<<< orphan*/ fegetenv(int *);
int fegetexceptflag(fexcept_t *__flagp, int __excepts) {
  fexcept_t __fpscr;
  fegetenv(&__fpscr);
  *__flagp = __fpscr & __excepts;
  return 0;
}


x86 assembly (clang, -O0):
<fegetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <fegetenv@plt>
mov    -0x10(%rbp),%ecx
and    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fegetexceptflag>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x4(%rsp),%rdi
call   1030 <fegetenv@plt>
and    0x4(%rsp),%ebx
mov    %ebx,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fegetexceptflag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 @fegetenv(i32* %5)
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = and i32 %7, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @fegetexceptflag(i32* nocapture writeonly %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fegetenv(i32* %3)
%6 = load i32, i32* %3
%7 = and i32 %6, %1
store i32 %7, i32* %0
ret i32 0
}
/* Type definitions */
typedef scalar_t__ cl_uint;
typedef int /*<<< orphan*/ cl_int;
typedef int /*<<< orphan*/ cl_event;
typedef scalar_t__ cl_command_queue;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clEnqueueWaitForEvents(cl_command_queue command_queue,
                              cl_uint num_events, const cl_event *event_list) {
  unsigned int sys_args[3];
  sys_args[0] = (unsigned int)command_queue;
  sys_args[1] = (unsigned int)num_events;
  sys_args[2] = (unsigned int)event_list;
  return (cl_int)syscall(325, 1071, sys_args);
}


x86 assembly (clang, -O0):
<clEnqueueWaitForEvents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
lea    -0x24(%rbp),%rdx
mov    $0x145,%edi
mov    $0x42f,%esi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clEnqueueWaitForEvents(i64 %0, i64 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32*
%7 = alloca [3 x i32]
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32 %9, i32* %10
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 1
store i32 %12, i32* %13
%14 = load i32*, i32** %6
%15 = ptrtoint i32* %14 to i32
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
store i32 %15, i32* %16
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%18 = call i32 @syscall(i32 325, i32 1071, i32* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @clEnqueueWaitForEvents(i64 %0, i64 %1, i32* %2) {
%4 = alloca [3 x i32]
%5 = bitcast [3 x i32]* %4 to i8*
%6 = trunc i64 %0 to i32
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32 %6, i32* %7
%8 = trunc i64 %1 to i32
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
store i32 %8, i32* %9
%10 = ptrtoint i32* %2 to i64
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
store i32 %11, i32* %12
%13 = call i32 @syscall(i32 325, i32 1071, i32* %7)
ret i32 %13
}
int fn1(int i) {
  return ({ i; }) == ({ i; });
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    %ecx,-0xc(%rbp)
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn1(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
__attribute__((deprecated("use ut_string_free from libutils"))) void
rs_str_free(char **str) {
  if (NULL == str || NULL == *str)
    return;
  free(*str);
  *str = NULL;
}


x86 assembly (clang, -O0):
<rs_str_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1137 <rs_str_free+0x27>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    (%rcx),%rax
jne    113c <rs_str_free+0x2c>
jmp    1153 <rs_str_free+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs_str_free>:
push   %rbx
test   %rdi,%rdi
je     112d <rs_str_free+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <rs_str_free+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @rs_str_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %1, %3, %6
ret void
}
/* Variables and functions */
int fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int test_flush_stderr(void) { return fflush(stderr); }


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

x86 assembly (clang, -O2):
<test_flush_stderr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
define i32 @test_flush_stderr() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fflush(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void help_and_exit(FILE *fd, int code) {
  fprintf(fd, "Invalid syntax. Use GADA -h for help\n");
  exit(code);
}


x86 assembly (clang, -O0):
<help_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help_and_exit>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
lea    0xed3(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Invalid syntax. Use GADA -h for help\0A\00"
define void @help_and_exit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"Invalid syntax. Use GADA -h for help\0A\00"
define void @help_and_exit(i32* nocapture %0, i32 %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 37, i64 1, i32* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ io_hlt();
void task_idle(void) {
  for (;;) {
    io_hlt();
  }
}


x86 assembly (clang, -O0):
<task_idle>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <task_idle+0x9>
mov    $0x0,%al
call   1030 <io_hlt@plt>
jmp    1119 <task_idle+0x9>

x86 assembly (clang, -O2):
<task_idle>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <io_hlt@plt>
jmp    1120 <task_idle+0x10>

LLVM IR (-O0):
define void @task_idle() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @io_hlt()
br label %1
}

LLVM IR (-O2):
define void @task_idle() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @io_hlt()
br label %1
}
void testTrans(void) {}


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

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

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

LLVM IR (-O2):
define void @testTrans() {
ret void
}
int ft_isprint(int c) {
  int retour;
  retour = 0;
  if (c >= 32 && c <= 126)
    retour = 1;
  return (retour);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x4(%rbp)
jl     1129 <ft_isprint+0x29>
cmpl   $0x7e,-0x4(%rbp)
jg     1129 <ft_isprint+0x29>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %3
br label %10
10: ; preds = %9, %6, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
void prime5(void) { extern double bar5(double); }


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

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

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

LLVM IR (-O2):
define void @prime5() {
ret void
}
void print_stats() {}


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

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

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

LLVM IR (-O2):
define void @print_stats() {
ret void
}
struct bst_test_list *test_vcs_client_install(struct bst_test_list *tests) {
  return tests;
}


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

x86 assembly (clang, -O2):
<test_vcs_client_install>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.bst_test_list = type opaque
define %struct.bst_test_list* @test_vcs_client_install(%struct.bst_test_list* %0) {
%2 = alloca %struct.bst_test_list*
store %struct.bst_test_list* %0, %struct.bst_test_list** %2
%3 = load %struct.bst_test_list*, %struct.bst_test_list** %2
ret %struct.bst_test_list* %3
}

LLVM IR (-O2):
%struct.bst_test_list = type opaque
define %struct.bst_test_list* @test_vcs_client_install(%struct.bst_test_list* readnone returned %0) {
ret %struct.bst_test_list* %0
}
int main() {
  char a = "H";
  char *b = &a;
  printf("%s\n", *b);
  printf("%s\n", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rax
movsbl %al,%ebx
lea    0xedd(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"H\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
store i32 0, i32* %1
store i8 ptrtoint ([2 x i8]* @.str to i8), i8* %2
store i8* %2, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"H\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 sext (i8 ptrtoint ([2 x i8]* @.str to i8) to i32))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 sext (i8 ptrtoint ([2 x i8]* @.str to i8) to i32))
ret i32 0
}
int fixed_point_divide_mixed(int x, int n) { return x / n; }


x86 assembly (clang, -O0):
<fixed_point_divide_mixed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_point_divide_mixed>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @fixed_point_divide_mixed(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fixed_point_divide_mixed(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ print_error(char *, char const *const);
void _assert_true(const unsigned long long result, const char *const expression,
                  const char *const file, const int line) {
  if (!result) {
    print_error("                "
                "expected '%s' to be true\n",
                expression);
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_true>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115e <_assert_true+0x3e>
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <print_error@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_true>:
test   %rdi,%rdi
je     1126 <_assert_true+0x6>
ret
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
lea    0xecb(%rip),%rdi
call   1030 <print_error@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_fail@plt>

LLVM IR (-O0):
@.str = [42 x i8] c" expected '%s' to be true\0A\00"
define void @_assert_true(i64 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i64 %0, i64* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i64, i64* %5
%10 = icmp ne i64 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %4
%12 = load i8*, i8** %6
%13 = call i32 @print_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @_fail(i8* %14, i32 %15)
br label %17
17: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c" expected '%s' to be true\0A\00"
define void @_assert_true(i64 %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i64 %0, 0
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = tail call i32 @print_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i32 @_fail(i8* %2, i32 %3)
br label %9
9: ; preds = %6, %4
ret void
}