xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
void display_std(char nb) {
  if (nb >= '1' && nb <= '9')
    my_putchar(nb);
  else
    my_putchar(nb + 48);
}


x86 assembly (clang, -O0):
<display_std>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x31,%eax
jl     1146 <display_std+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1146 <display_std+0x36>
movsbl -0x1(%rbp),%edi
call   1030 <my_putchar@plt>
jmp    1155 <display_std+0x45>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <my_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_std>:
lea    -0x31(%rdi),%eax
lea    0x30(%rdi),%ecx
cmp    $0x9,%al
movzbl %cl,%eax
cmovb  %edi,%eax
movsbl %al,%edi
jmp    1030 <my_putchar@plt>

LLVM IR (-O0):
define void @display_std(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 49
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i8, i8* %2
%12 = call i32 @my_putchar(i8 signext %11)
br label %19
13: ; preds = %6, %1
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = add nsw i32 %15, 48
%17 = trunc i32 %16 to i8
%18 = call i32 @my_putchar(i8 signext %17)
br label %19
19: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
define void @display_std(i8 signext %0) {
%2 = add i8 %0, -49
%3 = icmp ult i8 %2, 9
%4 = add i8 %0, 48
%5 = select i1 %3, i8 %0, i8 %4
%6 = tail call i32 @my_putchar(i8 signext %5)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t size) {
  if (nmemb == 0 || size == 0)
    return NULL;
  void *ptr = malloc(nmemb * size);
  memset(ptr, 0, nmemb * size);
  return ptr;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <calloc+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1153 <calloc+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1181 <calloc+0x61>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
imul   -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
test   %rdi,%rdi
je     1150 <calloc+0x30>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1150 <calloc+0x30>
imul   %rdi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = mul i64 %1, %0
%8 = tail call i8* @malloc(i64 %7)
%9 = tail call i32 @memset(i8* %8, i32 0, i64 %7)
br label %10
10: ; preds = %2, %6
%11 = phi i8* [ %8, %6 ], [ null, %2 ]
ret i8* %11
}
int foo(void) { return *(int *)""; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @foo() {
%1 = load i32, i32* bitcast ([1 x i8]* @.str to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
int test_imm_9Cuint32_reg(unsigned int val) {
  return ((val) & (0x9C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Cuint32_reg(i32 %0) {
%2 = and i32 %0, 156
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo099() {}


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

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

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

LLVM IR (-O2):
define void @foo099() {
ret void
}
float Sleef_atanf_u35(float x) { return __builtin_atanf(x); }


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

x86 assembly (clang, -O2):
<Sleef_atanf_u35>:
jmp    1030 <atanf@plt>

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

LLVM IR (-O2):
define float @Sleef_atanf_u35(float %0) {
%2 = tail call float @atanf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void faddp() {
  db(0xDE);
  db(0xC1);
}


x86 assembly (clang, -O0):
<faddp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xde,%edi
call   1030 <db@plt>
mov    $0xc1,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<faddp>:
push   %rax
mov    $0xde,%edi
call   1030 <db@plt>
mov    $0xc1,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @faddp() {
%1 = call i32 @db(i32 222)
%2 = call i32 @db(i32 193)
ret void
}

LLVM IR (-O2):
define void @faddp() {
%1 = tail call i32 @db(i32 222)
%2 = tail call i32 @db(i32 193)
ret void
}
/* Variables and functions */
int my_func();
int main() { return my_func(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @my_func()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int ya_pthread_mutex_unlock(pthread_mutex_t *mutex) {
  int ret;
  ret = pthread_mutex_unlock(mutex);
  return ret;
}


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

x86 assembly (clang, -O2):
<ya_pthread_mutex_unlock>:
jmp    1030 <pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define i32 @ya_pthread_mutex_unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printUsage() {
  puts("Synopsis:\n"
       "  Print fasta stats\n"
       "Usage:\n"
       "  biotool [options] contigs.fasta [another.fa ...]\n"
       "Options:\n"
       "  --help       Show this help\n"
       "  --version    Print version and exit\n"
       "  --verbose    Print more stuff about what's happening\n"
       "  --minlen N   Minimum length sequence to include in stats "
       "(default=0)");
}


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

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

LLVM IR (-O0):
@.str = [291 x i8] c"Synopsis:\0A Print fasta stats\0AUsage:\0A biotool [options] contigs.fasta [another.fa ...]\0AOptions:\0A --help Show this help\0A --version Print version and exit\0A --verbose Print more stuff about what's happening\0A --minlen N Minimum length sequence to include in stats (default=0)\00"
define void @printUsage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([291 x i8], [291 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [291 x i8] c"Synopsis:\0A Print fasta stats\0AUsage:\0A biotool [options] contigs.fasta [another.fa ...]\0AOptions:\0A --help Show this help\0A --version Print version and exit\0A --verbose Print more stuff about what's happening\0A --minlen N Minimum length sequence to include in stats (default=0)\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([291 x i8], [291 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char *);
int calculateLcd(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int dividend = atoi(argv[1]);
  int divisor = atoi(argv[2]);
  int result = calculateLcd(dividend, divisor);
  printf("%i", result);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <calculateLcd@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <calculateLcd@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %6
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = call i32 @calculateLcd(i32 %17, i32 %18)
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @calculateLcd(i32 %5, i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
void RTOnceReset(void) {}


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

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

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

LLVM IR (-O2):
define void @RTOnceReset() {
ret void
}
void vfs_setmntopt(struct vfs *vfs, const char *s1, const char *s2, int s3) {}


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

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

LLVM IR (-O0):
%struct.vfs = type opaque
define void @vfs_setmntopt(%struct.vfs* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.vfs*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.vfs* %0, %struct.vfs** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.vfs = type opaque
define void @vfs_setmntopt(%struct.vfs* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
void *_memory_allocate(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *rpcalloc(size_t num, size_t size) {
  size_t total;
  total = num * size;
  void *ptr = _memory_allocate(total);
  memset(ptr, 0, total);
  return ptr;
}


x86 assembly (clang, -O0):
<rpcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <_memory_allocate@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <_memory_allocate@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @rpcalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @_memory_allocate(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
char *ta_getvowel(char *t) {
  if (t[0] == 'c') {
    return (++t);
  } else {
    return (t);
  }
}


x86 assembly (clang, -O0):
<ta_getvowel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    112d <ta_getvowel+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1135 <ta_getvowel+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ta_getvowel>:
xor    %eax,%eax
cmpb   $0x63,(%rdi)
sete   %al
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @ta_getvowel(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 99
%4 = zext i1 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, ...);
void log_alloc(const char *subsystem) {
  if (subsystem)
    report(LOG_ERR, "Unable to allocate memory for %s", subsystem);
  else
    report(LOG_ERR, "Unable to allocate memory");
}


x86 assembly (clang, -O0):
<log_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <log_alloc+0x37>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1030 <report@plt>
jmp    115e <log_alloc+0x4e>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_alloc>:
mov    %rdi,%rdx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
test   %rdx,%rdx
je     112f <log_alloc+0x1f>
lea    0xed8(%rip),%rsi
xor    %eax,%eax
jmp    1030 <report@plt>
lea    0xeeb(%rip),%rsi
xor    %eax,%eax
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [33 x i8] c"Unable to allocate memory for %s\00"
@.str.1 = [26 x i8] c"Unable to allocate memory\00"
define void @log_alloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @LOG_ERR
%7 = load i8*, i8** %2
%8 = call i32 (i32, i8*, ...) @report(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* @LOG_ERR
%11 = call i32 (i32, i8*, ...) @report(i32 %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %9, %5
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [33 x i8] c"Unable to allocate memory for %s\00"
@.str.1 = [26 x i8] c"Unable to allocate memory\00"
define void @log_alloc(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = load i32, i32* @LOG_ERR
br i1 %2, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i32, i8*, ...) @report(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 (i32, i8*, ...) @report(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_longdouble_sum_to_all(long double *target,
                                        long double *source, int nreduce,
                                        int PE_start, int logPE_stride,
                                        int PE_size, long double *pWrk,
                                        long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_longdouble_sum_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_longdouble_sum_to_all(x86_fp80* nocapture readnone %0, x86_fp80* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, x86_fp80* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *dynreadline();
int /*<<< orphan*/ printf(char *, char const *);
char *dynreadline_prompt(const char *prompt) {
  printf("%s ", prompt);
  return dynreadline();
}


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

x86 assembly (clang, -O2):
<dynreadline_prompt>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <dynreadline@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i8* @dynreadline_prompt(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i8* (...) @dynreadline()
ret i8* %3
}
void __DELETE_nbody_Body(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_nbody_Body(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int test_imm_28uint16_reg(unsigned short val) {
  return ((val) & (0x28 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_28uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x28,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_28uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 40
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void handle_error(const char *file, int lineno, const char *msg) {
  fprintf(stderr, "** %s:%i %s\n", file, lineno, msg);
  ERR_print_errors_fp(stderr);
  exit(-1);
}


x86 assembly (clang, -O0):
<handle_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <ERR_print_errors_fp@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_error>:
push   %rbx
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <ERR_print_errors_fp@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"** %s:%i %s\0A\00"
define void @handle_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = load i32, i32* @stderr
%13 = call i32 @ERR_print_errors_fp(i32 %12)
%14 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"** %s:%i %s\0A\00"
define void @handle_error(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%6 = load i32, i32* @stderr
%7 = tail call i32 @ERR_print_errors_fp(i32 %6)
%8 = tail call i32 @exit(i32 -1)
unreachable
}
void testClosureFSrV(void (*closure)(float, short), float a1, short a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureFSrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
movswl -0xe(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFSrV>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureFSrV(void (float, i16)* %0, float %1, i16 signext %2) {
%4 = alloca void (float, i16)*
%5 = alloca float
%6 = alloca i16
store void (float, i16)* %0, void (float, i16)** %4
store float %1, float* %5
store i16 %2, i16* %6
%7 = load void (float, i16)*, void (float, i16)** %4
%8 = load float, float* %5
%9 = load i16, i16* %6
ret void
}

LLVM IR (-O2):
define void @testClosureFSrV(void (float, i16)* nocapture %0, float %1, i16 signext %2) {
tail call void %0(float %1, i16 signext %2)
ret void
}
void polymo_(onoff) int *onoff;
{ polymode((long)*onoff); }


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

x86 assembly (clang, -O2):
<polymo_>:
movslq (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <polymode@plt>

LLVM IR (-O0):
define void @polymo_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = call i32 (i64, ...) bitcast (i32 (...)* @polymode to i32 (i64, ...)*)(i64 %5)
ret void
}

LLVM IR (-O2):
define void @polymo_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @polymode to i32 (i64, ...)*)(i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_HIF_SetIntServ(unsigned char byVal) {
  VIM_HIF_SetReg8((0x1400 + 0x012), byVal);
}


x86 assembly (clang, -O0):
<VIM_HIF_SetIntServ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1412,%edi
movzbl -0x1(%rbp),%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_HIF_SetIntServ>:
mov    %edi,%esi
mov    $0x1412,%edi
jmp    1030 <VIM_HIF_SetReg8@plt>

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

LLVM IR (-O2):
define void @VIM_HIF_SetIntServ(i8 zeroext %0) {
%2 = tail call i32 @VIM_HIF_SetReg8(i32 5138, i8 zeroext %0)
ret void
}
/* Variables and functions */
void *ucalloc(size_t, int);
void *uzalloc(size_t size) { return ucalloc(size, 1); }


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

x86 assembly (clang, -O2):
<uzalloc>:
mov    $0x1,%esi
jmp    1030 <ucalloc@plt>

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

LLVM IR (-O2):
define i8* @uzalloc(i64 %0) {
%2 = tail call i8* @ucalloc(i64 %0, i32 1)
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long time;
};
typedef TYPE_1__ XCrossingEvent;

/* Variables and functions */
void set_XCrossingEvent_time(void *_p, unsigned long _v) {
  ((XCrossingEvent *)_p)->time = (unsigned long)_v;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void closeStore(FILE *store) { fclose(store); }


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

x86 assembly (clang, -O2):
<closeStore>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @closeStore(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tcUsage() {
  printf("Usage: test [TESTNUM..]");
  printf("\n  no args runs all regression test.");
  printf("\n  one or more number args runs just those tests");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<tcUsage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
call   1040 <printf@plt>
lea    0xefd(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: test [TESTNUM..]\00"
@.str.1 = [37 x i8] c"\0A no args runs all regression test.\00"
@.str.2 = [49 x i8] c"\0A one or more number args runs just those tests\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @tcUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Usage: test [TESTNUM..]\00"
@.str.1 = [37 x i8] c"\0A no args runs all regression test.\00"
@.str.2 = [49 x i8] c"\0A one or more number args runs just those tests\00"
define void @tcUsage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int aski;
  printf("The aski value of a is 97\n ");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"The aski value of a is 97\0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"The aski value of a is 97\0A \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct utsname {
  int dummy;
};

/* Variables and functions */
int uname(struct utsname *);
int main(void) {
  struct utsname buf;
  return uname(&buf);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <uname@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.utsname = type { i32 }
define i32 @main() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i32 @uname(%struct.utsname* %1)
ret i32 %3
}
void calc_heat(double a, double k, double t1, double t2, double x, double *h) {
  *h = (k * a * (t2 - t1)) / x;
}


x86 assembly (clang, -O0):
<calc_heat>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
mov    %rdi,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_heat>:
mulsd  %xmm1,%xmm0
subsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
divsd  %xmm4,%xmm3
movsd  %xmm3,(%rdi)
ret

LLVM IR (-O0):
define void @calc_heat(double %0, double %1, double %2, double %3, double %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double* %5, double** %12
%13 = load double, double* %8
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = load double, double* %10
%17 = load double, double* %9
%18 = fsub double %16, %17
%19 = fmul double %15, %18
%20 = load double, double* %11
%21 = fdiv double %19, %20
%22 = load double*, double** %12
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @calc_heat(double %0, double %1, double %2, double %3, double %4, double* nocapture writeonly %5) {
%7 = fmul double %0, %1
%8 = fsub double %3, %2
%9 = fmul double %7, %8
%10 = fdiv double %9, %4
store double %10, double* %5
ret void
}
void delay(int time) {
  int i, j, k;
  for (i = 0; i < time; i++) {
    for (j = 0; j < 100; j++) {
      for (k = 0; k < 10000; k++) {
      }
    }
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1178 <delay+0x78>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1165 <delay+0x65>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2710,-0x10(%rbp)
jge    1152 <delay+0x52>
jmp    1144 <delay+0x44>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <delay+0x32>
jmp    1157 <delay+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <delay+0x21>
jmp    116a <delay+0x6a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %6
6: ; preds = %27, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %30
10: ; preds = %6
store i32 0, i32* %4
br label %11
11: ; preds = %23, %10
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 100
br i1 %13, label %14, label %26
14: ; preds = %11
store i32 0, i32* %5
br label %15
15: ; preds = %19, %14
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 10000
br i1 %17, label %18, label %22
18: ; preds = %15
br label %19
19: ; preds = %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %15
22: ; preds = %15
br label %23
23: ; preds = %22
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %11
26: ; preds = %11
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %6
30: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
char *malloc(int);
int strlen(char *);
char *strncpy(char *, char *, int);
char *StripDotSuffix(char *string) {
  int buflen = strlen(string) - 1;
  char *buf = malloc(sizeof(char) * buflen);
  buf[buflen - 1] = '\0';
  return strncpy(buf, string, buflen - 1);
}


x86 assembly (clang, -O0):
<StripDotSuffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StripDotSuffix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edi
call   1050 <malloc@plt>
movslq %ebx,%rdx
movb   $0x0,-0x2(%rax,%rdx,1)
add    $0xfffffffffffffffe,%rdx
mov    %rax,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define i8* @StripDotSuffix(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %4
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 1
%22 = call i8* @strncpy(i8* %18, i8* %19, i32 %21)
ret i8* %22
}

LLVM IR (-O2):
define i8* @StripDotSuffix(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = tail call i8* @malloc(i32 %3)
%5 = add nsw i32 %2, -2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
%8 = tail call i8* @strncpy(i8* %4, i8* %0, i32 %5)
ret i8* %8
}
void gtk_cell_view_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_view_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RecursiveReturn();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void EndBOLD() {
  fputs("}", stdout);
  RecursiveReturn();
}


x86 assembly (clang, -O0):
<EndBOLD>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x0,%al
call   1040 <RecursiveReturn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EndBOLD>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <RecursiveReturn@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"}\00"
@stdout = global i32 0
define void @EndBOLD() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @RecursiveReturn()
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"}\00"
@stdout = global i32 0
define void @EndBOLD() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @RecursiveReturn()
ret void
}
int occurrenceFirst(char a[], char b[]) {
  int i;
  for (i = 0; a[i] != '\0'; i++) {
    if (a[i] == b[0])
      return i;
  }
}


x86 assembly (clang, -O0):
<occurrenceFirst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1161 <occurrenceFirst+0x61>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    114e <occurrenceFirst+0x4e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <occurrenceFirst+0x61>
jmp    1153 <occurrenceFirst+0x53>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <occurrenceFirst+0x13>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<occurrenceFirst>:
mov    (%rdi),%dl
test   %dl,%dl
je     1122 <occurrenceFirst+0x22>
mov    (%rsi),%cl
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmp    %cl,%dl
je     1121 <occurrenceFirst+0x21>
movzbl 0x1(%rdi,%rax,1),%edx
add    $0x1,%rax
test   %dl,%dl
jne    1110 <occurrenceFirst+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @occurrenceFirst(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %30, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %33
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %21, %25
br i1 %26, label %27, label %29
27: ; preds = %15
%28 = load i32, i32* %6
store i32 %28, i32* %3
br label %33
29: ; preds = %15
br label %30
30: ; preds = %29
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %7
33: ; preds = %27, %7
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @occurrenceFirst(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %20, label %5
5: ; preds = %2
%6 = load i8, i8* %1
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = phi i8 [ %3, %5 ], [ %16, %12 ]
%10 = phi i32 [ 0, %5 ], [ %14, %12 ]
%11 = icmp eq i8 %9, %6
br i1 %11, label %18, label %12
12: ; preds = %7
%13 = add nuw i64 %8, 1
%14 = add nuw nsw i32 %10, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %13
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %20, label %7
18: ; preds = %7
%19 = trunc i64 %8 to i32
br label %20
20: ; preds = %12, %18, %2
%21 = phi i32 [ 0, %2 ], [ %19, %18 ], [ %14, %12 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void assert(int predicate, char *message) {
  if (!predicate) {
    printf("Assertion Failed: %s", message);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1153 <assert+0x33>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1125 <assert+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Assertion Failed: %s\00"
define void @assert(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Assertion Failed: %s\00"
define void @assert(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
scalar_t__ M_PI;
int cosf(float);
float sine_io(float step, float max_steps, float max_val) {
  return -max_val / 2 * (cosf((float)M_PI * step / max_steps) - 1);
}


x86 assembly (clang, -O0):
<sine_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xebf(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    0x2e97(%rip),%rax
cvtsi2ssq (%rax),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1030 <cosf@plt>
movss  -0x10(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_io>:
push   %rax
mov    0x2ed0(%rip),%rax
cvtsi2ssq (%rax),%xmm3
mulss  0xedb(%rip),%xmm2
movss  %xmm2,0x4(%rsp)
mulss  %xmm3,%xmm0
divss  %xmm1,%xmm0
call   1030 <cosf@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i64 0
define float @sine_io(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = fneg float %7
%9 = fdiv float %8, 2.000000e+00
%10 = load i64, i64* @M_PI
%11 = sitofp i64 %10 to float
%12 = load float, float* %4
%13 = fmul float %11, %12
%14 = load float, float* %5
%15 = fdiv float %13, %14
%16 = call i32 @cosf(float %15)
%17 = sub nsw i32 %16, 1
%18 = sitofp i32 %17 to float
%19 = fmul float %9, %18
ret float %19
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @sine_io(float %0, float %1, float %2) {
%4 = fmul float %2, -5.000000e-01
%5 = load i64, i64* @M_PI
%6 = sitofp i64 %5 to float
%7 = fmul float %6, %0
%8 = fdiv float %7, %1
%9 = tail call i32 @cosf(float %8)
%10 = add nsw i32 %9, -1
%11 = sitofp i32 %10 to float
%12 = fmul float %4, %11
ret float %12
}