xunge/DecIR huggingface dataset:
void scp(char *dest, const char *src) {
  while (*src) {
    *dest++ = *src++;
  }
  *dest = '\0';
}


x86 assembly (clang, -O0):
<scp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <scp+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 <scp+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scp>:
mov    (%rsi),%al
test   %al,%al
je     1121 <scp+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <scp+0x10>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @scp(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
store i8 0, i8* %16
ret void
}

LLVM IR (-O2):
define void @scp(i8* nocapture 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 ]
store i8 0, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test_non_identifiers() {
  int i, x;
#pragma omp parallel
#pragma omp sections;
  { foo(); }
#pragma omp parallel
#pragma omp sections linear(x);
  { foo(); }
#pragma omp parallel
#pragma omp sections private(x);
  { foo(); }
#pragma omp parallel
#pragma omp sections, private(x);
  { foo(); }
}


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

x86 assembly (clang, -O2):
<test_non_identifiers>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test_non_identifiers() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @foo()
%4 = call i32 (...) @foo()
%5 = call i32 (...) @foo()
%6 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @test_non_identifiers() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
size_t read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ sleep(int);
size_t write(int, char *, int);
int main() {
  size_t r;
  while (1) {
    r = write(1, "ptest out\n", 10);
    char buf[10];
    r = read(0, buf, 10);
    r = write(3, buf, 10);
    sleep(1);
  }
  (void)r;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xeb5(%rip),%rsi
mov    $0xa,%edx
call   1030 <write@plt>
mov    %rax,-0x10(%rbp)
lea    -0x1a(%rbp),%rsi
xor    %edi,%edi
mov    $0xa,%edx
call   1040 <read@plt>
mov    %rax,-0x10(%rbp)
lea    -0x1a(%rbp),%rsi
mov    $0x3,%edi
mov    $0xa,%edx
call   1030 <write@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xec2(%rip),%r14
lea    0xe(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0xa,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <read@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [11 x i8] c"ptest out\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [10 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %0, %4
%5 = call i64 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
store i64 %5, i64* %2
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = call i64 @read(i32 0, i8* %6, i32 10)
store i64 %7, i64* %2
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i64 @write(i32 3, i8* %8, i32 10)
store i64 %9, i64* %2
%10 = call i32 @sleep(i32 1)
br label %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"ptest out\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = tail call i64 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = call i64 @read(i32 0, i8* %2, i32 10)
%6 = call i64 @write(i32 3, i8* %2, i32 10)
%7 = tail call i32 @sleep(i32 1)
br label %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct dynar {
  int dummy;
};
typedef int /*<<< orphan*/ len;

/* Variables and functions */
int /*<<< orphan*/ dynar_cat(struct dynar *, scalar_t__ *, int);
void msg_add_len(struct dynar *msg) {
  uint32_t len;
  len = 0;
  dynar_cat(msg, &len, sizeof(len));
}


x86 assembly (clang, -O0):
<msg_add_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <dynar_cat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_add_len>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <dynar_cat@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.dynar = type { i32 }
define void @msg_add_len(%struct.dynar* %0) {
%2 = alloca %struct.dynar*
%3 = alloca i64
store %struct.dynar* %0, %struct.dynar** %2
store i64 0, i64* %3
%4 = load %struct.dynar*, %struct.dynar** %2
%5 = call i32 @dynar_cat(%struct.dynar* %4, i64* %3, i32 8)
ret void
}

LLVM IR (-O2):
%struct.dynar = type { i32 }
define void @msg_add_len(%struct.dynar* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = call i32 @dynar_cat(%struct.dynar* %0, i64* %2, i32 8)
ret void
}
void foo220(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo220(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arreglo();
int main() {
  arreglo();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @arreglo()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @arreglo()
ret i32 0
}
/* Variables and functions */
float coshf(float);
float futrts_cosh32(float x) { return coshf(x); }


x86 assembly (clang, -O0):
<futrts_cosh32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <coshf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futrts_cosh32>:
jmp    1030 <coshf@plt>

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

LLVM IR (-O2):
define float @futrts_cosh32(float %0) {
%2 = tail call float @coshf(float %0)
ret float %2
}
void global_filetable_del(struct file *filp) {}


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define void @global_filetable_del(%struct.file* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void writeInt(FILE *output, int number) { fprintf(output, "%d", number); }


x86 assembly (clang, -O0):
<writeInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeInt>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @writeInt(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 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @writeInt(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int pm8058_mpp_config(unsigned int, int, unsigned int, unsigned int);
int pm8058_mpp_config_digital_out(unsigned mpp, unsigned level,
                                  unsigned control) {
  return pm8058_mpp_config(mpp, 1, level, control);
}


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

x86 assembly (clang, -O2):
<pm8058_mpp_config_digital_out>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <pm8058_mpp_config@plt>

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

LLVM IR (-O2):
define i32 @pm8058_mpp_config_digital_out(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8058_mpp_config(i32 %0, i32 1, i32 %1, i32 %2)
ret i32 %4
}
unsigned int slog(unsigned int block) {
  int i;
  for (i = 12; i <= 16; i++)
    if (block == (1 << i))
      return i;
  return 0;
}


x86 assembly (clang, -O0):
<slog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0xc,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jg     114d <slog+0x4d>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jne    113a <slog+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <slog+0x54>
jmp    113f <slog+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <slog+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slog>:
cmp    $0x3fff,%edi
jle    1126 <slog+0x26>
cmp    $0x4000,%edi
je     1141 <slog+0x41>
cmp    $0x8000,%edi
je     1147 <slog+0x47>
cmp    $0x10000,%edi
jne    114d <slog+0x4d>
mov    $0x10,%eax
ret
mov    $0xc,%eax
cmp    $0x1000,%edi
je     1125 <slog+0x25>
cmp    $0x2000,%edi
jne    114d <slog+0x4d>
mov    $0xd,%eax
ret
mov    $0xe,%eax
ret
mov    $0xf,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @slog(i32 %0) {
switch i32 %0, label %2 [
i32 4096, label %7
i32 8192, label %3
i32 16384, label %4
i32 32768, label %5
i32 65536, label %6
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3, %2
%8 = phi i32 [ 12, %1 ], [ 0, %2 ], [ 13, %3 ], [ 14, %4 ], [ 15, %5 ], [ 16, %6 ]
ret i32 %8
}
/* Variables and functions */
long strtol(char const *, char **, int);
long r_strtol(const char *s, char **endptr, int base) {
  return strtol(s, endptr, base);
}


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

x86 assembly (clang, -O2):
<r_strtol>:
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i64 @r_strtol(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtol(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int find_or_insert(int);
void *process4(void *arg) {
  int val = 8;
  int found = find_or_insert(val);
  assert(!found);
  return NULL;
}


x86 assembly (clang, -O0):
<process4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <find_or_insert@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process4>:
push   %rax
mov    $0x8,%edi
call   1040 <find_or_insert@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @process4(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 8, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @find_or_insert(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @process4(i8* nocapture readnone %0) {
%2 = tail call i32 @find_or_insert(i32 8)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i8* null
}
char i2ss(int c) {
  switch (c) {
  case 0:
    return '-';
  case 1:
    return 'H';
  case 2:
    return 'E';
  case 3:
    return 'C';
  case 4:
    return 'S';
  case 5:
    return 'T';
  case 6:
    return 'G';
  case 7:
    return 'B';
  case 8:
    return 'I';
  }
  return '?';
}


x86 assembly (clang, -O0):
<i2ss>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x8,%rax
ja     117d <i2ss+0x7d>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x2d,-0x1(%rbp)
jmp    1181 <i2ss+0x81>
movb   $0x48,-0x1(%rbp)
jmp    1181 <i2ss+0x81>
movb   $0x45,-0x1(%rbp)
jmp    1181 <i2ss+0x81>
movb   $0x43,-0x1(%rbp)
jmp    1181 <i2ss+0x81>
movb   $0x53,-0x1(%rbp)
jmp    1181 <i2ss+0x81>
movb   $0x54,-0x1(%rbp)
jmp    1181 <i2ss+0x81>
movb   $0x47,-0x1(%rbp)
jmp    1181 <i2ss+0x81>
movb   $0x42,-0x1(%rbp)
jmp    1181 <i2ss+0x81>
movb   $0x49,-0x1(%rbp)
jmp    1181 <i2ss+0x81>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2ss>:
mov    $0x3f,%al
cmp    $0x8,%edi
ja     1114 <i2ss+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
define signext i8 @i2ss(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %14 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
]
5: ; preds = %1
store i8 45, i8* %2
br label %15
6: ; preds = %1
store i8 72, i8* %2
br label %15
7: ; preds = %1
store i8 69, i8* %2
br label %15
8: ; preds = %1
store i8 67, i8* %2
br label %15
9: ; preds = %1
store i8 83, i8* %2
br label %15
10: ; preds = %1
store i8 84, i8* %2
br label %15
11: ; preds = %1
store i8 71, i8* %2
br label %15
12: ; preds = %1
store i8 66, i8* %2
br label %15
13: ; preds = %1
store i8 73, i8* %2
br label %15
14: ; preds = %1
store i8 63, i8* %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
@switch.table.i2ss = [9 x i8] c"-HECSTGBI"
define signext i8 @i2ss(i32 %0) {
%2 = icmp ult i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [9 x i8], [9 x i8]* @switch.table.i2ss, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 63, %1 ]
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ insert(char const *, char *);
int /*<<< orphan*/ param_init_par();
void param_set(const char *parameter_name, char *new_value) {
  param_init_par();
  insert(parameter_name, new_value);
}


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

x86 assembly (clang, -O2):
<param_set>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <param_init_par@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <insert@plt>

LLVM IR (-O0):
define void @param_set(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @param_init_par()
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @insert(i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
define void @param_set(i8* %0, i8* %1) {
%3 = tail call i32 (...) @param_init_par()
%4 = tail call i32 @insert(i8* %0, i8* %1)
ret void
}
int pathcon_nm8_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 0;
  return 0;
}


x86 assembly (clang, -O0):
<pathcon_nm8_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <pathcon_nm8_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <pathcon_nm8_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <pathcon_nm8_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <pathcon_nm8_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm8_work>:
test   %rdi,%rdi
je     110b <pathcon_nm8_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <pathcon_nm8_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <pathcon_nm8_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <pathcon_nm8_work+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @pathcon_nm8_work(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 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 2, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 0, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @pathcon_nm8_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_svariancetk(int, int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_svariancetk(N, 1, x, stride);
  printf("sample variance: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%ecx
mov    $0x1,%esi
call   1030 <stdlib_strided_svariancetk@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1030 <stdlib_strided_svariancetk@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [21 x i8] c"sample variance: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_svariancetk(i32 %6, i32 1, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [21 x i8] c"sample variance: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_svariancetk(i32 4, i32 1, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xvisibility;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xvisibility_type(void *_p) {
  return (int)((XEvent *)_p)->xvisibility.type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xvisibility_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xvisibility_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("\nAvailable commands:\n\n");
  printf("attach <hydro file>    -  adds the program to memory\n");
  printf("run    -  runs the program in memory\n");
  printf("quit    -  quits the program\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf34(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0AAvailable commands:\0A\0A\00"
@.str.1 = [54 x i8] c"attach <hydro file> - adds the program to memory\0A\00"
@.str.2 = [38 x i8] c"run - runs the program in memory\0A\00"
@.str.3 = [30 x i8] c"quit - quits the program\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"\0AAvailable commands:\0A\00"
@str.4 = [53 x i8] c"attach <hydro file> - adds the program to memory\00"
@str.5 = [37 x i8] c"run - runs the program in memory\00"
@str.6 = [29 x i8] c"quit - quits the program\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
ret void
}
double istat_max(double max, double x) { return x > max ? x : max; }


x86 assembly (clang, -O0):
<istat_max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112d <istat_max+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <istat_max+0x37>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<istat_max>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @istat_max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %4
br label %12
10: ; preds = %2
%11 = load double, double* %3
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @istat_max(double %0, double %1) {
%3 = fcmp ogt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
__attribute__((visibility("default"))) const float xfmaxf(float x, float y) {
  return y != y ? x : (x > y ? x : y);
}


x86 assembly (clang, -O0):
<xfmaxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1128 <xfmaxf+0x28>
jp     1128 <xfmaxf+0x28>
jmp    1137 <xfmaxf+0x37>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1169 <xfmaxf+0x69>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1155 <xfmaxf+0x55>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    115f <xfmaxf+0x5f>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfmaxf>:
movaps %xmm1,%xmm2
cmpunordss %xmm1,%xmm2
movaps %xmm2,%xmm3
andps  %xmm0,%xmm3
maxss  %xmm1,%xmm0
andnps %xmm0,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @xfmaxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %4
%7 = fcmp une float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %20
10: ; preds = %2
%11 = load float, float* %3
%12 = load float, float* %4
%13 = fcmp ogt float %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load float, float* %3
br label %18
16: ; preds = %10
%17 = load float, float* %4
br label %18
18: ; preds = %16, %14
%19 = phi float [ %15, %14 ], [ %17, %16 ]
br label %20
20: ; preds = %18, %8
%21 = phi float [ %9, %8 ], [ %19, %18 ]
ret float %21
}

LLVM IR (-O2):
define float @xfmaxf(float %0, float %1) {
%3 = fcmp uno float %1, 0.000000e+00
%4 = fcmp ogt float %0, %1
%5 = or i1 %3, %4
%6 = select i1 %5, float %0, float %1
ret float %6
}
BinaryPositionShort(pkt) unsigned char *pkt;
{
  int c;
  double pos[3], vel[3];
  DecodeBinaryPacket(pkt, "cVV", &c, pos, vel);
  PositionShort(c, pos, vel);
}


x86 assembly (clang, -O0):
<BinaryPositionShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rcx
lea    -0x50(%rbp),%r8
lea    0xec1(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <DecodeBinaryPacket@plt>
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdx
mov    $0x0,%al
call   1030 <PositionShort@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BinaryPositionShort>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xed2(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x30(%rsp),%rbx
lea    0x10(%rsp),%r14
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1040 <DecodeBinaryPacket@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <PositionShort@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cVV\00"
define i32 @BinaryPositionShort(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [3 x double]
%6 = alloca [3 x double]
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%9 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%10 = call i32 (i8*, i8*, i32*, double*, double*, ...) bitcast (i32 (...)* @DecodeBinaryPacket to i32 (i8*, i8*, i32*, double*, double*, ...)*)(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %4, double* %8, double* %9)
%11 = load i32, i32* %4
%12 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%13 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%14 = call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @PositionShort to i32 (i32, double*, double*, ...)*)(i32 %11, double* %12, double* %13)
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"cVV\00"
define i32 @BinaryPositionShort(i8* %0) {
%2 = alloca i32
%3 = alloca [3 x double]
%4 = alloca [3 x double]
%5 = bitcast i32* %2 to i8*
%6 = bitcast [3 x double]* %3 to i8*
%7 = bitcast [3 x double]* %4 to i8*
%8 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%9 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%10 = call i32 (i8*, i8*, i32*, double*, double*, ...) bitcast (i32 (...)* @DecodeBinaryPacket to i32 (i8*, i8*, i32*, double*, double*, ...)*)(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2, double* %8, double* %9)
%11 = load i32, i32* %2
%12 = call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @PositionShort to i32 (i32, double*, double*, ...)*)(i32 %11, double* %8, double* %9)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int ivory_serialize_unpack_prim_4_le(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(float *, int *, int);
void ivory_serialize_unpack_float_le(const uint8_t *src, uint32_t offs,
                                     float *dst) {
  uint32_t tmp = ivory_serialize_unpack_prim_4_le(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_float_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_4_le@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_float_le>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_4_le@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_float_le(i32* %0, i32 %1, float* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca float*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store float* %2, float** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_4_le(i32* %11)
store i32 %12, i32* %7
%13 = load float*, float** %6
%14 = call i32 @memcpy(float* %13, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_float_le(i32* %0, i32 %1, float* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_4_le(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(float* %2, i32* %4, i32 4)
ret void
}
unsigned addval_110(unsigned x) { return x + 3374369409U; }


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

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

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

LLVM IR (-O2):
define i32 @addval_110(i32 %0) {
%2 = add i32 %0, -920597887
ret i32 %2
}
int btree_test_lt(void *k, void *k2) { return k < k2; }


x86 assembly (clang, -O0):
<btree_test_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btree_test_lt>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @btree_test_lt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ult i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @btree_test_lt(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void Sys_WaitForErrorConfirmation(const char *error) {}


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

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

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

LLVM IR (-O2):
define void @Sys_WaitForErrorConfirmation(i8* nocapture %0) {
ret void
}
/* Variables and functions */
long computeLempelZivFact(long *, long);
long *computeLpf(long *, long *, long);
long numLzFact(long *sa, long *lcp, long n) {
  long *lpf;
  lpf = computeLpf(sa, lcp, n);
  return computeLempelZivFact(lpf, n);
}


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

x86 assembly (clang, -O2):
<numLzFact>:
push   %rbx
mov    %rdx,%rbx
call   1040 <computeLpf@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <computeLempelZivFact@plt>

LLVM IR (-O0):
define i64 @numLzFact(i64* %0, i64* %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
%8 = load i64*, i64** %4
%9 = load i64*, i64** %5
%10 = load i64, i64* %6
%11 = call i64* @computeLpf(i64* %8, i64* %9, i64 %10)
store i64* %11, i64** %7
%12 = load i64*, i64** %7
%13 = load i64, i64* %6
%14 = call i64 @computeLempelZivFact(i64* %12, i64 %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @numLzFact(i64* %0, i64* %1, i64 %2) {
%4 = tail call i64* @computeLpf(i64* %0, i64* %1, i64 %2)
%5 = tail call i64 @computeLempelZivFact(i64* %4, i64 %2)
ret i64 %5
}
float __ocl_native_divide_float(float src1, float src2) { return src1 / src2; }


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

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

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

LLVM IR (-O2):
define float @__ocl_native_divide_float(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
void chaz_ConfWriterPerl_add_global_typedef(const char *type,
                                            const char *alias) {
  (void)type;
  (void)alias;
}


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

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

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

LLVM IR (-O2):
define void @chaz_ConfWriterPerl_add_global_typedef(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glVertex4s(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void Vertex4s(GLshort x, GLshort y, GLshort z, GLshort a) {
  glVertex4s(x, y, z, a);
}


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

x86 assembly (clang, -O2):
<Vertex4s>:
jmp    1030 <glVertex4s@plt>

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

LLVM IR (-O2):
define void @Vertex4s(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glVertex4s(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fannkuch(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int n = (argc > 1) ? atoi(argv[1]) : 10;
  printf("Pfannkuchen(%d) = %ld\n", n, fannkuch(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1165 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1172 <main+0x42>
mov    $0xa,%eax
mov    %eax,-0x18(%rbp)
jmp    1172 <main+0x42>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fannkuch@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%ebx
cmp    $0x2,%edi
jl     1146 <main+0x16>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %ebx,%edi
call   1040 <fannkuch@plt>
lea    0xeac(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Pfannkuchen(%d) = %ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%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 ], [ 10, %14 ]
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = load i32, i32* %6
%19 = call i32 @fannkuch(i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Pfannkuchen(%d) = %ld\0A\00"
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 ], [ 10, %2 ]
%10 = tail call i32 @fannkuch(i32 %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
char *f3(char *);
char *f2(char *u) { return f3(u); }


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <f3@plt>

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

LLVM IR (-O2):
define i8* @f2(i8* %0) {
%2 = tail call i8* @f3(i8* %0)
ret i8* %2
}
unsigned char set_bits(unsigned char b) { return (b | 0b10001001); }


x86 assembly (clang, -O0):
<set_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
or     $0x89,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bits>:
mov    %edi,%eax
or     $0x89,%al
ret

LLVM IR (-O0):
define zeroext i8 @set_bits(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = or i32 %4, 137
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @set_bits(i8 zeroext %0) {
%2 = or i8 %0, -119
ret i8 %2
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ printf(char *, int);
int main() {
  while (1) {
    int key = getch();
    printf("Key: %d \n", key);
    key = getch();
    printf("Key: %d \n", key);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getch@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [10 x i8] c"Key: %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @getch()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getch()
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %3
}

LLVM IR (-O2):
@.str = [10 x i8] c"Key: %d \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @getch()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @getch()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %1
}