xunge/DecIR huggingface dataset:
/* Variables and functions */
int O_NOCTTY;
int O_RDWR;
int /*<<< orphan*/ errno_exit(char *);
int open(char const *, int);
int open_noctty(const char *pathname) {
  int fd = open(pathname, O_RDWR | O_NOCTTY);
  if (fd < 0)
    errno_exit("cannot open slave pseudo-terminal");
  return fd;
}


x86 assembly (clang, -O0):
<open_noctty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2e98(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1160 <open_noctty+0x40>
lea    0xea5(%rip),%rdi
call   1030 <errno_exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_noctty>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    114a <open_noctty+0x2a>
lea    0xebb(%rip),%rdi
call   1030 <errno_exit@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@.str = [34 x i8] c"cannot open slave pseudo-terminal\00"
define i32 @open_noctty(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_NOCTTY
%7 = or i32 %5, %6
%8 = call i32 @open(i8* %4, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @errno_exit(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@.str = [34 x i8] c"cannot open slave pseudo-terminal\00"
define i32 @open_noctty(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NOCTTY
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @errno_exit(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i32 %5
}
/* Type definitions */
struct statement {
  int dummy;
};
struct expression {
  int dummy;
};

/* Variables and functions */
struct statement *stmt_void();
struct statement *stmt_case(struct statement *stmt,
                            const struct expression *const_expr) {
  return stmt_void();
}


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

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

LLVM IR (-O0):
%struct.statement = type { i32 }
%struct.expression = type { i32 }
define %struct.statement* @stmt_case(%struct.statement* %0, %struct.expression* %1) {
%3 = alloca %struct.statement*
%4 = alloca %struct.expression*
store %struct.statement* %0, %struct.statement** %3
store %struct.expression* %1, %struct.expression** %4
%5 = call %struct.statement* (...) @stmt_void()
ret %struct.statement* %5
}

LLVM IR (-O2):
%struct.statement = type { i32 }
%struct.expression = type { i32 }
define %struct.statement* @stmt_case(%struct.statement* nocapture readnone %0, %struct.expression* nocapture readnone %1) {
%3 = tail call %struct.statement* (...) @stmt_void()
ret %struct.statement* %3
}
int execute_getresgid() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_getresgid() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_getresgid() {
ret i32 0
}
void input_stmt(void) {}


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

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

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

LLVM IR (-O2):
define void @input_stmt() {
ret void
}
/* Variables and functions */
int f469(int *);
int f470(int *p) { return f469(p); }


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

x86 assembly (clang, -O2):
<f470>:
jmp    1030 <f469@plt>

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

LLVM IR (-O2):
define i32 @f470(i32* %0) {
%2 = tail call i32 @f469(i32* %0)
ret i32 %2
}
/* Variables and functions */
int ad_server_listen(int);
int atoi(char *);
int main(int argc, char *argv[]) {
  int port = argc > 1 ? atoi(argv[1]) : 9229;
  return ad_server_listen(port);
}


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)
cmpl   $0x1,-0x8(%rbp)
jle    1155 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1162 <main+0x42>
mov    $0x240d,%eax
mov    %eax,-0x18(%rbp)
jmp    1162 <main+0x42>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <ad_server_listen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    %edi,%eax
mov    $0x240d,%edi
cmp    $0x2,%eax
jl     113c <main+0x1c>
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
add    $0x8,%rsp
jmp    1030 <ad_server_listen@plt>

LLVM IR (-O0):
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
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %9
%16 = phi i32 [ %13, %9 ], [ 9229, %14 ]
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = call i32 @ad_server_listen(i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 9229, %2 ]
%10 = tail call i32 @ad_server_listen(i32 %9)
ret i32 %10
}
void clipit16(float f, short *a) {
  if (f > 32766.5)
    *a = 32767;
  else if (f < -32767.5)
    *a = -32768;
  else
    *a = f;
}


x86 assembly (clang, -O0):
<clipit16>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1136 <clipit16+0x36>
mov    -0x10(%rbp),%rax
movw   $0x7fff,(%rax)
jmp    1177 <clipit16+0x77>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    115f <clipit16+0x5f>
mov    -0x10(%rbp),%rax
movw   $0x8000,(%rax)
jmp    1172 <clipit16+0x72>
movss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
jmp    1177 <clipit16+0x77>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clipit16>:
mov    $0x7fff,%ax
ucomiss 0xef5(%rip),%xmm0
ja     1122 <clipit16+0x22>
mov    $0x8000,%ax
movss  0xeeb(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1122 <clipit16+0x22>
cvttss2si %xmm0,%eax
mov    %ax,(%rdi)
ret

LLVM IR (-O0):
define void @clipit16(float %0, i16* %1) {
%3 = alloca float
%4 = alloca i16*
store float %0, float* %3
store i16* %1, i16** %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fcmp ogt double %6, 3.276650e+04
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i16*, i16** %4
store i16 32767, i16* %9
br label %21
10: ; preds = %2
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = fcmp olt double %12, -3.276750e+04
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i16*, i16** %4
store i16 -32768, i16* %15
br label %20
16: ; preds = %10
%17 = load float, float* %3
%18 = fptosi float %17 to i16
%19 = load i16*, i16** %4
store i16 %18, i16* %19
br label %20
20: ; preds = %16, %14
br label %21
21: ; preds = %20, %8
ret void
}

LLVM IR (-O2):
define void @clipit16(float %0, i16* nocapture writeonly %1) {
%3 = fcmp ogt float %0, 3.276650e+04
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = fcmp olt float %0, -3.276750e+04
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = fptosi float %0 to i16
br label %8
8: ; preds = %4, %2, %6
%9 = phi i16 [ %7, %6 ], [ 32767, %2 ], [ -32768, %4 ]
store i16 %9, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello");
  printf("world!");
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [7 x i8] c"world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("%d\n", exact_square(num));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <exact_square@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int test_imm_C1uint32_reg(unsigned int val) {
  return ((val) & (0xC1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C1uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 193
%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_C1uint32_reg(i32 %0) {
%2 = and i32 %0, 193
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ kill_command;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ getppid();
int /*<<< orphan*/ snprintf(char *, int, char *, long);
scalar_t__ system(char *);
void kill_parent() {
  char kill_command[100];
  snprintf(kill_command, sizeof(kill_command), "kill -9 %ld", (long)getppid());
  assert(system(kill_command) == 0);
}


x86 assembly (clang, -O0):
<kill_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    $0x0,%al
call   1060 <getppid@plt>
mov    -0x78(%rbp),%rdi
mov    %rax,%rcx
mov    $0x64,%esi
lea    0xe93(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_parent>:
push   %rbx
sub    $0x70,%rsp
xor    %eax,%eax
call   1060 <getppid@plt>
lea    0xead(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %rax,%rcx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"kill -9 %ld\00"
define void @kill_parent() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i64 (...) @getppid()
%4 = call i32 @snprintf(i8* %2, i32 100, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i64 @system(i8* %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"kill -9 %ld\00"
define void @kill_parent() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i64 (...) @getppid()
%4 = call i32 @snprintf(i8* %2, i32 100, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = call i64 @system(i8* %2)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret void
}
int test_imm_82uint32_mem(unsigned int *val) {
  return ((*val) & (0x82 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_82uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 130
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructNameString(struct constructHeader *);
const char *EnvGetDeffunctionName(void *theEnv, void *theDeffunction) {
  return GetConstructNameString((struct constructHeader *)theDeffunction);
}


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

x86 assembly (clang, -O2):
<EnvGetDeffunctionName>:
mov    %rsi,%rdi
jmp    1030 <GetConstructNameString@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDeffunctionName(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 %struct.constructHeader*
%7 = call i8* @GetConstructNameString(%struct.constructHeader* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDeffunctionName(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructNameString(%struct.constructHeader* %3)
ret i8* %4
}
unsigned char dance(unsigned char allbest, int fudgey) {
  if ((fudgey % 3) != 0)
    return allbest ^ 0xff;
  if ((fudgey & 1) == 0)
    return allbest ^ 0xa0;
  return (allbest >> 4) | (allbest << 4);
}


x86 assembly (clang, -O0):
<dance>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1132 <dance+0x32>
movzbl -0x2(%rbp),%eax
xor    $0xff,%eax
mov    %al,-0x1(%rbp)
jmp    1165 <dance+0x65>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1152 <dance+0x52>
movzbl -0x2(%rbp),%eax
xor    $0xa0,%eax
mov    %al,-0x1(%rbp)
jmp    1165 <dance+0x65>
movzbl -0x2(%rbp),%eax
sar    $0x4,%eax
movzbl -0x2(%rbp),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dance>:
mov    %edi,%eax
imul   $0xaaaaaaab,%esi,%ecx
add    $0x2aaaaaaa,%ecx
cmp    $0x55555555,%ecx
jb     1119 <dance+0x19>
not    %al
ret
test   $0x1,%sil
jne    1122 <dance+0x22>
xor    $0xa0,%al
ret
rol    $0x4,%al
ret

LLVM IR (-O0):
define zeroext i8 @dance(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = xor i32 %11, 255
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
br label %32
14: ; preds = %2
%15 = load i32, i32* %5
%16 = and i32 %15, 1
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = xor i32 %20, 160
%22 = trunc i32 %21 to i8
store i8 %22, i8* %3
br label %32
23: ; preds = %14
%24 = load i8, i8* %4
%25 = zext i8 %24 to i32
%26 = ashr i32 %25, 4
%27 = load i8, i8* %4
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 4
%30 = or i32 %26, %29
%31 = trunc i32 %30 to i8
store i8 %31, i8* %3
br label %32
32: ; preds = %23, %18, %9
%33 = load i8, i8* %3
ret i8 %33
}

LLVM IR (-O2):
define zeroext i8 @dance(i8 zeroext %0, i32 %1) {
%3 = srem i32 %1, 3
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = xor i8 %0, -1
br label %14
7: ; preds = %2
%8 = and i32 %1, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = xor i8 %0, -96
br label %14
12: ; preds = %7
%13 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 4)
br label %14
14: ; preds = %12, %10, %5
%15 = phi i8 [ %6, %5 ], [ %11, %10 ], [ %13, %12 ]
ret i8 %15
}
int getdate_yyerror(s)
char *s;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getdate_yyerror(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
void image_print_time(time_t timestamp) { printf("%s", ctime(&timestamp)); }


x86 assembly (clang, -O0):
<image_print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<image_print_time>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @image_print_time(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i8* @ctime(i32* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t n) {
  if ((ptr = realloc(ptr, n)) == 0) {
    perror("xrealloc");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
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 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1171 <xrealloc+0x41>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"xrealloc\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"xrealloc\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void Sys_system(char *cmd) { system(cmd); }


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

x86 assembly (clang, -O2):
<Sys_system>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define void @Sys_system(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Bonjour nsy103\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"Bonjour nsy103\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_26int8_reg(signed char val) {
  return ((val) & (-0x26 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_26int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffda,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_26int8_reg(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, -38
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_26int8_reg(i8 signext %0) {
%2 = and i8 %0, -38
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_3Duint8_mem(unsigned char *val) {
  return ((*val) & (0x3D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Duint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 61
%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_3Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 61
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void initializeCStack(char *stack, int *top) { *top = -1; }


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

x86 assembly (clang, -O2):
<initializeCStack>:
movl   $0xffffffff,(%rsi)
ret

LLVM IR (-O0):
define void @initializeCStack(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
store i32 -1, i32* %5
ret void
}

LLVM IR (-O2):
define void @initializeCStack(i8* nocapture readnone %0, i32* nocapture writeonly %1) {
store i32 -1, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setFlag();
void signalHandler(int sig) { setFlag(); }


x86 assembly (clang, -O0):
<signalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <setFlag@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @signalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @setFlag()
ret void
}

LLVM IR (-O2):
define void @signalHandler(i32 %0) {
%2 = tail call i32 (...) @setFlag()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void oom(void) {
  fprintf(stderr, "out of virtual memory\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"out of virtual memory\0A\00"
define void @oom() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"out of virtual memory\0A\00"
define void @oom() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
char *strcpy(char *to, const char *from) {
  while (*from)
    *to++ = *from++;
  *to++ = '\0';
  return (to);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <strcpy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax)
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 0, i8* %14
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void p() {
  puts("Membership pending... (There's also a super-sudirription you can also "
       "get for twice the price!)");
}


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

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

LLVM IR (-O0):
@.str = [96 x i8] c"Membership pending... (There's also a super-sudirription you can also get for twice the price!)\00"
define void @p() {
%1 = call i32 @puts(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [96 x i8] c"Membership pending... (There's also a super-sudirription you can also get for twice the price!)\00"
define void @p() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ranged_random_revmult_lazynopower2(int /*<<< orphan*/);
void loop_revmult_lazynopower2(size_t count, uint32_t range, uint32_t *output) {
  for (size_t i = 0; i < count; i++) {
    *output++ = ranged_random_revmult_lazynopower2(range);
  }
}


x86 assembly (clang, -O0):
<loop_revmult_lazynopower2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1165 <loop_revmult_lazynopower2+0x55>
mov    -0xc(%rbp),%edi
call   1030 <ranged_random_revmult_lazynopower2@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <loop_revmult_lazynopower2+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_revmult_lazynopower2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1145 <loop_revmult_lazynopower2+0x35>
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15d,%edi
call   1030 <ranged_random_revmult_lazynopower2@plt>
mov    %eax,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <loop_revmult_lazynopower2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @loop_revmult_lazynopower2(i64 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = phi i32* [ %10, %6 ], [ %2, %3 ]
%9 = tail call i32 @ranged_random_revmult_lazynopower2(i32 %1)
%10 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %9, i32* %8
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %0
br i1 %12, label %5, label %6
}
void of_clk_init(const struct of_device_id *matches) {}


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

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

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

LLVM IR (-O2):
%struct.of_device_id = type opaque
define void @of_clk_init(%struct.of_device_id* nocapture %0) {
ret void
}
/* Variables and functions */
int sv_volume(int, int);
int vox_volume(int slot, int vol) { return sv_volume(slot, vol); }


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

x86 assembly (clang, -O2):
<vox_volume>:
jmp    1030 <sv_volume@plt>

LLVM IR (-O0):
define i32 @vox_volume(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 @sv_volume(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @vox_volume(i32 %0, i32 %1) {
%3 = tail call i32 @sv_volume(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *do_something(void *arg) {
  int *valuePtr = (int *)arg;
  ++(*valuePtr);
  printf("Thread incremented value %d\n", *valuePtr);
  return NULL;
}


x86 assembly (clang, -O0):
<do_something>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"Thread incremented value %d\0A\00"
define i8* @do_something(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i8* null
}

LLVM IR (-O2):
@.str = [29 x i8] c"Thread incremented value %d\0A\00"
define noalias i8* @do_something(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* null
}
int is_leap(int year) {
  year += 1900;
  if ((unsigned int)year % 100 == 0) {
    return (unsigned int)year % 400 == 0;
  }
  return (unsigned int)year % 4 == 0;
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    1146 <is_leap+0x46>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <is_leap+0x5a>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
lea    0x76c(%rdi),%ecx
imul   $0xc28f5c29,%ecx,%eax
ror    $0x2,%eax
cmp    $0x28f5c28,%eax
jbe    111d <is_leap+0x1d>
and    $0x3,%edi
mov    %edi,%ecx
jmp    1132 <is_leap+0x32>
mov    %ecx,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x27,%rax
imul   $0x190,%eax,%eax
sub    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_leap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1900
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = urem i32 %6, 100
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* %3
%11 = urem i32 %10, 400
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
br label %19
14: ; preds = %1
%15 = load i32, i32* %3
%16 = urem i32 %15, 4
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
store i32 %18, i32* %2
br label %19
19: ; preds = %14, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_leap(i32 %0) {
%2 = add nsw i32 %0, 1900
%3 = urem i32 %2, 100
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = urem i32 %2, 400
br label %9
7: ; preds = %1
%8 = and i32 %0, 3
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int clz32(int /*<<< orphan*/);
int clo32(uint32_t val) { return clz32(~val); }


x86 assembly (clang, -O0):
<clo32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    $0xffffffff,%edi
call   1030 <clz32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clo32>:
not    %edi
jmp    1030 <clz32@plt>

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

LLVM IR (-O2):
define i32 @clo32(i32 %0) {
%2 = xor i32 %0, -1
%3 = tail call i32 @clz32(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ AuxAdiDdiSafeWrite(int, int, int);
void DDI8SetValBit(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Byte,
                   uint16_t ui16Mask, uint16_t ui16Val) {
  uint32_t ui32RegOffset;
  ;
  ;
  ;
  ;
  ui32RegOffset = 0x00000180 + (ui32Reg << 1) + (ui32Byte << 1);
  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset, (ui16Mask << 8) | ui16Val, 2);
}


x86 assembly (clang, -O0):
<DDI8SetValBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x180,%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    -0x18(%rbp),%edi
mov    -0x10(%rbp),%esi
shl    $0x8,%esi
or     -0x14(%rbp),%esi
mov    $0x2,%edx
call   1030 <AuxAdiDdiSafeWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DDI8SetValBit>:
add    %edx,%esi
lea    (%rdi,%rsi,2),%edi
add    $0x180,%edi
shl    $0x8,%ecx
or     %r8d,%ecx
mov    %ecx,%esi
mov    $0x2,%edx
jmp    1030 <AuxAdiDdiSafeWrite@plt>

LLVM IR (-O0):
define void @DDI8SetValBit(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %7
%13 = shl i32 %12, 1
%14 = add nsw i32 384, %13
%15 = load i32, i32* %8
%16 = shl i32 %15, 1
%17 = add nsw i32 %14, %16
store i32 %17, i32* %11
%18 = load i32, i32* %6
%19 = load i32, i32* %11
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %9
%22 = shl i32 %21, 8
%23 = load i32, i32* %10
%24 = or i32 %22, %23
%25 = call i32 @AuxAdiDdiSafeWrite(i32 %20, i32 %24, i32 2)
ret void
}

LLVM IR (-O2):
define void @DDI8SetValBit(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = add i32 %2, %1
%7 = shl i32 %6, 1
%8 = add i32 %0, 384
%9 = add i32 %8, %7
%10 = shl i32 %3, 8
%11 = or i32 %10, %4
%12 = tail call i32 @AuxAdiDdiSafeWrite(i32 %9, i32 %11, i32 2)
ret void
}
/* Variables and functions */
scalar_t__ __builtin_ynf(int, float);
int /*<<< orphan*/ link_failure_builtin_ynf();
void test_builtin_ynf(int x, float f) {
  if (__builtin_ynf(x, f) != __builtin_ynf(x, f))
    link_failure_builtin_ynf();
}


x86 assembly (clang, -O0):
<test_builtin_ynf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
call   1030 <__builtin_ynf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
call   1030 <__builtin_ynf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1165 <test_builtin_ynf+0x45>
mov    $0x0,%al
call   1040 <link_failure_builtin_ynf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_ynf>:
push   %r14
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %edi,%ebx
call   1030 <__builtin_ynf@plt>
mov    %rax,%r14
mov    %ebx,%edi
movss  0x4(%rsp),%xmm0
call   1030 <__builtin_ynf@plt>
cmp    %rax,%r14
jne    114e <test_builtin_ynf+0x2e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_builtin_ynf@plt>

LLVM IR (-O0):
define void @test_builtin_ynf(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = call i64 @__builtin_ynf(i32 %5, float %6)
%8 = load i32, i32* %3
%9 = load float, float* %4
%10 = call i64 @__builtin_ynf(i32 %8, float %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_builtin_ynf()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_builtin_ynf(i32 %0, float %1) {
%3 = tail call i64 @__builtin_ynf(i32 %0, float %1)
%4 = tail call i64 @__builtin_ynf(i32 %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_builtin_ynf()
br label %8
8: ; preds = %6, %2
ret void
}
int DecodeInt32LE(const char *data) {
  unsigned char *c = (unsigned char *)data;
  unsigned int val;
  val = (c[3] << 24) | (c[2] << 16) | (c[1] << 8) | c[0];
  return val;
}


x86 assembly (clang, -O0):
<DecodeInt32LE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecodeInt32LE>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @DecodeInt32LE(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}