xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int setregid(int /*<<< orphan*/, int /*<<< orphan*/);
int setreuid(int /*<<< orphan*/, int /*<<< orphan*/);
int restoreprivilege(void) {
  int error;
  error = setreuid((uid_t)0, (uid_t)0);
  if (error)
    return (error);
  error = setregid((gid_t)0, (gid_t)0);
  if (error)
    return (error);
  return (0);
}


x86 assembly (clang, -O0):
<restoreprivilege>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <setreuid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1149 <restoreprivilege+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <restoreprivilege+0x51>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <setregid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116a <restoreprivilege+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <restoreprivilege+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restoreprivilege>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <setreuid@plt>
test   %eax,%eax
je     1130 <restoreprivilege+0x10>
pop    %rcx
ret
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <setregid@plt>

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

LLVM IR (-O2):
define i32 @restoreprivilege() {
%1 = tail call i32 @setreuid(i32 0, i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @setregid(i32 0, i32 0)
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %1, %0 ], [ %4, %3 ]
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XButtonEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XButtonEvent_display(void *_p, void *_v) {
  ((XButtonEvent *)_p)->display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonEvent_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XButtonEvent_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XButtonEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
int /*<<< orphan*/ AES_decrypt(unsigned char const *, unsigned char *,
                               int /*<<< orphan*/ const *);
void JTR_AES_decrypt(const unsigned char *in, unsigned char *out,
                     const AES_KEY *key) {
  AES_decrypt(in, out, key);
}


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

x86 assembly (clang, -O2):
<JTR_AES_decrypt>:
jmp    1030 <AES_decrypt@plt>

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

LLVM IR (-O2):
define void @JTR_AES_decrypt(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32 @AES_decrypt(i8* %0, i8* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void close_screen() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @close_screen() {
%1 = tail call i32 (...) @endwin()
ret void
}
void emptyLastLine(int row, int col) {}


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

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

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

LLVM IR (-O2):
define void @emptyLastLine(i32 %0, i32 %1) {
ret void
}
void add_trace_symbol(const char func_name[], void *addr) { return; }


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

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

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

LLVM IR (-O2):
define void @add_trace_symbol(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void mem_put_lte32(unsigned char *mem, unsigned int val) {
  mem[0] = ((val)&0xff);
  mem[1] = ((val >> 8) & 0xff);
  mem[2] = ((val >> 16) & 0xff);
  mem[3] = ((val >> 24) & 0xff);
}


x86 assembly (clang, -O0):
<mem_put_lte32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_put_lte32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @mem_put_lte32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
void psync_pagecache_clean_cache() {}


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

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

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

LLVM IR (-O2):
define void @psync_pagecache_clean_cache() {
ret void
}
__attribute__((no, noclone)) int f1(int x, int y) { return x + y; }


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

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

LLVM IR (-O0):
define i32 @f1(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int getint(char *);
int elegirCantDigitos(void) {
  int num;
  do {
    num = getint("~~~ Elegir cant. de digitos: ...(entre 1 y 9)... ");
  } while (num <= 0 || num > 9);
  return num;
}


x86 assembly (clang, -O0):
<elegirCantDigitos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getint@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1140 <elegirCantDigitos+0x30>
cmpl   $0x9,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1118 <elegirCantDigitos+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elegirCantDigitos>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <getint@plt>
lea    -0xa(%rax),%ecx
cmp    $0xfffffff7,%ecx
jb     1120 <elegirCantDigitos+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"~~~ Elegir cant. de digitos: ...(entre 1 y 9)... \00"
define i32 @elegirCantDigitos() {
%1 = alloca i32
br label %2
2: ; preds = %10, %0
%3 = call i32 @getint(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %1
br label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 9
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ true, %4 ], [ %9, %7 ]
br i1 %11, label %2, label %12
12: ; preds = %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [50 x i8] c"~~~ Elegir cant. de digitos: ...(entre 1 y 9)... \00"
define i32 @elegirCantDigitos() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @getint(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = add i32 %2, -10
%4 = icmp ult i32 %3, -9
br i1 %4, label %1, label %5
5: ; preds = %1
ret i32 %2
}
int add2(int a) { return (a + 3) != 0; }


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

x86 assembly (clang, -O2):
<add2>:
xor    %eax,%eax
cmp    $0xfffffffd,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @add2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @add2(i32 %0) {
%2 = icmp ne i32 %0, -3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int maximum(int, int);
int max(int a, int b, int c) { return maximum(maximum(a, b), c); }


x86 assembly (clang, -O0):
<max>:
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
call   1030 <maximum@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <maximum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
push   %rbx
mov    %edx,%ebx
call   1030 <maximum@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <maximum@plt>

LLVM IR (-O0):
define i32 @max(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 = call i32 @maximum(i32 %7, i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @maximum(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @maximum(i32 %0, i32 %1)
%5 = tail call i32 @maximum(i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
scalar_t__ sys_domicrosleep(int /*<<< orphan*/, int);
scalar_t__ sys_poll_togui();
int sys_pollgui(void) { return (sys_domicrosleep(0, 1) || sys_poll_togui()); }


x86 assembly (clang, -O0):
<sys_pollgui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <sys_domicrosleep@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1157 <sys_pollgui+0x37>
mov    $0x0,%al
call   1030 <sys_poll_togui@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_pollgui>:
push   %rbx
mov    $0x1,%ebx
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <sys_domicrosleep@plt>
test   %rax,%rax
jne    1146 <sys_pollgui+0x26>
xor    %eax,%eax
call   1030 <sys_poll_togui@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sys_pollgui() {
%1 = call i64 @sys_domicrosleep(i32 0, i32 1)
%2 = icmp ne i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 (...) @sys_poll_togui()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @sys_pollgui() {
%1 = tail call i64 @sys_domicrosleep(i32 0, i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @sys_poll_togui()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
char *copys(s)
char *s;
{
  register int i;
  register char *cp;
  register char *result;
  i = 1;
  for (cp = s; *cp; cp++)
    i++;
  result = allocate((unsigned int)i);
  strcpy(result, s);
  return (result);
}


x86 assembly (clang, -O0):
<copys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <copys+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113b <copys+0x1b>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <allocate@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copys>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     113c <copys+0x1c>
mov    $0x1,%edi
xchg   %ax,%ax
cmpb   $0x0,(%rbx,%rdi,1)
lea    0x1(%rdi),%rdi
jne    1130 <copys+0x10>
jmp    1141 <copys+0x21>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <allocate@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define i8* @copys(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %7, %4 ]
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @allocate to i32 (i32, ...)*)(i32 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = tail call i8* @strcpy(i8* dereferenceable(1) %15, i8* dereferenceable(1) %0)
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void emitln(char *s) { printf("\t%s\n", s); }


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

x86 assembly (clang, -O2):
<emitln>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\09%s\0A\00"
define void @emitln(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void escreveVet(int vet[], int tam) {
  int i;
  for (i = 0; i < tam; i++)
    printf("vet[%d] = %d\n", i, vet[i]);
}


x86 assembly (clang, -O0):
<escreveVet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <escreveVet+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <escreveVet+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escreveVet>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <escreveVet+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <escreveVet+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"vet[%d] = %d\0A\00"
define void @escreveVet(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
void functionThatExpectsAConstCharPointer(const char *param) {}


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

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

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

LLVM IR (-O2):
define void @functionThatExpectsAConstCharPointer(i8* nocapture %0) {
ret void
}
/* Variables and functions */
long from_gps(int);
long ch_carrier_cycle(int ch) {
  long result;
  result = from_gps((ch << 3) + 6);
  result = result << 16;
  result = result + from_gps((ch << 3) + 2);
  return (result);
}


x86 assembly (clang, -O0):
<ch_carrier_cycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
add    $0x6,%edi
call   1030 <from_gps@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
add    $0x2,%edi
call   1030 <from_gps@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_carrier_cycle>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
lea    0x6(,%r14,8),%edi
call   1030 <from_gps@plt>
mov    %rax,%rbx
shl    $0x10,%rbx
lea    0x2(,%r14,8),%edi
call   1030 <from_gps@plt>
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @ch_carrier_cycle(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 3
%6 = add nsw i32 %5, 6
%7 = call i64 @from_gps(i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = shl i64 %8, 16
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = load i32, i32* %2
%12 = shl i32 %11, 3
%13 = add nsw i32 %12, 2
%14 = call i64 @from_gps(i32 %13)
%15 = add nsw i64 %10, %14
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @ch_carrier_cycle(i32 %0) {
%2 = shl i32 %0, 3
%3 = or i32 %2, 6
%4 = tail call i64 @from_gps(i32 %3)
%5 = shl i64 %4, 16
%6 = or i32 %2, 2
%7 = tail call i64 @from_gps(i32 %6)
%8 = add nsw i64 %5, %7
ret i64 %8
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int WEOF;
wint_t btowc(int c) { return (c >= 0 && c <= 0x7f) ? c : WEOF; }


x86 assembly (clang, -O0):
<btowc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1126 <btowc+0x26>
cmpl   $0x7f,-0x4(%rbp)
jg     1126 <btowc+0x26>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <btowc+0x32>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btowc>:
mov    %edi,%eax
cmp    $0x80,%edi
jb     1113 <btowc+0x13>
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@WEOF = global i32 0
define i32 @btowc(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = load i32, i32* @WEOF
%4 = select i1 %2, i32 %0, i32 %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int lis_(int *, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a[] = {6, 9, 2, 5, 0, 8, 9, 10};
  int len = sizeof(a) / sizeof(a[0]);
  printf("len of LIS is %d", lis_(a, len));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x8,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <lis_@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1040 <lis_@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 6, i32 9, i32 2, i32 5, i32 0, i32 8, i32 9, i32 10]
@.str = [17 x i8] c"len of LIS is %d\00"
define void @main() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = bitcast [8 x i32]* %1 to i8*
store i32 8, i32* %2
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @lis_(i32* %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@__const.main.a = [8 x i32] [i32 6, i32 9, i32 2, i32 5, i32 0, i32 8, i32 9, i32 10]
@.str = [17 x i8] c"len of LIS is %d\00"
define void @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @lis_(i32* %3, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ac_test(char *);
int main(int argc, char **argv) {
  ac_test("Hello World!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ac_test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t FSE_countFast(unsigned int *, unsigned int *, void const *, size_t);
size_t FSE_count_parallel(unsigned int *, unsigned int *, void const *, size_t,
                          int);
size_t FSE_count(unsigned *count, unsigned *maxSymbolValuePtr,
                 const void *source, size_t sourceSize) {
  if (*maxSymbolValuePtr < 255)
    return FSE_count_parallel(count, maxSymbolValuePtr, source, sourceSize, 1);
  *maxSymbolValuePtr = 255;
  return FSE_countFast(count, maxSymbolValuePtr, source, sourceSize);
}


x86 assembly (clang, -O0):
<FSE_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0xff,(%rax)
jae    116c <FSE_count+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <FSE_count_parallel@plt>
mov    %rax,-0x8(%rbp)
jmp    118f <FSE_count+0x6f>
mov    -0x18(%rbp),%rax
movl   $0xff,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <FSE_countFast@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FSE_count>:
cmpl   $0xfe,(%rsi)
ja     1133 <FSE_count+0x13>
mov    $0x1,%r8d
jmp    1030 <FSE_count_parallel@plt>
movl   $0xff,(%rsi)
jmp    1040 <FSE_countFast@plt>

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

LLVM IR (-O2):
define i64 @FSE_count(i32* %0, i32* %1, i8* %2, i64 %3) {
%5 = load i32, i32* %1
%6 = icmp ult i32 %5, 255
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i64 @FSE_count_parallel(i32* %0, i32* %1, i8* %2, i64 %3, i32 1)
br label %11
9: ; preds = %4
store i32 255, i32* %1
%10 = tail call i64 @FSE_countFast(i32* %0, i32* %1, i8* %2, i64 %3)
br label %11
11: ; preds = %9, %7
%12 = phi i64 [ %8, %7 ], [ %10, %9 ]
ret i64 %12
}
/* Variables and functions */
int memcmp(void const *, char const *, size_t);
size_t strlen(char const *);
int fast_memcmpstart(const void *mem, size_t memlen, const char *prefix) {
  size_t plen = strlen(prefix);
  if (memlen < plen)
    return -1;
  return (memcmp((mem), (prefix), (plen)));
}


x86 assembly (clang, -O0):
<fast_memcmpstart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    115b <fast_memcmpstart+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <fast_memcmpstart+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_memcmpstart>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rdx,%rdi
call   1030 <strlen@plt>
cmp    %r15,%rax
jbe    1146 <fast_memcmpstart+0x26>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @fast_memcmpstart(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = icmp ugt i64 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memcmp(i8* %0, i8* %2, i64 %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
void RasterTiming2Configure(unsigned int baseAddr, unsigned int flag,
                            unsigned int acb_i, unsigned int acb) {
  (*((volatile unsigned int *)(baseAddr + (0x34)))) |= flag;
  (*((volatile unsigned int *)(baseAddr + (0x34)))) |= (acb_i << (0x00000010u));
  (*((volatile unsigned int *)(baseAddr + (0x34)))) |= (acb << (0x00000008u));
}


x86 assembly (clang, -O0):
<RasterTiming2Configure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x34,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
shl    $0x10,%edx
mov    -0x4(%rbp),%eax
add    $0x34,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%edx
shl    $0x8,%edx
mov    -0x4(%rbp),%eax
add    $0x34,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterTiming2Configure>:
add    $0x34,%edi
or     %esi,(%rdi)
shl    $0x10,%edx
or     %edx,(%rdi)
shl    $0x8,%ecx
or     %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @RasterTiming2Configure(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = add i32 %10, 52
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = or i32 %14, %9
store volatile i32 %15, i32* %13
%16 = load i32, i32* %7
%17 = shl i32 %16, 16
%18 = load i32, i32* %5
%19 = add i32 %18, 52
%20 = zext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load volatile i32, i32* %21
%23 = or i32 %22, %17
store volatile i32 %23, i32* %21
%24 = load i32, i32* %8
%25 = shl i32 %24, 8
%26 = load i32, i32* %5
%27 = add i32 %26, 52
%28 = zext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
%30 = load volatile i32, i32* %29
%31 = or i32 %30, %25
store volatile i32 %31, i32* %29
ret void
}

LLVM IR (-O2):
define void @RasterTiming2Configure(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %0, 52
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, %1
store volatile i32 %9, i32* %7
%10 = shl i32 %2, 16
%11 = load volatile i32, i32* %7
%12 = or i32 %11, %10
store volatile i32 %12, i32* %7
%13 = shl i32 %3, 8
%14 = load volatile i32, i32* %7
%15 = or i32 %14, %13
store volatile i32 %15, i32* %7
ret void
}
/* Variables and functions */
unsigned short _LE_to_BE_short(unsigned short);
unsigned short inw(int port) {
  return (_LE_to_BE_short(
      *((unsigned short *)(((unsigned long)0x80000000) + port))));
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x80000000,%rcx
add    %rcx,%rax
movzwl (%rax),%edi
call   1030 <_LE_to_BE_short@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
movslq %edi,%rax
mov    $0x80000000,%ecx
movzwl (%rax,%rcx,1),%edi
jmp    1030 <_LE_to_BE_short@plt>

LLVM IR (-O0):
define zeroext i16 @inw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = add i64 2147483648, %4
%6 = inttoptr i64 %5 to i16*
%7 = load i16, i16* %6
%8 = call zeroext i16 @_LE_to_BE_short(i16 zeroext %7)
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @inw(i32 %0) {
%2 = sext i32 %0 to i64
%3 = add nsw i64 %2, 2147483648
%4 = inttoptr i64 %3 to i16*
%5 = load i16, i16* %4
%6 = tail call zeroext i16 @_LE_to_BE_short(i16 zeroext %5)
ret i16 %6
}
/* Variables and functions */
int rint(double);
int lbs_to_grams(double lbs) { return rint(lbs * 453.6); }


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

x86 assembly (clang, -O2):
<lbs_to_grams>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <rint@plt>

LLVM IR (-O0):
define i32 @lbs_to_grams(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 4.536000e+02
%5 = call i32 @rint(double %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @lbs_to_grams(double %0) {
%2 = fmul double %0, 4.536000e+02
%3 = tail call i32 @rint(double %2)
ret i32 %3
}
/* Variables and functions */
double cos(double);
double sin(double);
void sincos(double x, double *s, double *c) {
  s[0] = sin(x);
  c[0] = cos(x);
}


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

x86 assembly (clang, -O2):
<sincos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sincos(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* %4
%8 = call double @sin(double %7)
%9 = load double*, double** %5
%10 = getelementptr inbounds double, double* %9, i64 0
store double %8, double* %10
%11 = load double, double* %4
%12 = call double @cos(double %11)
%13 = load double*, double** %6
%14 = getelementptr inbounds double, double* %13, i64 0
store double %12, double* %14
ret void
}

LLVM IR (-O2):
define void @sincos(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call double @sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
unsigned char *zrealloc(unsigned char *, unsigned int);
unsigned char *ziplistResize(unsigned char *zl, unsigned int len) {
  zl = zrealloc(zl, len);
  (*((uint32_t *)(zl))) = (len);
  zl[len - 1] = 255;
  return zl;
}


x86 assembly (clang, -O0):
<ziplistResize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <zrealloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movb   $0xff,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ziplistResize>:
push   %rbx
mov    %esi,%ebx
call   1030 <zrealloc@plt>
mov    %ebx,(%rax)
add    $0xffffffff,%ebx
movb   $0xff,(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ziplistResize(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @zrealloc(i8* %5, i32 %6)
store i8* %7, i8** %3
%8 = load i32, i32* %4
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sub i32 %12, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 -1, i8* %15
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @ziplistResize(i8* %0, i32 %1) {
%3 = tail call i8* @zrealloc(i8* %0, i32 %1)
%4 = bitcast i8* %3 to i32*
store i32 %1, i32* %4
%5 = add i32 %1, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
store i8 -1, i8* %7
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fannkuch(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int n = 11;
  printf("Pfannkuchen(%d) = %ld\n", n, fannkuch(n));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Pfannkuchen(%d) = %ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 11, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @fannkuch(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Pfannkuchen(%d) = %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fannkuch(i32 11)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 11, i32 %3)
ret i32 0
}
int test_imm_10uint16_mem(unsigned short *val) {
  return ((*val) & (0x10 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_10uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 16
%7 = icmp ne i32 %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_10uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 16
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *setlocale(int catebory, const char *locale) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @setlocale(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @setlocale(i32 %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ memcmp(int /*<<< orphan*/ const *,
                          int /*<<< orphan*/ const *, int);
int sigisemptyset(const sigset_t *set) {
  static const sigset_t zeroset;
  return !memcmp(set, &zeroset, 8);
}


x86 assembly (clang, -O0):
<sigisemptyset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x8,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigisemptyset>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x8,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@sigisemptyset.zeroset = internal constant i32 0
define i32 @sigisemptyset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @memcmp(i32* %3, i32* @sigisemptyset.zeroset, i32 8)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@sigisemptyset.zeroset = internal constant i32 0
define i32 @sigisemptyset(i32* %0) {
%2 = tail call i32 @memcmp(i32* %0, i32* @sigisemptyset.zeroset, i32 8)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x = 4, y = 5;
  printf("Hello World!\n");
  printf("Sum of %d and %d is %d\n", x, y, x + y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0x9,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [24 x i8] c"Sum of %d and %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
store i32 5, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"Sum of %d and %d is %d\0A\00"
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 5, i32 9)
ret i32 0
}
/* Variables and functions */
void nop_signal_handler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @nop_signal_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func1(int);
int /*<<< orphan*/ func2(double);
int main() {
  func2(1.0);
  func1(3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
call   1040 <func2@plt>
mov    $0x3,%edi
call   1030 <func1@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <func2@plt>
mov    $0x3,%edi
call   1030 <func1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @func2(double 1.000000e+00)
%2 = call i32 @func1(i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func2(double 1.000000e+00)
%2 = tail call i32 @func1(i32 3)
ret i32 0
}