xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_MUTEX_ERRORCHECK;
int pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_settype(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/);
int mutex_init(pthread_mutex_t *mutex) {
  pthread_mutexattr_t mattr;
  int err;
  pthread_mutexattr_init(&mattr);
  pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_ERRORCHECK);
  err = pthread_mutex_init(mutex, &mattr);
  pthread_mutexattr_destroy(&mattr);
  return err;
}


x86 assembly (clang, -O0):
<mutex_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <pthread_mutex_init@plt>
mov    %eax,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
call   1060 <pthread_mutexattr_destroy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_init>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <pthread_mutex_init@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <pthread_mutexattr_destroy@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PTHREAD_MUTEX_ERRORCHECK = global i32 0
define i32 @mutex_init(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i32 @pthread_mutexattr_init(i32* %3)
%6 = load i32, i32* @PTHREAD_MUTEX_ERRORCHECK
%7 = call i32 @pthread_mutexattr_settype(i32* %3, i32 %6)
%8 = load i32*, i32** %2
%9 = call i32 @pthread_mutex_init(i32* %8, i32* %3)
store i32 %9, i32* %4
%10 = call i32 @pthread_mutexattr_destroy(i32* %3)
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
@PTHREAD_MUTEX_ERRORCHECK = global i32 0
define i32 @mutex_init(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @pthread_mutexattr_init(i32* %2)
%5 = load i32, i32* @PTHREAD_MUTEX_ERRORCHECK
%6 = call i32 @pthread_mutexattr_settype(i32* %2, i32 %5)
%7 = call i32 @pthread_mutex_init(i32* %0, i32* %2)
%8 = call i32 @pthread_mutexattr_destroy(i32* %2)
ret i32 %7
}
__attribute__((visibility("default"))) void foo_export(void) {}


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

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

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

LLVM IR (-O2):
define void @foo_export() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vecNf_copy(float *, float const *, int);
void vec3f_copy(float result[3], const float a[3]) { vecNf_copy(result, a, 3); }


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

x86 assembly (clang, -O2):
<vec3f_copy>:
mov    $0x3,%edx
jmp    1030 <vecNf_copy@plt>

LLVM IR (-O0):
define void @vec3f_copy(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @vecNf_copy(float* %5, float* %6, i32 3)
ret void
}

LLVM IR (-O2):
define void @vec3f_copy(float* %0, float* %1) {
%3 = tail call i32 @vecNf_copy(float* %0, float* %1, i32 3)
ret void
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *val = malloc(sizeof(int));
  *val = 0;
  *val += 1;
  printf("%d\n", *val);
  (*val)++;
  printf("%d\n", *val);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store i32 0, i32* %3
%4 = load i32*, i32** %1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
%7 = load i32*, i32** %1
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %1
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
%13 = load i32*, i32** %1
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
char *hash_plugin_summary(void) {
  return ("mssql-2000 \tMicrosoft SQL Server 2000 plugin");
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"mssql-2000 \09Microsoft SQL Server 2000 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [45 x i8] c"mssql-2000 \09Microsoft SQL Server 2000 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct sched_param {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, struct sched_param *);
int sched_getparam(pid_t pid, struct sched_param *param) {
  return syscall(155, pid, param);
}


x86 assembly (clang, -O0):
<sched_getparam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x9b,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_getparam>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x9b,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.sched_param = type { i32 }
define i32 @sched_getparam(i32 %0, %struct.sched_param* %1) {
%3 = alloca i32
%4 = alloca %struct.sched_param*
store i32 %0, i32* %3
store %struct.sched_param* %1, %struct.sched_param** %4
%5 = load i32, i32* %3
%6 = load %struct.sched_param*, %struct.sched_param** %4
%7 = call i32 @syscall(i32 155, i32 %5, %struct.sched_param* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
define i32 @sched_getparam(i32 %0, %struct.sched_param* %1) {
%3 = tail call i32 @syscall(i32 155, i32 %0, %struct.sched_param* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
int32_t ld_i32_be(const void *x) { return be32toh(((int32_t *)x)[0]); }


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

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

LLVM IR (-O0):
define i32 @ld_i32_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = call i32 @be32toh(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ld_i32_be(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @be32toh(i32 %3)
ret i32 %4
}
int _xor(int x, int y, void *garb) { return x ^ y; }


x86 assembly (clang, -O0):
<_xor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_xor(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = xor i32 %1, %0
ret i32 %4
}
float k2_angle_in_radians(float degrees) {
  return degrees * ((float)3.14159265358979323846) / 180.0f;
}


x86 assembly (clang, -O0):
<k2_angle_in_radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<k2_angle_in_radians>:
mulss  0xef8(%rip),%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @k2_angle_in_radians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x400921FB60000000
%5 = fdiv float %4, 1.800000e+02
ret float %5
}

LLVM IR (-O2):
define float @k2_angle_in_radians(float %0) {
%2 = fmul float %0, 0x400921FB60000000
%3 = fdiv float %2, 1.800000e+02
ret float %3
}
void glmGenerateReverseVector2d(double result[2], const double v[2]) {
  result[0] = -v[0];
  result[1] = -v[1];
}


x86 assembly (clang, -O0):
<glmGenerateReverseVector2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateReverseVector2d>:
movsd  (%rsi),%xmm0
movaps 0xef5(%rip),%xmm1
xorps  %xmm1,%xmm0
movlps %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
xorps  %xmm1,%xmm0
movlps %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmGenerateReverseVector2d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fneg double %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
store double %8, double* %10
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fneg double %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
store double %14, double* %16
ret void
}

LLVM IR (-O2):
define void @glmGenerateReverseVector2d(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fneg double %3
store double %4, double* %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fneg double %6
%8 = getelementptr inbounds double, double* %0, i64 1
store double %7, double* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ XInternAtoms(int /*<<< orphan*/ *, char **, int,
                                int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void useXlibProperly(char **names, Display *display) {
  Atom atoms[500];
  if (!XInternAtoms(display, names, 500, 0, atoms))
    fprintf(stderr, "XInternAtoms failed\n");
}


x86 assembly (clang, -O0):
<useXlibProperly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    -0x7e0(%rbp),%r8
mov    $0x1f4,%edx
xor    %ecx,%ecx
call   1040 <XInternAtoms@plt>
cmp    $0x0,%eax
jne    116c <useXlibProperly+0x4c>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<useXlibProperly>:
sub    $0x7d8,%rsp
mov    %rdi,%rax
mov    %rsp,%r8
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x1f4,%edx
xor    %ecx,%ecx
call   1040 <XInternAtoms@plt>
test   %eax,%eax
je     114b <useXlibProperly+0x2b>
add    $0x7d8,%rsp
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x7d8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"XInternAtoms failed\0A\00"
define void @useXlibProperly(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
%5 = alloca [500 x i32]
store i8** %0, i8*** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i8**, i8*** %3
%8 = getelementptr inbounds [500 x i32], [500 x i32]* %5, i64 0, i64 0
%9 = call i32 @XInternAtoms(i32* %6, i8** %7, i32 500, i32 0, i32* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"XInternAtoms failed\0A\00"
define void @useXlibProperly(i8** %0, i32* %1) {
%3 = alloca [500 x i32]
%4 = bitcast [500 x i32]* %3 to i8*
%5 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 0
%6 = call i32 @XInternAtoms(i32* %1, i8** %0, i32 500, i32 0, i32* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
ret void
}
const char *kokrot_version() { return "1.0-morana"; }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"1.0-morana\00"
define i8* @kokrot_version() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"1.0-morana\00"
define i8* @kokrot_version() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
void RTHeapOffsetDump(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHeapOffsetDump() {
ret void
}
int max(int l, int r) { return l > r ? l : r; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
float lerp(float a, float b, float t) { return a * (1.f - t) + b * t; }


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee0(%rip),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lerp(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* %4
%8 = load float, float* %6
%9 = fsub float 1.000000e+00, %8
%10 = load float, float* %5
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %5)
ret float %6
}
int fun1262() { return 1262; }


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

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

LLVM IR (-O0):
define i32 @fun1262() {
ret i32 1262
}

LLVM IR (-O2):
define i32 @fun1262() {
ret i32 1262
}
void unsigned_char_shl_signed_char_unsigned_char(unsigned char *LHS,
                                                 unsigned char RHS) {
  (*LHS) <<= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_shl_signed_char_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%ecx
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
shl    %cl,%edx
mov    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_shl_signed_char_unsigned_char>:
mov    %esi,%ecx
movzbl (%rdi),%eax
shl    %cl,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_shl_signed_char_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @unsigned_char_shl_signed_char_unsigned_char(i8* nocapture %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = load i8, i8* %0
%5 = zext i8 %4 to i32
%6 = shl i32 %5, %3
%7 = trunc i32 %6 to i8
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int egetc();
short to16bit(int, int);
short int read16bit(void) {
  int c1, c2;
  c1 = egetc();
  c2 = egetc();
  return to16bit(c1, c2);
}


x86 assembly (clang, -O0):
<read16bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <egetc@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <egetc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <to16bit@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16bit>:
push   %rbx
xor    %eax,%eax
call   1030 <egetc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <egetc@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <to16bit@plt>

LLVM IR (-O0):
define signext i16 @read16bit() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @egetc()
store i32 %3, i32* %1
%4 = call i32 (...) @egetc()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call signext i16 @to16bit(i32 %5, i32 %6)
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @read16bit() {
%1 = tail call i32 (...) @egetc()
%2 = tail call i32 (...) @egetc()
%3 = tail call signext i16 @to16bit(i32 %1, i32 %2)
ret i16 %3
}
/* Type definitions */
struct sembuf {
  int member_1;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ operation;

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void sem_ready(int semid) {
  struct sembuf operation[] = {
      {0, 1, 0},
  };
  semop(semid, operation, (sizeof(operation) / sizeof(struct sembuf)));
}


x86 assembly (clang, -O0):
<sem_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_ready>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@__const.sem_ready.operation = [1 x %struct.sembuf] [%struct.sembuf { i32 0, i32 1, i32 0 }]
define void @sem_ready(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x %struct.sembuf]
store i32 %0, i32* %2
%4 = bitcast [1 x %struct.sembuf]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0
%7 = call i32 @semop(i32 %5, %struct.sembuf* %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@__const.sem_ready.operation = [1 x %struct.sembuf] [%struct.sembuf { i32 0, i32 1, i32 0 }]
define void @sem_ready(i32 %0) {
%2 = alloca [1 x %struct.sembuf]
%3 = bitcast [1 x %struct.sembuf]* %2 to i8*
%4 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %2, i64 0, i64 0
%5 = call i32 @semop(i32 %0, %struct.sembuf* %4, i32 1)
ret void
}
/* Variables and functions */
char *HelloWorldLib_sayHello();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%s\n", HelloWorldLib_sayHello());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\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 i8* (...) @HelloWorldLib_sayHello()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @HelloWorldLib_sayHello()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int inc(int n) { return ++n; }


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

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

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

LLVM IR (-O2):
define i32 @inc(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int squaredmetres_to_squaredfeet(int squaredMetres) {
  return squaredMetres * 11;
}


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

x86 assembly (clang, -O2):
<squaredmetres_to_squaredfeet>:
lea    (%rdi,%rdi,4),%eax
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @squaredmetres_to_squaredfeet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 11
ret i32 %4
}

LLVM IR (-O2):
define i32 @squaredmetres_to_squaredfeet(i32 %0) {
%2 = mul nsw i32 %0, 11
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ vic_interrupt_handled();
void irq_handled(void) { vic_interrupt_handled(); }


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

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

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

LLVM IR (-O2):
define void @irq_handled() {
%1 = tail call i32 (...) @vic_interrupt_handled()
ret void
}
short WordToHword(int v, int scl) {
  short out;
  int llsb = (1 << (scl - 1));
  v += llsb;
  v >>= scl;
  if (v > (32767)) {
    v = (-32768);
  }
  out = (short)v;
  return out;
}


x86 assembly (clang, -O0):
<WordToHword>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x7fff,-0x4(%rbp)
jle    1142 <WordToHword+0x42>
movl   $0xffff8000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WordToHword>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%edx
shl    %cl,%edx
add    %edi,%edx
mov    %esi,%ecx
sar    %cl,%edx
cmp    $0x8000,%edx
mov    $0x8000,%eax
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define signext i16 @WordToHword(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %3
%12 = add nsw i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = ashr i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 32767
br i1 %17, label %18, label %19
18: ; preds = %2
store i32 -32768, i32* %3
br label %19
19: ; preds = %18, %2
%20 = load i32, i32* %3
%21 = trunc i32 %20 to i16
store i16 %21, i16* %5
%22 = load i16, i16* %5
ret i16 %22
}

LLVM IR (-O2):
define signext i16 @WordToHword(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = add nsw i32 %4, %0
%6 = ashr i32 %5, %1
%7 = icmp sgt i32 %6, 32767
%8 = trunc i32 %6 to i16
%9 = select i1 %7, i16 -32768, i16 %8
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg1(void) { printf("For he's a jolly good fellow!\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"For he's a jolly good fellow!\0A\00"
define void @msg1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"For he's a jolly good fellow!\00"
define void @msg1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int SIGWINCH;
int /*<<< orphan*/ draw_window();
void signal_handler(int signum) {
  if (signum == SIGWINCH) {
    draw_window();
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1134 <signal_handler+0x24>
mov    $0x0,%al
call   1030 <draw_window@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1122 <signal_handler+0x12>
xor    %eax,%eax
jmp    1030 <draw_window@plt>
ret

LLVM IR (-O0):
@SIGWINCH = global i32 0
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGWINCH
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @draw_window()
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGWINCH = global i32 0
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @SIGWINCH
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @draw_window()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ write(int, char *, int);
void clear_to_eol() {
  if (write(1, "\033K", 2))
    do {
    } while (0);
}


x86 assembly (clang, -O0):
<clear_to_eol>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
je     1143 <clear_to_eol+0x33>
jmp    1139 <clear_to_eol+0x29>
jmp    113e <clear_to_eol+0x2e>
jmp    1143 <clear_to_eol+0x33>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_to_eol>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1BK\00"
define void @clear_to_eol() {
%1 = call i64 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1BK\00"
define void @clear_to_eol() {
%1 = tail call i64 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Type definitions */
struct object {
  int dummy;
};
struct node {
  int dummy;
};
struct expr_node {
  int dummy;
};
struct expr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ expr_node_class_get();
int /*<<< orphan*/ expr_node_init(struct expr_node *, struct expr *);
struct object *object_new(int /*<<< orphan*/);
struct node *expr_node_new(struct expr *expr) {
  struct object *node = object_new(expr_node_class_get());
  expr_node_init(((struct expr_node *)(node)), expr);
  return ((struct node *)(node));
}


x86 assembly (clang, -O0):
<expr_node_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <expr_node_class_get@plt>
mov    %eax,%edi
call   1040 <object_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <expr_node_init@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expr_node_new>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <expr_node_class_get@plt>
mov    %eax,%edi
call   1040 <object_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <expr_node_init@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.node = type { i32 }
%struct.expr = type { i32 }
%struct.object = type { i32 }
%struct.expr_node = type { i32 }
define %struct.node* @expr_node_new(%struct.expr* %0) {
%2 = alloca %struct.expr*
%3 = alloca %struct.object*
store %struct.expr* %0, %struct.expr** %2
%4 = call i32 (...) @expr_node_class_get()
%5 = call %struct.object* @object_new(i32 %4)
store %struct.object* %5, %struct.object** %3
%6 = load %struct.object*, %struct.object** %3
%7 = bitcast %struct.object* %6 to %struct.expr_node*
%8 = load %struct.expr*, %struct.expr** %2
%9 = call i32 @expr_node_init(%struct.expr_node* %7, %struct.expr* %8)
%10 = load %struct.object*, %struct.object** %3
%11 = bitcast %struct.object* %10 to %struct.node*
ret %struct.node* %11
}

LLVM IR (-O2):
%struct.node = type { i32 }
%struct.expr = type { i32 }
%struct.object = type { i32 }
%struct.expr_node = type { i32 }
define %struct.node* @expr_node_new(%struct.expr* %0) {
%2 = tail call i32 (...) @expr_node_class_get()
%3 = tail call %struct.object* @object_new(i32 %2)
%4 = bitcast %struct.object* %3 to %struct.expr_node*
%5 = tail call i32 @expr_node_init(%struct.expr_node* %4, %struct.expr* %0)
%6 = bitcast %struct.object* %3 to %struct.node*
ret %struct.node* %6
}
/* Type definitions */
struct buddy2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct buddy2 *);
void buddy2_destroy(struct buddy2 *self) { free(self); }


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

x86 assembly (clang, -O2):
<buddy2_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.buddy2 = type { i32 }
define void @buddy2_destroy(%struct.buddy2* %0) {
%2 = alloca %struct.buddy2*
store %struct.buddy2* %0, %struct.buddy2** %2
%3 = load %struct.buddy2*, %struct.buddy2** %2
%4 = call i32 @free(%struct.buddy2* %3)
ret void
}

LLVM IR (-O2):
%struct.buddy2 = type { i32 }
define void @buddy2_destroy(%struct.buddy2* nocapture %0) {
%2 = tail call i32 @free(%struct.buddy2* %0)
ret void
}
void ADCDualModeSet(unsigned long ulADCDualMode) {

  ;
  (*((volatile unsigned long *)(0x40012400 + 0x00000004))) &= ~0x000F0000;
  (*((volatile unsigned long *)(0x40012400 + 0x00000004))) |= ulADCDualMode;
}


x86 assembly (clang, -O0):
<ADCDualModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x40012404,%eax
mov    (%rax),%rcx
and    $0xfffffffffff0ffff,%rcx
mov    $0x40012404,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    $0x40012404,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x40012404,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCDualModeSet>:
andq   $0xfffffffffff0ffff,0x40012404
40 ff ff f0 ff
or     %rdi,0x40012404
40
ret

LLVM IR (-O0):
define void @ADCDualModeSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073816580 to i64*)
%4 = and i64 %3, -983041
store volatile i64 %4, i64* inttoptr (i64 1073816580 to i64*)
%5 = load i64, i64* %2
%6 = load volatile i64, i64* inttoptr (i64 1073816580 to i64*)
%7 = or i64 %6, %5
store volatile i64 %7, i64* inttoptr (i64 1073816580 to i64*)
ret void
}

LLVM IR (-O2):
define void @ADCDualModeSet(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1073816580 to i64*)
%3 = and i64 %2, -983041
store volatile i64 %3, i64* inttoptr (i64 1073816580 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 1073816580 to i64*)
%5 = or i64 %4, %0
store volatile i64 %5, i64* inttoptr (i64 1073816580 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utest_control();
void utest_adts_sort(void) {
  utest_control();
  return;
}


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

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

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

LLVM IR (-O2):
define void @utest_adts_sort() {
%1 = tail call i32 (...) @utest_control()
ret void
}
/* Variables and functions */
int core9_swap(char *, int);
int U_EMRARC_swap(char *record, int torev) {
  return (core9_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRARC_swap>:
jmp    1030 <core9_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRARC_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core9_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *args[]) {
  printf("Hello, world!\n");
  printf("Hello, world!\n");
  printf("Hello, world!\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str.2 = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bswap16(uint16_t u16) { return (u16 >> 8 | u16 << 8); }


x86 assembly (clang, -O0):
<bswap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bswap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bswap16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errAbort(char *, int, char *);
void badProteinMatrixLine(int lineIx, char *fileName) {
  errAbort("Expecting letter and 25 numbers line %d of %s", lineIx, fileName);
}


x86 assembly (clang, -O0):
<badProteinMatrixLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <errAbort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badProteinMatrixLine>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <errAbort@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Expecting letter and 25 numbers line %d of %s\00"
define void @badProteinMatrixLine(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 = load i8*, i8** %4
%7 = call i32 @errAbort(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Expecting letter and 25 numbers line %d of %s\00"
define void @badProteinMatrixLine(i32 %0, i8* %1) {
%3 = tail call i32 @errAbort(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
void _M2_SysExceptions_finish(void) {}


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

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

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

LLVM IR (-O2):
define void @_M2_SysExceptions_finish() {
ret void
}
char *reiserfs_get_version_string(void) { return "ReiserFS version 3.6.25"; }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"ReiserFS version 3.6.25\00"
define i8* @reiserfs_get_version_string() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [24 x i8] c"ReiserFS version 3.6.25\00"
define i8* @reiserfs_get_version_string() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ eth_addr_random(int *);
void eth_addr_nicira_random(uint8_t ea[6]) {
  eth_addr_random(ea);
  ea[0] = 0x00;
  ea[1] = 0x23;
  ea[2] = 0x20;
  ea[3] |= 0x80;
}


x86 assembly (clang, -O0):
<eth_addr_nicira_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <eth_addr_random@plt>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x23,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x20,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
or     $0x80,%ecx
mov    %ecx,0xc(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eth_addr_nicira_random>:
push   %rbx
mov    %rdi,%rbx
call   1030 <eth_addr_random@plt>
movabs $0x2300000000,%rax
mov    %rax,(%rbx)
movl   $0x20,0x8(%rbx)
orb    $0x80,0xc(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @eth_addr_nicira_random(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @eth_addr_random(i32* %3)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 35, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
store i32 32, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %12
%14 = or i32 %13, 128
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @eth_addr_nicira_random(i32* %0) {
%2 = tail call i32 @eth_addr_random(i32* %0)
store i32 0, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
store i32 35, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 2
store i32 32, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = or i32 %6, 128
store i32 %7, i32* %5
ret void
}
/* Variables and functions */
float tanf(float);
void __hv_tan_f(float bIn, float *bOut) { *bOut = tanf(bIn); }


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

x86 assembly (clang, -O2):
<__hv_tan_f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <tanf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__hv_tan_f(float %0, float* nocapture writeonly %1) {
%3 = tail call float @tanf(float %0)
store float %3, float* %1
ret void
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_slurp_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_slurp(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_slurp_rec(lexbuf, 5); });
}


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

x86 assembly (clang, -O2):
<Cyc_slurp>:
mov    $0x5,%esi
jmp    1030 <Cyc_slurp_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_slurp(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_slurp_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 5)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_slurp(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_slurp_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 5)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void function(void) { exit(0); }


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<function>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @function() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @function() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
int raise(int sig) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @raise(i32 %0) {
ret i32 0
}
void XMoveResizeWindow() {}


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

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

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

LLVM IR (-O2):
define void @XMoveResizeWindow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
scalar_t__ read(int /*<<< orphan*/, char *, int);
int _jx_getchar(void) {
  char byte;
  if (read(STDIN_FILENO, &byte, 1) > 0)
    return byte;
  return -1;
}


x86 assembly (clang, -O0):
<_jx_getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
jle    1145 <_jx_getchar+0x35>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <_jx_getchar+0x3c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jx_getchar>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
movsbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmovg  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i32 @_jx_getchar() {
%1 = alloca i32
%2 = alloca i8
%3 = load i32, i32* @STDIN_FILENO
%4 = call i64 @read(i32 %3, i8* %2, i32 1)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
store i32 %8, i32* %1
br label %10
9: ; preds = %0
store i32 -1, i32* %1
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @_jx_getchar() {
%1 = alloca i8
%2 = load i32, i32* @STDIN_FILENO
%3 = call i64 @read(i32 %2, i8* %1, i32 1)
%4 = icmp sgt i64 %3, 0
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 -1
ret i32 %7
}