xunge/DecIR huggingface dataset:
/* Type definitions */
struct ringbuf_t {
  int dummy;
};

/* Variables and functions */
size_t ringbuf_bytes_free(struct ringbuf_t const *);
size_t ringbuf_capacity(struct ringbuf_t const *);
size_t ringbuf_bytes_used(const struct ringbuf_t *rb) {
  return ringbuf_capacity(rb) - ringbuf_bytes_free(rb);
}


x86 assembly (clang, -O0):
<ringbuf_bytes_used>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ringbuf_capacity@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ringbuf_bytes_free@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ringbuf_bytes_used>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <ringbuf_capacity@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <ringbuf_bytes_free@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ringbuf_t = type { i32 }
define i64 @ringbuf_bytes_used(%struct.ringbuf_t* %0) {
%2 = alloca %struct.ringbuf_t*
store %struct.ringbuf_t* %0, %struct.ringbuf_t** %2
%3 = load %struct.ringbuf_t*, %struct.ringbuf_t** %2
%4 = call i64 @ringbuf_capacity(%struct.ringbuf_t* %3)
%5 = load %struct.ringbuf_t*, %struct.ringbuf_t** %2
%6 = call i64 @ringbuf_bytes_free(%struct.ringbuf_t* %5)
%7 = sub i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.ringbuf_t = type { i32 }
define i64 @ringbuf_bytes_used(%struct.ringbuf_t* %0) {
%2 = tail call i64 @ringbuf_capacity(%struct.ringbuf_t* %0)
%3 = tail call i64 @ringbuf_bytes_free(%struct.ringbuf_t* %0)
%4 = sub i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int puts(char const *);
int main(void) {
  int (*p)(const char *) = puts;
  for (;;)
    p("hello world");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xedf(%rip),%rdi
call   *-0x10(%rbp)
jmp    111a <main+0x1a>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32 (i8*)*
store i32 0, i32* %1
store i32 (i8*)* @puts, i32 (i8*)** %2
br label %3
3: ; preds = %3, %0
%4 = load i32 (i8*)*, i32 (i8*)** %2
%5 = call i32 %4(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %3
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int a(int, int);
int b(int, int);
int c(int i, int j) {
  int r = a(i, j);
  r = b(r, i);
  r = b(r, j);
  return r;
}


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

x86 assembly (clang, -O2):
<c>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <a@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <b@plt>
mov    %eax,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <b@plt>

LLVM IR (-O0):
define i32 @c(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @a(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = call i32 @b(i32 %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = call i32 @b(i32 %12, i32 %13)
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @c(i32 %0, i32 %1) {
%3 = tail call i32 @a(i32 %0, i32 %1)
%4 = tail call i32 @b(i32 %3, i32 %0)
%5 = tail call i32 @b(i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
char *strncpy(char *, char const *, size_t);
size_t xstr_len(char const *);
char *xstr_ncpy(char *destination, const char *source, size_t source_bytes) {
  if (source_bytes == -1) {
    source_bytes = xstr_len(source);
  }
  return strncpy(destination, source, source_bytes);
}


x86 assembly (clang, -O0):
<xstr_ncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jne    114c <xstr_ncpy+0x2c>
mov    -0x10(%rbp),%rdi
call   1040 <xstr_len@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstr_ncpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
cmp    $0xffffffffffffffff,%rdx
jne    113b <xstr_ncpy+0x1b>
mov    %rbx,%rdi
call   1040 <xstr_len@plt>
mov    %rax,%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define i8* @xstr_ncpy(i8* returned %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, -1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i64 @xstr_len(i8* %1)
br label %7
7: ; preds = %5, %3
%8 = phi i64 [ %6, %5 ], [ %2, %3 ]
%9 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %8)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ handle_51(int /*<<< orphan*/);
int gen_51() { handle_51(0); }


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

x86 assembly (clang, -O2):
<gen_51>:
xor    %edi,%edi
jmp    1030 <handle_51@plt>

LLVM IR (-O0):
define i32 @gen_51() {
%1 = alloca i32
%2 = call i32 @handle_51(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_51() {
%1 = tail call i32 @handle_51(i32 0)
ret i32 undef
}
float IMC(float peso, float altura) {
  float imc = peso / (altura * altura);
  return imc;
}


x86 assembly (clang, -O0):
<IMC>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<IMC>:
mulss  %xmm1,%xmm1
divss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @IMC(float %0, float %1) {
%3 = fmul float %1, %1
%4 = fdiv float %0, %3
ret float %4
}
/* Variables and functions */
scalar_t__ RAND_MAX;
int /*<<< orphan*/ assert(int);
scalar_t__ rand();
float random_float(float a, float b) {
  assert(a < b);
  float random = ((float)rand()) / (float)RAND_MAX;
  float diff = b - a;
  float r = random * diff;
  return a + r;
}


x86 assembly (clang, -O0):
<random_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x0,%al
call   1040 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2e89(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_float>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
xor    %edi,%edi
ucomiss %xmm0,%xmm1
seta   %dil
call   1030 <assert@plt>
xor    %eax,%eax
call   1040 <rand@plt>
cvtsi2ss %rax,%xmm2
mov    0x2e9b(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm2
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
subss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @random_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %3
store float %1, float* %4
%8 = load float, float* %3
%9 = load float, float* %4
%10 = fcmp olt float %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i64 (...) @rand()
%14 = sitofp i64 %13 to float
%15 = load i64, i64* @RAND_MAX
%16 = sitofp i64 %15 to float
%17 = fdiv float %14, %16
store float %17, float* %5
%18 = load float, float* %4
%19 = load float, float* %3
%20 = fsub float %18, %19
store float %20, float* %6
%21 = load float, float* %5
%22 = load float, float* %6
%23 = fmul float %21, %22
store float %23, float* %7
%24 = load float, float* %3
%25 = load float, float* %7
%26 = fadd float %24, %25
ret float %26
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @random_float(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i64 (...) @rand()
%7 = sitofp i64 %6 to float
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to float
%10 = fdiv float %7, %9
%11 = fsub float %1, %0
%12 = fmul float %11, %10
%13 = fadd float %12, %0
ret float %13
}
/* Variables and functions */
char *PHYSFS_getDirSeparator();
int /*<<< orphan*/ printf(char *, char *);
int cmd_getdirsep(char *args) {
  printf("Directory separator is [%s].\n", PHYSFS_getDirSeparator());
  return (1);
}


x86 assembly (clang, -O0):
<cmd_getdirsep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PHYSFS_getDirSeparator@plt>
mov    %rax,%rsi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_getdirsep>:
push   %rax
xor    %eax,%eax
call   1030 <PHYSFS_getDirSeparator@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Directory separator is [%s].\0A\00"
define i32 @cmd_getdirsep(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* (...) @PHYSFS_getDirSeparator()
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}

LLVM IR (-O2):
@.str = [30 x i8] c"Directory separator is [%s].\0A\00"
define i32 @cmd_getdirsep(i8* nocapture readnone %0) {
%2 = tail call i8* (...) @PHYSFS_getDirSeparator()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 1
}
/* Variables and functions */
scalar_t__ ENOENT;
scalar_t__ errno;
scalar_t__ mount(char *, char *, char *, int /*<<< orphan*/,
                 int /*<<< orphan*/);
int main() {
  if (mount("/dev/non-existant-device", "/mnt", "ext2", 0, 0)) {
    if (errno == ENOENT) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xeea(%rip),%rdx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <mount@plt>
cmp    $0x0,%rax
je     1174 <main+0x64>
mov    0x2e90(%rip),%rax
mov    (%rax),%rax
mov    0x2e76(%rip),%rcx
cmp    (%rcx),%rax
jne    116f <main+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    117b <main+0x6b>
jmp    1174 <main+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xefa(%rip),%rsi
lea    0xef8(%rip),%rdx
xor    %ebx,%ebx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <mount@plt>
test   %rax,%rax
je     114d <main+0x3d>
mov    0x2ea2(%rip),%rax
mov    (%rax),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
je     1152 <main+0x42>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"/dev/non-existant-device\00"
@.str.1 = [5 x i8] c"/mnt\00"
@.str.2 = [5 x i8] c"ext2\00"
@errno = global i64 0
@ENOENT = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @mount(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = load i64, i64* @errno
%6 = load i64, i64* @ENOENT
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %4
store i32 0, i32* %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9, %0
store i32 1, i32* %1
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"/dev/non-existant-device\00"
@.str.1 = [5 x i8] c"/mnt\00"
@.str.2 = [5 x i8] c"ext2\00"
@errno = global i64 0
@ENOENT = global i64 0
define i32 @main() {
%1 = tail call i64 @mount(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i64, i64* @errno
%5 = load i64, i64* @ENOENT
%6 = icmp eq i64 %4, %5
br i1 %6, label %8, label %7
7: ; preds = %3, %0
br label %8
8: ; preds = %3, %7
%9 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() { printf("%e", 7.0 - 3.0 * 34.0 / 40.0); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%e\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double 4.450000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%e\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double 4.450000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void Error(char *emsg) { printf(" Error in Towers: %s\n", emsg); }


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c" Error in Towers: %s\0A\00"
define void @Error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: unshar [-t] [-b] [-v] [-xfile] [file(s)]\n");
  exit(0);
}


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>
xor    %edi,%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>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: unshar [-t] [-b] [-v] [-xfile] [file(s)]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: unshar [-t] [-b] [-v] [-xfile] [file(s)]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
const char *librtaAbout_Name(void) { return "CCNx LibRTA"; }


x86 assembly (clang, -O0):
<librtaAbout_Name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<librtaAbout_Name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"CCNx LibRTA\00"
define i8* @librtaAbout_Name() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"CCNx LibRTA\00"
define i8* @librtaAbout_Name() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
__attribute__((no)) unsigned long long di_srl(unsigned long long x) {
  return (x >> 2);
}


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

x86 assembly (clang, -O2):
<di_srl>:
mov    %rdi,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @di_srl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 2
ret i64 %4
}

LLVM IR (-O2):
define i64 @di_srl(i64 %0) {
%2 = lshr i64 %0, 2
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _MM_TRANSPOSE4_PS(int /*<<< orphan*/, int /*<<< orphan*/,
                                     int /*<<< orphan*/, int /*<<< orphan*/);
void test_MM_TRANSPOSE4_PS(__m128 *A, __m128 *B, __m128 *C, __m128 *D) {
  _MM_TRANSPOSE4_PS(*A, *B, *C, *D);
}


x86 assembly (clang, -O0):
<test_MM_TRANSPOSE4_PS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
call   1030 <_MM_TRANSPOSE4_PS@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_MM_TRANSPOSE4_PS>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
jmp    1030 <_MM_TRANSPOSE4_PS@plt>

LLVM IR (-O0):
define void @test_MM_TRANSPOSE4_PS(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = call i32 @_MM_TRANSPOSE4_PS(i32 %10, i32 %12, i32 %14, i32 %16)
ret void
}

LLVM IR (-O2):
define void @test_MM_TRANSPOSE4_PS(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = tail call i32 @_MM_TRANSPOSE4_PS(i32 %5, i32 %6, i32 %7, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcharacterarray_(char *x, unsigned int *n) { lookNarray(x, *n); }


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

x86 assembly (clang, -O2):
<lookcharacterarray_>:
mov    (%rsi),%esi
jmp    1030 <lookNarray@plt>

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

LLVM IR (-O2):
define void @lookcharacterarray_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @lookNarray(i8* %0, i32 %3)
ret void
}
int operation1(int number) { return (number + 7) % 10; }


x86 assembly (clang, -O0):
<operation1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation1>:
add    $0x7,%edi
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @operation1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 7
%5 = srem i32 %4, 10
ret i32 %5
}

LLVM IR (-O2):
define i32 @operation1(i32 %0) {
%2 = add nsw i32 %0, 7
%3 = srem i32 %2, 10
ret i32 %3
}
int toBitN(int n) {
  int res;
  for (res = 0; n; res++)
    n /= 2;
  return res;
}


x86 assembly (clang, -O0):
<toBitN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <toBitN+0x34>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <toBitN+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toBitN>:
xor    %eax,%eax
test   %edi,%edi
je     1124 <toBitN+0x24>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
add    $0x1,%eax
add    $0x1,%edi
cmp    $0x2,%edi
mov    %ecx,%edi
ja     1110 <toBitN+0x10>
ret

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

LLVM IR (-O2):
define i32 @toBitN(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 2
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 1
%9 = icmp ult i32 %8, 3
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
unsigned xrop3_220_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T & stk3;
  stk1 = S | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_220_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_220_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int squareofsums(int);
int sumofsquares(int);
int main(int argc, char *argv[]) {
  printf("%d\n", squareofsums(100) - sumofsquares(100));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1030 <squareofsums@plt>
mov    %eax,%ebx
mov    $0x64,%edi
call   1050 <sumofsquares@plt>
sub    %eax,%ebx
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @squareofsums(i32 100)
%7 = call i32 @sumofsquares(i32 100)
%8 = sub nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @squareofsums(i32 100)
%4 = tail call i32 @sumofsquares(i32 100)
%5 = sub nsw i32 %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t get8(uint8_t **ppb) {
  uint8_t b = **ppb;
  (*ppb)++;
  return b;
}


x86 assembly (clang, -O0):
<get8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get8>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
add    $0x4,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @get8(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %2, i64 1
store i32* %4, i32** %0
ret i32 %3
}
/* Variables and functions */
double genrand_int32();
double genrand_real2(void) { return genrand_int32() * (1.0 / 4294967296.0); }


x86 assembly (clang, -O0):
<genrand_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real2>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand_real2() {
%1 = call double (...) @genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}

LLVM IR (-O2):
define double @genrand_real2() {
%1 = tail call double (...) @genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ dbgs(char *);
void __attribute__((unused)) dbgc(char s) {
  char buf[2] = " ";
  buf[0] = s;
  dbgs(buf);
}


x86 assembly (clang, -O0):
<dbgc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0xedb(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
lea    -0x3(%rbp),%rdi
call   1030 <dbgs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbgc>:
push   %rax
movw   $0x20,0x6(%rsp)
mov    %dil,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <dbgs@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.dbgc.buf = [2 x i8] c" \00"
define void @dbgc(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = bitcast [2 x i8]* %3 to i8*
%5 = load i8, i8* %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %5, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i32 @dbgs(i8* %7)
ret void
}

LLVM IR (-O2):
define void @dbgc(i8 signext %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
store i16 32, i16* %2
store i8 %0, i8* %3
%4 = call i32 @dbgs(i8* %3)
ret void
}
/* Variables and functions */
int ENOSYS;
int pthread_setconcurrency(int foo) { return -ENOSYS; }


x86 assembly (clang, -O0):
<pthread_setconcurrency>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ed8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_setconcurrency>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @pthread_setconcurrency(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_setconcurrency(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ gumbo_ascii_isupper(int);
__attribute__((__const__)) int gumbo_ascii_tolower(int c) {
  if (gumbo_ascii_isupper(c)) {
    return c | 32;
  }
  return c;
}


x86 assembly (clang, -O0):
<gumbo_ascii_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <gumbo_ascii_isupper@plt>
cmp    $0x0,%rax
je     113b <gumbo_ascii_tolower+0x2b>
mov    -0x8(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <gumbo_ascii_tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gumbo_ascii_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <gumbo_ascii_isupper@plt>
mov    %ebx,%ecx
or     $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gumbo_ascii_tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @gumbo_ascii_isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = or i32 %8, 32
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @gumbo_ascii_tolower(i32 %0) {
%2 = tail call i64 @gumbo_ascii_isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int random();
int32_t random_key(void) {
  int32_t x;
  x = random();
  assert(x >= 0);
  return (x % 100);
}


x86 assembly (clang, -O0):
<random_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <random@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_key>:
push   %rbx
xor    %eax,%eax
call   1040 <random@plt>
mov    %eax,%ebx
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
movslq %ebx,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_key() {
%1 = alloca i32
%2 = call i32 (...) @random()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %1
%8 = srem i32 %7, 100
ret i32 %8
}

LLVM IR (-O2):
define i32 @random_key() {
%1 = tail call i32 (...) @random()
%2 = xor i32 %1, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = srem i32 %1, 100
ret i32 %5
}
unsigned ff(unsigned a) { return a | 0x000ff000u; }


x86 assembly (clang, -O0):
<ff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0xff000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff>:
mov    %edi,%eax
or     $0xff000,%eax
ret

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

LLVM IR (-O2):
define i32 @ff(i32 %0) {
%2 = or i32 %0, 1044480
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAIT;
int /*<<< orphan*/ sys_futex0(int *, int /*<<< orphan*/, int);
void futex_wait(int *addr, int val) { sys_futex0(addr, FUTEX_WAIT, val); }


x86 assembly (clang, -O0):
<futex_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <sys_futex0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wait>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <sys_futex0@plt>

LLVM IR (-O0):
@FUTEX_WAIT = global i32 0
define void @futex_wait(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* @FUTEX_WAIT
%7 = load i32, i32* %4
%8 = call i32 @sys_futex0(i32* %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@FUTEX_WAIT = global i32 0
define void @futex_wait(i32* %0, i32 %1) {
%3 = load i32, i32* @FUTEX_WAIT
%4 = tail call i32 @sys_futex0(i32* %0, i32 %3, i32 %1)
ret void
}
int prwidth(base, indx) const char *const base[];
int indx;
{ return (strlen(base[indx])); }


x86 assembly (clang, -O0):
<prwidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prwidth>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rdi
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @prwidth(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = call i64 @strlen(i8* %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @prwidth(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = tail call i64 @strlen(i8* dereferenceable(1) %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Type definitions */
struct aa {
  int dummy;
};

/* Variables and functions */
struct aa *aa_reverse0(int /*<<< orphan*/ *, struct aa *);
struct aa *aa_reverse(struct aa *h) {
  return aa_reverse0(NULL, h);
}


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

x86 assembly (clang, -O2):
<aa_reverse>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <aa_reverse0@plt>

LLVM IR (-O0):
%struct.aa = type { i32 }
define %struct.aa* @aa_reverse(%struct.aa* %0) {
%2 = alloca %struct.aa*
store %struct.aa* %0, %struct.aa** %2
%3 = load %struct.aa*, %struct.aa** %2
%4 = call %struct.aa* @aa_reverse0(i32* null, %struct.aa* %3)
ret %struct.aa* %4
}

LLVM IR (-O2):
%struct.aa = type { i32 }
define %struct.aa* @aa_reverse(%struct.aa* %0) {
%2 = tail call %struct.aa* @aa_reverse0(i32* null, %struct.aa* %0)
ret %struct.aa* %2
}
void nop_f(void) {}


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

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

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

LLVM IR (-O2):
define void @nop_f() {
ret void
}
int marker1(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @marker1() {
ret i32 0
}
/* Variables and functions */
char *ctim2rfc(int /*<<< orphan*/, int);
int /*<<< orphan*/ ctime(long *);
char *genrfcdate(long tim, int tz) { return (ctim2rfc(ctime(&tim), tz)); }


x86 assembly (clang, -O0):
<genrfcdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1040 <ctim2rfc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrfcdate>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <ctime@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <ctim2rfc@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @genrfcdate(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = call i32 @ctime(i64* %3)
%6 = load i32, i32* %4
%7 = call i8* @ctim2rfc(i32 %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @genrfcdate(i64 %0, i32 %1) {
%3 = alloca i64
store i64 %0, i64* %3
%4 = call i32 @ctime(i64* %3)
%5 = call i8* @ctim2rfc(i32 %4, i32 %1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ deleteQcb(int);
int mymsgctl(int msqid, int cmd, void *buf) {
  deleteQcb(msqid);
  return 0;
}


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

x86 assembly (clang, -O2):
<mymsgctl>:
push   %rax
call   1030 <deleteQcb@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mymsgctl(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @deleteQcb(i32 %0)
ret i32 0
}
void soru_1(int a, int *p) {}


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

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

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

LLVM IR (-O2):
define void @soru_1(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sha1_do_hmac(void *, unsigned char *, int, unsigned long,
                                unsigned char *);
void sha1_generate(void *handle, unsigned char *blk, int len,
                   unsigned long seq) {
  sha1_do_hmac(handle, blk, len, seq, blk + len);
}


x86 assembly (clang, -O0):
<sha1_generate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%r8
movslq -0x14(%rbp),%rax
add    %rax,%r8
call   1030 <sha1_do_hmac@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha1_generate>:
movslq %edx,%rdx
lea    (%rsi,%rdx,1),%r8
jmp    1030 <sha1_do_hmac@plt>

LLVM IR (-O0):
define void @sha1_generate(i8* %0, i8* %1, i32 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i64, i64* %8
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = call i32 @sha1_do_hmac(i8* %9, i8* %10, i32 %11, i64 %12, i8* %16)
ret void
}

LLVM IR (-O2):
define void @sha1_generate(i8* %0, i8* %1, i32 %2, i64 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = tail call i32 @sha1_do_hmac(i8* %0, i8* %1, i32 %2, i64 %3, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ one();
int /*<<< orphan*/ two();
int main(int argc, char **argv) {
  one();
  two();
  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    $0x0,%al
call   1040 <one@plt>
mov    $0x0,%al
call   1030 <two@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <one@plt>
xor    %eax,%eax
call   1030 <two@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 (...) @one()
%7 = call i32 (...) @two()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @one()
%4 = tail call i32 (...) @two()
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(scalar_t__, int);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, scalar_t__);
char *convertString(char *value) {
  char *newString = (char *)calloc(strlen(value) + 1, sizeof(char));
  strncpy(newString, value + 1, strlen(value) - 2);
  return newString;
}


x86 assembly (clang, -O0):
<convertString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
sub    $0x2,%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertString>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%r14
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    -0x2(%rax),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strncpy@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @convertString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @calloc(i64 %6, i32 1)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8*, i8** %2
%13 = call i64 @strlen(i8* %12)
%14 = sub nsw i64 %13, 2
%15 = call i32 @strncpy(i8* %9, i8* %11, i64 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @convertString(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @calloc(i64 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%8 = add nsw i64 %7, -2
%9 = tail call i32 @strncpy(i8* %5, i8* %6, i64 %8)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ atof(char *);
int /*<<< orphan*/ putDouble(int /*<<< orphan*/);
void IF_vers(void) { putDouble(atof("0.60")); }


x86 assembly (clang, -O0):
<IF_vers>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <atof@plt>
mov    %eax,%edi
call   1040 <putDouble@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_vers>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <atof@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <putDouble@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"0.60\00"
define void @IF_vers() {
%1 = call i32 @atof(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @putDouble(i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"0.60\00"
define void @IF_vers() {
%1 = tail call i32 @atof(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putDouble(i32 %1)
ret void
}
int isWhite(unsigned char c) {
  switch (c) {
  case '\n':
  case '\r':
  case ' ':
  case '\t':
  case '\0':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isWhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1154 <isWhite+0x54>
jmp    111e <isWhite+0x1e>
mov    -0xc(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1154 <isWhite+0x54>
jmp    1132 <isWhite+0x32>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1154 <isWhite+0x54>
jmp    1143 <isWhite+0x43>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    1160 <isWhite+0x60>
jmp    1154 <isWhite+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1167 <isWhite+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isWhite>:
cmp    $0x20,%dil
ja     111e <isWhite+0x1e>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002601,%rdx
bt     %rcx,%rdx
jae    111e <isWhite+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isWhite(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %7 [
i32 10, label %6
i32 13, label %6
i32 32, label %6
i32 9, label %6
i32 0, label %6
]
6: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isWhite(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 10, label %3
i8 13, label %3
i8 32, label %3
i8 9, label %3
i8 0, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int *f4(int *ptr) { return ptr; }


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

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

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

LLVM IR (-O2):
define i32* @f4(i32* readnone returned %0) {
ret i32* %0
}