xunge/DecIR huggingface dataset:
void XSetPointerMapping() {}


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

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

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

LLVM IR (-O2):
define void @XSetPointerMapping() {
ret void
}
int f(a, b, c)
int a;
int c;
{ return a; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(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
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 returned %0, i32 %1, i32 %2) {
ret i32 %0
}
void updateCachedTime(void) {}


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

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

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

LLVM IR (-O2):
define void @updateCachedTime() {
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t sjs__hrtime(void) {
  struct timespec t;
  if (clock_gettime(CLOCK_MONOTONIC, &t)) {
    return 0;
  }
  return t.tv_sec * (uint64_t)1e9 + t.tv_nsec;
}


x86 assembly (clang, -O0):
<sjs__hrtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
je     1140 <sjs__hrtime+0x30>
movl   $0x0,-0x4(%rbp)
jmp    114d <sjs__hrtime+0x3d>
imul   $0x3b9aca00,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sjs__hrtime>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,(%rsp),%edx
add    0x4(%rsp),%edx
xor    %ecx,%ecx
test   %rax,%rax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @sjs__hrtime() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %14
7: ; preds = %0
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000000000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%12 = load i32, i32* %11
%13 = add nsw i32 %10, %12
store i32 %13, i32* %1
br label %14
14: ; preds = %7, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @sjs__hrtime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = select i1 %5, i32 %11, i32 0
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int values(int);
int main(int argc, char **argv) {
  printf(" other things %d\n", values(6));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
call   1030 <values@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c" other things %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @values(i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_quaddobl_drop_coordinate_by_index(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(398, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_quaddobl_drop_coordinate_by_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x18e,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_quaddobl_drop_coordinate_by_index>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x18e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_quaddobl_drop_coordinate_by_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 398, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_quaddobl_drop_coordinate_by_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 398, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
int NULL_DELAYMS(const int ms) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @NULL_DELAYMS(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ bar(int *);
void foo11(int *i) { bar(i); }


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

x86 assembly (clang, -O2):
<foo11>:
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define void @foo11(i32* %0) {
%2 = tail call i32 @bar(i32* %0)
ret void
}
void I420ToI444() {}


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

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

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

LLVM IR (-O2):
define void @I420ToI444() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ update();
conced() {
  printf("I concede\n");
  update();
}


x86 assembly (clang, -O0):
<conced>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <update@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conced>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <update@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"I concede\0A\00"
define i32 @conced() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @update()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@str = [10 x i8] c"I concede\00"
define i32 @conced() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @update()
ret i32 undef
}
/* Variables and functions */
int EXIT_SUCCESS;
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int nthreads, tid;
#pragma omp parallel private(nthreads, tid)
  {
    tid = omp_get_thread_num();
    printf("Hello World from thread = %d\n", tid);
    if (tid == 0) {
      nthreads = omp_get_num_threads();
      printf("Number of threads = %d\n", nthreads);
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    117b <main+0x4b>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
test   %ebx,%ebx
jne    1161 <main+0x31>
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Hello World from thread = %d\0A\00"
@.str.1 = [24 x i8] c"Number of threads = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @omp_get_thread_num()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = call i32 (...) @omp_get_num_threads()
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %0
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@.str = [30 x i8] c"Hello World from thread = %d\0A\00"
@.str.1 = [24 x i8] c"Number of threads = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 (...) @omp_get_num_threads()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %0
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
int DynamicLibrary1Function(char c) { return (int)c; }


x86 assembly (clang, -O0):
<DynamicLibrary1Function>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DynamicLibrary1Function>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @DynamicLibrary1Function(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @DynamicLibrary1Function(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ multu(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ multu1(int /*<<< orphan*/, int /*<<< orphan*/);
uint64_t multu_variants(uint32_t rs, uint32_t rt) {
  uint64_t rd = multu(rs, rt);
  uint64_t rd1 = multu1(rs, rt);
  assert(rd == rd1);
  return rd;
}


x86 assembly (clang, -O0):
<multu_variants>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <multu@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <multu1@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multu_variants>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <multu@plt>
mov    %rax,%r14
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <multu1@plt>
xor    %edi,%edi
cmp    %rax,%r14
sete   %dil
call   1050 <assert@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @multu_variants(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i64 @multu(i32 %7, i32 %8)
store i64 %9, i64* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i64 @multu1(i32 %10, i32 %11)
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp eq i64 %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i64, i64* %5
ret i64 %18
}

LLVM IR (-O2):
define i64 @multu_variants(i32 %0, i32 %1) {
%3 = tail call i64 @multu(i32 %0, i32 %1)
%4 = tail call i64 @multu1(i32 %0, i32 %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ setgid(int /*<<< orphan*/);
void c_setgid_(gid_t *gid) { setgid(*gid); }


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

x86 assembly (clang, -O2):
<c_setgid_>:
mov    (%rdi),%edi
jmp    1030 <setgid@plt>

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

LLVM IR (-O2):
define void @c_setgid_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @setgid(i32 %2)
ret void
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int ungetc(int, int /*<<< orphan*/);
int my_ungetc(int c, struct aFILE *fp) { return ungetc(c, _get_actual_fp(fp)); }


x86 assembly (clang, -O0):
<my_ungetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <ungetc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ungetc>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <_get_actual_fp@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ungetc@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_ungetc(i32 %0, %struct.aFILE* %1) {
%3 = alloca i32
%4 = alloca %struct.aFILE*
store i32 %0, i32* %3
store %struct.aFILE* %1, %struct.aFILE** %4
%5 = load i32, i32* %3
%6 = load %struct.aFILE*, %struct.aFILE** %4
%7 = call i32 @_get_actual_fp(%struct.aFILE* %6)
%8 = call i32 @ungetc(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_ungetc(i32 %0, %struct.aFILE* %1) {
%3 = tail call i32 @_get_actual_fp(%struct.aFILE* %1)
%4 = tail call i32 @ungetc(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
double sin(double);
double sin_(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<sin_>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @sin_(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
void netcdf_CloseSpatial() {}


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

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

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

LLVM IR (-O2):
define void @netcdf_CloseSpatial() {
ret void
}
/* Type definitions */
struct afp_volume {
  int dummy;
};

/* Variables and functions */
int EPERM;
int extra_translate(struct afp_volume *, char const *, char **);
int /*<<< orphan*/ free(char *);
int appledouble_symlink(struct afp_volume *vol, const char *path1,
                        const char *path2) {
  int resource;
  char *newpath;
  resource = extra_translate(vol, path1, &newpath);
  free(newpath);
  if (resource == 0)
    return 0;
  return -EPERM;
}


x86 assembly (clang, -O0):
<appledouble_symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1040 <extra_translate@plt>
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x24(%rbp)
jne    1167 <appledouble_symlink+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1175 <appledouble_symlink+0x55>
xor    %eax,%eax
mov    0x2e68(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appledouble_symlink>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdx
call   1040 <extra_translate@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x2e96(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
test   %ebx,%ebx
cmove  %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.afp_volume = type { i32 }
@EPERM = global i32 0
define i32 @appledouble_symlink(%struct.afp_volume* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.afp_volume*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store %struct.afp_volume* %0, %struct.afp_volume** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%10 = load %struct.afp_volume*, %struct.afp_volume** %5
%11 = load i8*, i8** %6
%12 = call i32 @extra_translate(%struct.afp_volume* %10, i8* %11, i8** %9)
store i32 %12, i32* %8
%13 = load i8*, i8** %9
%14 = call i32 @free(i8* %13)
%15 = load i32, i32* %8
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %3
store i32 0, i32* %4
br label %21
18: ; preds = %3
%19 = load i32, i32* @EPERM
%20 = sub nsw i32 0, %19
store i32 %20, i32* %4
br label %21
21: ; preds = %18, %17
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
%struct.afp_volume = type { i32 }
@EPERM = global i32 0
define i32 @appledouble_symlink(%struct.afp_volume* %0, i8* %1, i8* nocapture readnone %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i32 @extra_translate(%struct.afp_volume* %0, i8* %1, i8** %4)
%7 = load i8*, i8** %4
%8 = call i32 @free(i8* %7)
%9 = icmp eq i32 %6, 0
%10 = load i32, i32* @EPERM
%11 = sub nsw i32 0, %10
%12 = select i1 %9, i32 0, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ putc_serial0(int);
void tx(char c) { putc_serial0((int)c); }


x86 assembly (clang, -O0):
<tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putc_serial0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx>:
jmp    1030 <putc_serial0@plt>

LLVM IR (-O0):
define void @tx(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i32 @putc_serial0(i32 %4)
ret void
}

LLVM IR (-O2):
define void @tx(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 @putc_serial0(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle32() { kprintf("ISR %d.\n", 32); }


x86 assembly (clang, -O0):
<isrHandle32>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x20,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle32>:
lea    0xee9(%rip),%rdi
mov    $0x20,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle32() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 32)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle32() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 32)
ret void
}
char UPPER(CH)
char CH;
{
  if ((CH >= 'a') && (CH <= 'z'))
    return (CH - 'a' + 'A');
  else
    return CH;
}


x86 assembly (clang, -O0):
<UPPER>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <UPPER+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <UPPER+0x36>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    113c <UPPER+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPPER>:
mov    %edi,%eax
shl    $0x18,%eax
add    $0x9fffffff,%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1affffff,%eax
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @UPPER(i32 %0) {
%2 = alloca i8
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 97
%16 = add nsw i32 %15, 65
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %20
18: ; preds = %8, %1
%19 = load i8, i8* %3
store i8 %19, i8* %2
br label %20
20: ; preds = %18, %12
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @UPPER(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1610612737
%4 = icmp ult i32 %3, 452984831
%5 = add i32 %0, 224
%6 = select i1 %4, i32 %5, i32 %0
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ F_SETLKW;
int /*<<< orphan*/ F_WRLCK;
int _fd_get_lock(int, int /*<<< orphan*/, int /*<<< orphan*/);
int fd_get_writew_lock(int fd) { return (_fd_get_lock(fd, F_SETLKW, F_WRLCK)); }


x86 assembly (clang, -O0):
<fd_get_writew_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
call   1030 <_fd_get_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_get_writew_lock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <_fd_get_lock@plt>

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

LLVM IR (-O2):
@F_SETLKW = global i32 0
@F_WRLCK = global i32 0
define i32 @fd_get_writew_lock(i32 %0) {
%2 = load i32, i32* @F_SETLKW
%3 = load i32, i32* @F_WRLCK
%4 = tail call i32 @_fd_get_lock(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int *, int);
void hook_call(int a, int b) {
  int relative = b - (a + 5);
  memcpy((void *)(a + 1), &relative, 4);
}


x86 assembly (clang, -O0):
<hook_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x5,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hook_call>:
push   %rax
sub    %edi,%esi
add    $0xfffffffb,%esi
mov    %esi,0x4(%rsp)
add    $0x1,%edi
movslq %edi,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @hook_call(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 5
%9 = sub nsw i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = call i32 @memcpy(i8* %13, i32* %5, i32 4)
ret void
}

LLVM IR (-O2):
define void @hook_call(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = sub i32 -5, %0
%6 = add i32 %5, %1
store i32 %6, i32* %3
%7 = add nsw i32 %0, 1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = call i32 @memcpy(i8* %9, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int log(int);
int exposure(int iso) {
  int ev100;
  ev100 = 15;
  return ev100 + (log(iso / 100) / log(2));
}


x86 assembly (clang, -O0):
<exposure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <log@plt>
mov    %eax,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exposure>:
push   %rbx
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x25,%rdi
add    %eax,%edi
call   1030 <log@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
add    $0xf,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @exposure(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 15, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 100
%7 = call i32 @log(i32 %6)
%8 = call i32 @log(i32 2)
%9 = sdiv i32 %7, %8
%10 = add nsw i32 %4, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @exposure(i32 %0) {
%2 = sdiv i32 %0, 100
%3 = tail call i32 @log(i32 %2)
%4 = tail call i32 @log(i32 2)
%5 = sdiv i32 %3, %4
%6 = add nsw i32 %5, 15
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printLocalVariable();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int numberone = 1;
  printf("Function main, before invoke print, variable = %d\n", numberone);
  printLocalVariable();
  printf("Function main, before invoke print, variable = %d\n", numberone);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <printLocalVariable@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [51 x i8] c"Function main, before invoke print, variable = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (...) @printLocalVariable()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
void PBISTResume(void) {
  (*((volatile unsigned long *)(0x400FB000 + 0x0000016C))) = 0x2;
}


x86 assembly (clang, -O0):
<PBISTResume>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb16c,%eax
movq   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PBISTResume>:
movq   $0x2,0x400fb16c
ret

LLVM IR (-O0):
define void @PBISTResume() {
store volatile i64 2, i64* inttoptr (i64 1074770284 to i64*)
ret void
}

LLVM IR (-O2):
define void @PBISTResume() {
store volatile i64 2, i64* inttoptr (i64 1074770284 to i64*)
ret void
}
void SetDebuggerThreadName(const char *name) {
  (void)(1 ? (void)0 : ((void)name));
}


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

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

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

LLVM IR (-O2):
define void @SetDebuggerThreadName(i8* nocapture %0) {
ret void
}
void nseel_asm_div(void) { __asm__("fdivr\n"); }


x86 assembly (clang, -O0):
<nseel_asm_div>:
push   %rbp
mov    %rsp,%rbp
fdivrp %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_div>:
fdivrp %st,%st(1)
ret

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

LLVM IR (-O2):
define void @nseel_asm_div() {
tail call void asm sideeffect "fdivr\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MyGrabKeyboard();
int /*<<< orphan*/ StartSaveMouseMotion();
void GrabTheMachine(void) {
  StartSaveMouseMotion();
  MyGrabKeyboard();
}


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

x86 assembly (clang, -O2):
<GrabTheMachine>:
push   %rax
xor    %eax,%eax
call   1030 <StartSaveMouseMotion@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <MyGrabKeyboard@plt>

LLVM IR (-O0):
define void @GrabTheMachine() {
%1 = call i32 (...) @StartSaveMouseMotion()
%2 = call i32 (...) @MyGrabKeyboard()
ret void
}

LLVM IR (-O2):
define void @GrabTheMachine() {
%1 = tail call i32 (...) @StartSaveMouseMotion()
%2 = tail call i32 (...) @MyGrabKeyboard()
ret void
}
/* Variables and functions */
int selectf_algo(int *, int /*<<< orphan*/, int, int);
int selectf(int *array, int size, int rank) {
  return selectf_algo(array, 0, size - 1, rank - 1);
}


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

x86 assembly (clang, -O2):
<selectf>:
lea    -0x1(%rsi),%eax
lea    -0x1(%rdx),%ecx
xor    %esi,%esi
mov    %eax,%edx
jmp    1030 <selectf_algo@plt>

LLVM IR (-O0):
define i32 @selectf(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 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = call i32 @selectf_algo(i32* %7, i32 0, i32 %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @selectf(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = add nsw i32 %2, -1
%6 = tail call i32 @selectf_algo(i32* %0, i32 0, i32 %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ AtmegaCompareP__1__AtmegaCompare__fired();
void HplAtmRfa1TimerMacP__CompareB__fired(void) {
  AtmegaCompareP__1__AtmegaCompare__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtmRfa1TimerMacP__CompareB__fired() {
%1 = tail call i32 (...) @AtmegaCompareP__1__AtmegaCompare__fired()
ret void
}
/* Variables and functions */
char *dngettext(char const *, char const *, char const *, unsigned long);
const char *b_dnpgettext2(const char *domain, const char *ctxMsgId,
                          size_t msgIdOffset, const char *msgIdPlural,
                          unsigned long int n) {
  const char *const translation = dngettext(domain, ctxMsgId, msgIdPlural, n);
  if (translation == ctxMsgId)
    return ctxMsgId + msgIdOffset;
  return translation;
}


x86 assembly (clang, -O0):
<b_dnpgettext2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1030 <dngettext@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1164 <b_dnpgettext2+0x54>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <b_dnpgettext2+0x5c>
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_dnpgettext2>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rcx,%rdx
mov    %r8,%rcx
call   1030 <dngettext@plt>
add    %rbx,%r14
cmp    %rbx,%rax
cmove  %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @b_dnpgettext2(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @dngettext(i8* %0, i8* %1, i8* %3, i64 %4)
%7 = icmp eq i8* %6, %1
%8 = getelementptr inbounds i8, i8* %1, i64 %2
%9 = select i1 %7, i8* %8, i8* %6
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *strerror(int e) {
  static char emsg[40];
  {
    sprintf(emsg, "Unknown system error %d", e);
    return (&emsg[0]);
  }
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@strerror.emsg = internal global [40 x i8] zeroinitializer
@.str = [24 x i8] c"Unknown system error %d\00"
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @strerror.emsg, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @strerror.emsg, i64 0, i64 0)
}

LLVM IR (-O2):
@strerror.emsg = internal global [40 x i8] zeroinitializer
@.str = [24 x i8] c"Unknown system error %d\00"
define i8* @strerror(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @strerror.emsg, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @strerror.emsg, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ print_greetings();
int /*<<< orphan*/ print_second_greetings();
int /*<<< orphan*/ sleep(int);
int main() {
  while (1) {
    print_greetings();
    sleep(1);
    print_second_greetings();
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <print_greetings@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1030 <print_second_greetings@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <print_greetings@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <print_second_greetings@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @print_greetings()
%4 = call i32 @sleep(i32 1)
%5 = call i32 (...) @print_second_greetings()
%6 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @print_greetings()
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 (...) @print_second_greetings()
%5 = tail call i32 @sleep(i32 1)
br label %1
}
int retval() { return 43; }


x86 assembly (clang, -O0):
<retval>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @retval() {
ret i32 43
}

LLVM IR (-O2):
define i32 @retval() {
ret i32 43
}
int test_imm_34int8_reg(signed char val) {
  return ((val) & (0x34 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_34int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 52
%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_34int8_reg(i8 signext %0) {
%2 = and i8 %0, 52
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cgiTableField(char *text) { printf("<TD> %s </TD>\n", text); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"<TD> %s </TD>\0A\00"
define void @cgiTableField(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mempool_is_shared() {
  printf("NOT IMPLEMENTED:"
         "pa_mempool_is_shared"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"NOT IMPLEMENTED:pa_mempool_is_shared\0A\00"
define i32 @pa_mempool_is_shared() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_mempool_is_shared\00"
define i32 @pa_mempool_is_shared() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int fun581() { return 581; }


x86 assembly (clang, -O0):
<fun581>:
push   %rbp
mov    %rsp,%rbp
mov    $0x245,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun581() {
ret i32 581
}

LLVM IR (-O2):
define i32 @fun581() {
ret i32 581
}
int linearSearch(int arr[], int size, int key) {
  int count = 0;
  for (int i = 0; i < size - 1; i++) {
    count++;
    if (arr[i] == key) {
      return count;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<linearSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1168 <linearSearch+0x68>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1155 <linearSearch+0x55>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <linearSearch+0x6e>
jmp    115a <linearSearch+0x5a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111c <linearSearch+0x1c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearSearch>:
xor    %eax,%eax
cmp    $0x2,%esi
jl     1121 <linearSearch+0x21>
add    $0xffffffff,%esi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%rcx
add    $0x1,%rax
cmp    %edx,(%rdi,%rcx,4)
je     1121 <linearSearch+0x21>
cmp    %rsi,%rax
jb     1110 <linearSearch+0x10>
ret

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

LLVM IR (-O2):
define i32 @linearSearch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = add nsw i32 %1, -1
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %8, %5
%9 = phi i64 [ %10, %8 ], [ 0, %5 ]
%10 = add nuw nsw i64 %9, 1
%11 = getelementptr inbounds i32, i32* %0, i64 %9
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, %2
%14 = icmp ult i64 %10, %7
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %8, label %16
16: ; preds = %8
%17 = trunc i64 %10 to i32
br label %18
18: ; preds = %16, %3
%19 = phi i32 [ 0, %3 ], [ %17, %16 ]
ret i32 %19
}
void RTLogSetDefaultInstance(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogSetDefaultInstance() {
ret void
}
/* Variables and functions */
void glmDiv3fs(float out[3], const float x[3], float y) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = x[i] / y;
}


x86 assembly (clang, -O0):
<glmDiv3fs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3,-0x20(%rbp)
jae    1154 <glmDiv3fs+0x54>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
divss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1119 <glmDiv3fs+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDiv3fs>:
movss  (%rsi),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rsi),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rsi),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @glmDiv3fs(float* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fdiv float %4, %2
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fdiv float %7, %2
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = fdiv float %11, %2
%13 = getelementptr inbounds float, float* %0, i64 2
store float %12, float* %13
ret void
}
/* Variables and functions */
void intr(int sig) {}


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

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

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

LLVM IR (-O2):
define void @intr(i32 %0) {
ret void
}
int main() { return (1 + 2) - 3; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}