xunge/DecIR huggingface dataset:
void ssht_sampling_elm2ind(int *ind, int el, int m) { *ind = el * el + el + m; }


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

x86 assembly (clang, -O2):
<ssht_sampling_elm2ind>:
mov    %esi,%eax
imul   %esi,%eax
add    %esi,%eax
add    %edx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @ssht_sampling_elm2ind(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* %5
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = load i32*, i32** %4
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @ssht_sampling_elm2ind(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %1
%5 = add nsw i32 %4, %1
%6 = add nsw i32 %5, %2
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int, int, int, int, char *);
void __attribute__((stdcall))
func(int param1, int param2, int param3, int param4) {
  char buf[8];
  gets(buf);
  printf("%d %d %d %d %s\n", param1, param2, param3, param4, buf);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <gets@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    -0x18(%rbp),%r9
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x8(%rsp),%r12
mov    %r12,%rdi
call   1040 <gets@plt>
lea    0xeb6(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %r12,%r9
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%d %d %d %d %s\0A\00"
define void @func(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [8 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%11 = call i32 @gets(i8* %10)
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d %d %d %d %s\0A\00"
define void @func(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [8 x i8]
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i8* %6)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
float rand();
float randomFloat() { return rand() / (float)RAND_MAX; }


x86 assembly (clang, -O0):
<randomFloat>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomFloat>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @randomFloat() {
%1 = tail call float (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to float
%4 = fdiv float %1, %3
ret float %4
}
double RADIANES(double deg) { return (deg * 3.14159265358979323846) / 180.; }


x86 assembly (clang, -O0):
<RADIANES>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<RADIANES>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @RADIANES(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @RADIANES(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void print_array(unsigned long *a, unsigned long b) {
  unsigned long c;
  for (c = 0; c < b; c++)
    printf("%lu\n", a[c]);
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115f <print_array+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print_array+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1145 <print_array+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define void @print_array(i64* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t letoh16(uint8_t *buffer) {
  return (uint16_t)buffer[0] | (uint16_t)buffer[1] << 8;
}


x86 assembly (clang, -O0):
<letoh16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letoh16>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @letoh16(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @letoh16(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
int c2_min(int x, int y) { return y < x ? y : x; }


x86 assembly (clang, -O0):
<c2_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1121 <c2_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <c2_min+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2_min>:
mov    %edi,%eax
cmp    %edi,%esi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @c2_min(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 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @c2_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ stdscr;
void crl_init_screen(void) {
  initscr();
  raw();
  keypad(stdscr, TRUE);
  curs_set(0);
  noecho();
}


x86 assembly (clang, -O0):
<crl_init_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1050 <raw@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
xor    %edi,%edi
call   1070 <curs_set@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crl_init_screen>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1050 <raw@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
xor    %edi,%edi
call   1070 <curs_set@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <noecho@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define void @crl_init_screen() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @raw()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = call i32 @keypad(i32 %3, i32 %4)
%6 = call i32 @curs_set(i32 0)
%7 = call i32 (...) @noecho()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define void @crl_init_screen() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @raw()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = tail call i32 @keypad(i32 %3, i32 %4)
%6 = tail call i32 @curs_set(i32 0)
%7 = tail call i32 (...) @noecho()
ret void
}
char is_bishop(char p) { return (p & (1 << 2)) == (1 << 2); }


x86 assembly (clang, -O0):
<is_bishop>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x4,%eax
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bishop>:
mov    %edi,%eax
shr    $0x2,%al
and    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @is_bishop(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 4
%6 = icmp eq i32 %5, 4
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @is_bishop(i8 signext %0) {
%2 = lshr i8 %0, 2
%3 = and i8 %2, 1
ret i8 %3
}
/* Variables and functions */
int prefixLength(char const *);
int isAbsolute(const char *path) {
  int pl = prefixLength(path);
  return (((pl == 2) && (path[0] == '\\')) || (pl == 3));
}


x86 assembly (clang, -O0):
<isAbsolute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <prefixLength@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1147 <isAbsolute+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x5c,%ecx
mov    %al,-0xd(%rbp)
je     1151 <isAbsolute+0x41>
cmpl   $0x3,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAbsolute>:
push   %rbx
mov    %rdi,%rbx
call   1030 <prefixLength@plt>
mov    %eax,%ecx
cmp    $0x2,%eax
jne    112a <isAbsolute+0x1a>
mov    $0x1,%eax
cmpb   $0x5c,(%rbx)
je     1132 <isAbsolute+0x22>
xor    %eax,%eax
cmp    $0x3,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isAbsolute(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @prefixLength(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 92
br i1 %13, label %17, label %14
14: ; preds = %8, %1
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 3
br label %17
17: ; preds = %14, %8
%18 = phi i1 [ true, %8 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @isAbsolute(i8* %0) {
%2 = tail call i32 @prefixLength(i8* %0)
%3 = icmp eq i32 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 92
br i1 %6, label %10, label %7
7: ; preds = %4, %1
%8 = icmp eq i32 %2, 3
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %7, %4
%11 = phi i32 [ 1, %4 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  write(1, "\e!", 2);
  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)
mov    $0x1,%edi
lea    0xece(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\1B!\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 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1B!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TIOCSPTLCK;
int ioctl(int, int /*<<< orphan*/, int *);
int unlockpt(int fd) {
  int foo = 0;
  return (ioctl(fd, TIOCSPTLCK, &foo));
}


x86 assembly (clang, -O0):
<unlockpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlockpt>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@TIOCSPTLCK = global i32 0
define i32 @unlockpt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @TIOCSPTLCK
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
ret i32 %6
}

LLVM IR (-O2):
@TIOCSPTLCK = global i32 0
define i32 @unlockpt(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @TIOCSPTLCK
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ core3_swap(char *, int);
void U_EMRSETCOLORSPACE_swap(char *record, int torev) {
  core3_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRSETCOLORSPACE_swap>:
jmp    1030 <core3_swap@plt>

LLVM IR (-O0):
define void @U_EMRSETCOLORSPACE_swap(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 i32 @core3_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_EMRSETCOLORSPACE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t xorshift(void) {
  static uint32_t y = 2463534242;
  y = y ^ (y << 13);
  y = y ^ (y >> 17);
  y = y ^ (y << 5);
  return y;
}


x86 assembly (clang, -O0):
<xorshift>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    0x2f10(%rip),%ecx
shl    $0xd,%ecx
xor    %ecx,%eax
mov    %eax,0x2f05(%rip)
mov    0x2eff(%rip),%eax
mov    0x2ef9(%rip),%ecx
sar    $0x11,%ecx
xor    %ecx,%eax
mov    %eax,0x2eee(%rip)
mov    0x2ee8(%rip),%eax
mov    0x2ee2(%rip),%ecx
shl    $0x5,%ecx
xor    %ecx,%eax
mov    %eax,0x2ed7(%rip)
mov    0x2ed1(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorshift>:
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
shl    $0xd,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
sar    $0x11,%edx
xor    %ecx,%edx
mov    %edx,%eax
shl    $0x5,%eax
xor    %edx,%eax
mov    %eax,0x2eff(%rip)
ret

LLVM IR (-O0):
@xorshift.y = internal global i32 -1831433054
define i32 @xorshift() {
%1 = load i32, i32* @xorshift.y
%2 = load i32, i32* @xorshift.y
%3 = shl i32 %2, 13
%4 = xor i32 %1, %3
store i32 %4, i32* @xorshift.y
%5 = load i32, i32* @xorshift.y
%6 = load i32, i32* @xorshift.y
%7 = ashr i32 %6, 17
%8 = xor i32 %5, %7
store i32 %8, i32* @xorshift.y
%9 = load i32, i32* @xorshift.y
%10 = load i32, i32* @xorshift.y
%11 = shl i32 %10, 5
%12 = xor i32 %9, %11
store i32 %12, i32* @xorshift.y
%13 = load i32, i32* @xorshift.y
ret i32 %13
}

LLVM IR (-O2):
@xorshift.y = internal unnamed_addr global i32 -1831433054
define i32 @xorshift() {
%1 = load i32, i32* @xorshift.y
%2 = shl i32 %1, 13
%3 = xor i32 %2, %1
%4 = ashr i32 %3, 17
%5 = xor i32 %4, %3
%6 = shl i32 %5, 5
%7 = xor i32 %6, %5
store i32 %7, i32* @xorshift.y
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "mibtable [-d][-i ifname][-m mibtable.dat][-o format] oid...\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 = [61 x i8] c"mibtable [-d][-i ifname][-m mibtable.dat][-o format] oid...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"mibtable [-d][-i ifname][-m mibtable.dat][-o format] oid...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int add_passbyvalue(int x) {
  x = x + x;
  printf("The value of X inside passbyvalue\n");
  printf("value of x is %d\n\n", x);
  return x;
}


x86 assembly (clang, -O0):
<add_passbyvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_passbyvalue>:
push   %rbx
lea    (%rdi,%rdi,1),%ebx
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"The value of X inside passbyvalue\0A\00"
@.str.1 = [19 x i8] c"value of x is %d\0A\0A\00"
define i32 @add_passbyvalue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
store i32 %5, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"value of x is %d\0A\0A\00"
@str = [34 x i8] c"The value of X inside passbyvalue\00"
define i32 @add_passbyvalue(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 %2
}
int VL_NULL_GetNumBuffers(void *surface) {
  (void)surface;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @VL_NULL_GetNumBuffers(i8* nocapture readnone %0) {
ret i32 1
}
char Sign(unsigned char a) { return (a & 128) ? '-' : '+'; }


x86 assembly (clang, -O0):
<Sign>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x80,%edx
mov    $0x2b,%eax
mov    $0x2d,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sign>:
shr    $0x6,%dil
and    $0x2,%dil
lea    0x2b(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @Sign(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 45, i32 43
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @Sign(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
%3 = select i1 %2, i8 43, i8 45
ret i8 %3
}
int multByTwo(int num) {
  num <<= 1;
  return num;
}


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

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

LLVM IR (-O0):
define i32 @multByTwo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @multByTwo(i32 %0) {
%2 = shl i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int bar3();
int bar2(void) { return bar3(); }


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

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

LLVM IR (-O0):
define i32 @bar2() {
%1 = call i32 (...) @bar3()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar2() {
%1 = tail call i32 (...) @bar3()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *thread_main(void *arg) {
  double result = 1.0;
  printf("%f\n", result);
  pthread_exit(NULL);
  return NULL;
}


x86 assembly (clang, -O0):
<thread_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_main>:
push   %rax
lea    0xee0(%rip),%rdi
movsd  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <pthread_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i8* @thread_main(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
store double 1.000000e+00, double* %3
%4 = load double, double* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %4)
%6 = call i32 @pthread_exit(i32* null)
ret i8* null
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define noalias i8* @thread_main(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 1.000000e+00)
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* null
}
long polymost_drawtilescreen(long tilex, long tiley, long wallnum, long dimen) {
  return -1;
}


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

x86 assembly (clang, -O2):
<polymost_drawtilescreen>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @polymost_drawtilescreen(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret i64 -1
}

LLVM IR (-O2):
define i64 @polymost_drawtilescreen(i64 %0, i64 %1, i64 %2, i64 %3) {
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__11__GeneralIO__makeInput();
void OneWireMasterC__Pin__makeInput(void) {
  Msp430GpioC__11__GeneralIO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @OneWireMasterC__Pin__makeInput() {
%1 = tail call i32 (...) @Msp430GpioC__11__GeneralIO__makeInput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ maint_inv_range(unsigned long, unsigned long);
int /*<<< orphan*/ outer_inv_range(unsigned long, unsigned long);
void inv_dcache_range(unsigned long start, unsigned long end) {
  maint_inv_range(start, end);
  outer_inv_range(start, end);
}


x86 assembly (clang, -O0):
<inv_dcache_range>:
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 <maint_inv_range@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <outer_inv_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_dcache_range>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <maint_inv_range@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <outer_inv_range@plt>

LLVM IR (-O0):
define void @inv_dcache_range(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 i32 @maint_inv_range(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 @outer_inv_range(i64 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @inv_dcache_range(i64 %0, i64 %1) {
%3 = tail call i32 @maint_inv_range(i64 %0, i64 %1)
%4 = tail call i32 @outer_inv_range(i64 %0, i64 %1)
ret void
}
int test_imm_0Dint32_reg(int val) { return ((val) & (0x0D << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_0Dint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Dint32_reg>:
test   $0xd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Dint32_reg(i32 %0) {
%2 = and i32 %0, 13
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
#pragma omp parallel
  printf("Hello, world.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ binary_print(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
void display_flags(char *label, unsigned int value) {
  printf("%s\t: %d\t:", label, value);
  binary_print(value);
  printf("\n");
}


x86 assembly (clang, -O0):
<display_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <binary_print@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_flags>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <binary_print@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s\09: %d\09:\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @display_flags(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 i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @binary_print(i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s\09: %d\09:\00"
define void @display_flags(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @binary_print(i32 %1)
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateIntDisable(uint32_t ui32IntFlags) {

  ;
  (*((volatile unsigned long *)(0x400FC014))) &= ~ui32IntFlags;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400fc014,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400fc014,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
not    %rax
and    %rax,0x400fc014
40
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateIntDisable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074774036 to i64*)
%7 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateIntDisable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074774036 to i64*)
%7 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
char _get_index_char(int i) { return (char)i + 'a'; }


x86 assembly (clang, -O0):
<_get_index_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x61,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_index_char>:
lea    0x61(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @_get_index_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 97
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @_get_index_char(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 97
ret i8 %3
}
void gtk_widget_is_ancestor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_is_ancestor() {
ret void
}
void s5p6450_default_sdhci2(void) {}


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

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

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

LLVM IR (-O2):
define void @s5p6450_default_sdhci2() {
ret void
}
/* Variables and functions */
char *projectString(char *, char *, char, char);
char *gapAdjustFold(char *s, char *ref) {
  return projectString(s, ref, '-', ' ');
}


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

x86 assembly (clang, -O2):
<gapAdjustFold>:
mov    $0x2d,%edx
mov    $0x20,%ecx
jmp    1030 <projectString@plt>

LLVM IR (-O0):
define i8* @gapAdjustFold(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @projectString(i8* %5, i8* %6, i8 signext 45, i8 signext 32)
ret i8* %7
}

LLVM IR (-O2):
define i8* @gapAdjustFold(i8* %0, i8* %1) {
%3 = tail call i8* @projectString(i8* %0, i8* %1, i8 signext 45, i8 signext 32)
ret i8* %3
}
char *simple(s)
char *s;
{
  char *sname;
  sname = s;
  while (1) {
    if (any('/', sname))
      while (*sname++ != '/')
        ;
    else
      return (sname);
  }
}


x86 assembly (clang, -O0):
<simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x2f,%edi
mov    $0x0,%al
call   1030 <any@plt>
cmp    $0x0,%eax
je     1167 <simple+0x57>
jmp    1142 <simple+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1162 <simple+0x52>
jmp    1142 <simple+0x32>
jmp    1171 <simple+0x61>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1124 <simple+0x14>

x86 assembly (clang, -O2):
<simple>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2f,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <any@plt>
test   %eax,%eax
je     113f <simple+0x2f>
add    $0x1,%rbx
cmpb   $0x2f,-0x1(%rbx)
jne    1133 <simple+0x23>
jmp    1120 <simple+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @simple(i8* %0) {
%2 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @any to i32 (i32, i8*, ...)*)(i32 47, i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @any to i32 (i32, i8*, ...)*)(i32 47, i8* %9)
%6 = icmp eq i32 %5, 0
br i1 %6, label %13, label %12
7: ; preds = %1, %12
%8 = phi i8* [ %9, %12 ], [ %0, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 47
br i1 %11, label %4, label %12
12: ; preds = %7, %4
br label %7
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %9, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void menu(void) {
  puts("1. Cargar notas");
  puts("2. Mostrar notas");
  printf("3. Salir\n\nOpcion: ");
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"1. Cargar notas\00"
@.str.1 = [17 x i8] c"2. Mostrar notas\00"
@.str.2 = [19 x i8] c"3. Salir\0A\0AOpcion: \00"
define void @menu() {
%1 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"1. Cargar notas\00"
@.str.1 = [17 x i8] c"2. Mostrar notas\00"
@.str.2 = [19 x i8] c"3. Salir\0A\0AOpcion: \00"
define void @menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret void
}
isdig(c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<isdig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdig+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdig>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isdig(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ a(int);
int main(int argc, char **argv) {
  a(42);
  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)
mov    $0x2a,%edi
call   1030 <a@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <a@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @a(i32 42)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @a(i32 42)
ret i32 0
}
/* Variables and functions */
int i_abs(int *);
int intr_wrap_098(int p1) { return i_abs(&p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_098>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <i_abs@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @intr_wrap_098(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @i_abs(i32* %2)
ret i32 %3
}
void PrintFactPNCompVars1(void *theEnv, const char *logicalName,
                          void *theValue) {}


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

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

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

LLVM IR (-O2):
define void @PrintFactPNCompVars1(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
int mlx5_vhca_event_init(struct mlx5_core_dev *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.mlx5_core_dev = type opaque
define i32 @mlx5_vhca_event_init(%struct.mlx5_core_dev* %0) {
%2 = alloca %struct.mlx5_core_dev*
store %struct.mlx5_core_dev* %0, %struct.mlx5_core_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.mlx5_core_dev = type opaque
define i32 @mlx5_vhca_event_init(%struct.mlx5_core_dev* nocapture readnone %0) {
ret i32 0
}
void RGBAToJ400() {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @RGBAToJ400() {
ret void
}
/* Variables and functions */
unsigned int pow_int(unsigned int const, unsigned int const);
unsigned int n_combinations(unsigned int const n, unsigned int const m) {
  return (pow_int(n, m));
}


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

x86 assembly (clang, -O2):
<n_combinations>:
jmp    1030 <pow_int@plt>

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

LLVM IR (-O2):
define i32 @n_combinations(i32 %0, i32 %1) {
%3 = tail call i32 @pow_int(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char, char);
void display_move(int count, char source, char dest, int disk) {
  printf("[%d] Move the disk %d from %c to %c\n", count, disk, source, dest);
}


x86 assembly (clang, -O0):
<display_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%dl
mov    %edi,-0x4(%rbp)
mov    %dl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %ecx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x5(%rbp),%al
lea    0xec7(%rip),%rdi
movsbl %al,%ecx
movsbl -0x6(%rbp),%r8d
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_move>:
mov    %edx,%r8d
mov    %esi,%eax
mov    %edi,%esi
lea    0xee2(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"[%d] Move the disk %d from %c to %c\0A\00"
define void @display_move(i32 %0, i8 signext %1, i8 signext %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
store i32 %0, i32* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = load i8, i8* %6
%12 = load i8, i8* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i8 signext %11, i8 signext %12)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"[%d] Move the disk %d from %c to %c\0A\00"
define void @display_move(i32 %0, i8 signext %1, i8 signext %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3, i8 signext %1, i8 signext %2)
ret void
}
int *dang() {
  int a = 3;
  return &a;
}


x86 assembly (clang, -O0):
<dang>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
lea    -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dang>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @dang() {
%1 = alloca i32
ret i32* %1
}