xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int A[], int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d ", A[i]);
  printf("n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0x6e,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"n\00"
define void @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 110)
ret void
}
void main(void) {
  float x;
  float y;
  float w;
  w = x + y - 10.2 / 2.5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
%7 = fpext float %6 to double
%8 = fsub double %7, 4.080000e+00
%9 = fptrunc double %8 to float
store float %9, float* %3
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
void __swap(int *x, int *y) {
  int t;
  t = *x;
  *x = *y;
  *y = t;
}


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

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

LLVM IR (-O0):
define void @__swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @__swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
int get_XMotionEvent_type(void *_p) { return (int)((XMotionEvent *)_p)->type; }


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

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

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

LLVM IR (-O2):
define i32 @get_XMotionEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct tags {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ object_copy(void const *);
int tags_set_object_(struct tags *, char const *, int /*<<< orphan*/);
int tags_set_object(struct tags *tags, const char *name, const void *obj) {
  return tags_set_object_(tags, name, object_copy(obj));
}


x86 assembly (clang, -O0):
<tags_set_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <object_copy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <tags_set_object_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tags_set_object>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <object_copy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <tags_set_object_@plt>

LLVM IR (-O0):
%struct.tags = type { i32 }
define i32 @tags_set_object(%struct.tags* %0, i8* %1, i8* %2) {
%4 = alloca %struct.tags*
%5 = alloca i8*
%6 = alloca i8*
store %struct.tags* %0, %struct.tags** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.tags*, %struct.tags** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @object_copy(i8* %9)
%11 = call i32 @tags_set_object_(%struct.tags* %7, i8* %8, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.tags = type { i32 }
define i32 @tags_set_object(%struct.tags* %0, i8* %1, i8* %2) {
%4 = tail call i32 @object_copy(i8* %2)
%5 = tail call i32 @tags_set_object_(%struct.tags* %0, i8* %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_FAST_FORWARD;
scalar_t__ ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int videoFastForward(int fd, int nframes) {
  int ans;
  if ((ans = ioctl(fd, VIDEO_FAST_FORWARD, nframes) < 0)) {
    perror("VIDEO FAST FORWARD: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<videoFastForward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x10(%rbp)
test   $0x1,%al
jne    1161 <videoFastForward+0x41>
jmp    1179 <videoFastForward+0x59>
lea    0xe98(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <videoFastForward+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoFastForward>:
push   %rax
mov    %esi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113d <videoFastForward+0x1d>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@VIDEO_FAST_FORWARD = global i32 0
@.str = [21 x i8] c"VIDEO FAST FORWARD: \00"
define i32 @videoFastForward(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @VIDEO_FAST_FORWARD
%9 = load i32, i32* %5
%10 = call i64 @ioctl(i32 %7, i32 %8, i32 %9)
%11 = icmp slt i64 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
br i1 %11, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@VIDEO_FAST_FORWARD = global i32 0
@.str = [21 x i8] c"VIDEO FAST FORWARD: \00"
define i32 @videoFastForward(i32 %0, i32 %1) {
%3 = load i32, i32* @VIDEO_FAST_FORWARD
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
uint64_t get_timeval_in_usec(struct timeval start_time,
                             struct timeval end_time) {
  return 1000000 * (end_time.tv_sec - start_time.tv_sec) +
         (end_time.tv_usec - start_time.tv_usec);
}


x86 assembly (clang, -O0):
<get_timeval_in_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %edx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x10(%rbp),%eax
imul   $0xf4240,%eax,%eax
cltq
mov    -0x18(%rbp),%rcx
sub    -0x8(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timeval_in_usec>:
sub    %edi,%edx
imul   $0xf4240,%edx,%eax
cltq
sub    %rsi,%rcx
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @get_timeval_in_usec(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %5 to { i32, i64 }*
%8 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %7, i32 0, i32 0
store i32 %0, i32* %8
%9 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timeval* %6 to { i32, i64 }*
%11 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %10, i32 0, i32 0
store i32 %2, i32* %11
%12 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%16 = load i32, i32* %15
%17 = sub nsw i32 %14, %16
%18 = mul nsw i32 1000000, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%21 = load i64, i64* %20
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%23 = load i64, i64* %22
%24 = sub nsw i64 %21, %23
%25 = add nsw i64 %19, %24
ret i64 %25
}

LLVM IR (-O2):
define i64 @get_timeval_in_usec(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = sub nsw i32 %2, %0
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = sub i64 %3, %1
%9 = add nsw i64 %8, %7
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write_call_table();
int /*<<< orphan*/ write_proto_header();
int main(int argc, char *argv[]) {
  write_proto_header();
  write_call_table();
  exit(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 <write_proto_header@plt>
mov    $0x0,%al
call   1040 <write_call_table@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <write_proto_header@plt>
xor    %eax,%eax
call   1040 <write_call_table@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @write_proto_header()
%7 = call i32 (...) @write_call_table()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @write_proto_header()
%4 = tail call i32 (...) @write_call_table()
%5 = tail call i32 @exit(i32 0)
unreachable
}
int *larger2(int *x, int *y) {
  if (*y > *x)
    return y;
  return x;
}


x86 assembly (clang, -O0):
<larger2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    112b <larger2+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1133 <larger2+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<larger2>:
mov    %rdi,%rax
mov    (%rsi),%ecx
cmp    (%rdi),%ecx
cmovg  %rsi,%rax
ret

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

LLVM IR (-O2):
define i32* @larger2(i32* %0, i32* %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = icmp sgt i32 %3, %4
%6 = select i1 %5, i32* %1, i32* %0
ret i32* %6
}
int HTTPWrapperIsAscii(int c) { return (!(c & ~0177)); }


x86 assembly (clang, -O0):
<HTTPWrapperIsAscii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTTPWrapperIsAscii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @HTTPWrapperIsAscii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -128
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @HTTPWrapperIsAscii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
int floateq(float f1, float f2) {
  float diff = f1 - f2;
  if (diff >= 0 && diff < 0.005)
    return 1;
  if (diff < 0 && diff > -0.005)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<floateq>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1155 <floateq+0x55>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1155 <floateq+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1190 <floateq+0x90>
xorps  %xmm0,%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1189 <floateq+0x89>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe95(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1189 <floateq+0x89>
movl   $0x1,-0x4(%rbp)
jmp    1190 <floateq+0x90>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floateq>:
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
cvtss2sd %xmm0,%xmm2
movsd  0xee7(%rip),%xmm3
ucomisd %xmm2,%xmm3
seta   %cl
and    %al,%cl
ucomiss %xmm0,%xmm1
seta   %al
ucomisd 0xed8(%rip),%xmm2
seta   %dl
and    %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @floateq(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
store float %9, float* %6
%10 = load float, float* %6
%11 = fcmp oge float %10, 0.000000e+00
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load float, float* %6
%14 = fpext float %13 to double
%15 = fcmp olt double %14, 5.000000e-03
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %3
br label %26
17: ; preds = %12, %2
%18 = load float, float* %6
%19 = fcmp olt float %18, 0.000000e+00
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load float, float* %6
%22 = fpext float %21 to double
%23 = fcmp ogt double %22, -5.000000e-03
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %3
br label %26
25: ; preds = %20, %17
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %16
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @floateq(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp oge float %3, 0.000000e+00
%5 = fpext float %3 to double
%6 = fcmp olt double %5, 5.000000e-03
%7 = and i1 %4, %6
%8 = fcmp olt float %3, 0.000000e+00
%9 = fcmp ogt double %5, -5.000000e-03
%10 = and i1 %8, %9
%11 = or i1 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int func_argument(int f(int, int)) { return f(0, 0); }


x86 assembly (clang, -O0):
<func_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func_argument(i32 (i32, i32)* nocapture %0) {
%2 = tail call i32 %0(i32 0, i32 0)
ret i32 %2
}
void main() {
  init_console();
  printk("Hello World!\n");
  asm("hlt");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init_console@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
hlt
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_console@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
hlt
pop    %rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @main() {
%1 = call i32 (...) @init_console()
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @main() {
%1 = tail call i32 (...) @init_console()
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int Tcl_AppInit() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Tcl_AppInit() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void u32_to_bigendian(uint8_t *dst, uint32_t u32) {
  dst[0] = (u32 >> 24) & 0xFF;
  dst[1] = (u32 >> 16) & 0xFF;
  dst[2] = (u32 >> 8) & 0xFF;
  dst[3] = u32 & 0xFF;
}


x86 assembly (clang, -O0):
<u32_to_bigendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u32_to_bigendian>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @u32_to_bigendian(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 3
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @u32_to_bigendian(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
store i32 %3, i32* %0
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = and i32 %1, 255
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ _cos_fix(scalar_t__);
int16_t _sin_fix(float x) {
  return _cos_fix(0xc000 +
                  ((uint16_t)(0xFFFF * (x / 6.283185307179586476925286))));
}


x86 assembly (clang, -O0):
<_sin_fix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
add    $0xc000,%rdi
call   1030 <_cos_fix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sin_fix>:
cvtss2sd %xmm0,%xmm0
divsd  0xee4(%rip),%xmm0
mulsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%rdi
add    $0xc000,%rdi
jmp    1030 <_cos_fix@plt>

LLVM IR (-O0):
define i32 @_sin_fix(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 0x401921FB54442D18
%6 = fmul double 6.553500e+04, %5
%7 = fptosi double %6 to i64
%8 = add nsw i64 49152, %7
%9 = call i32 @_cos_fix(i64 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_sin_fix(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 0x401921FB54442D18
%4 = fmul double %3, 6.553500e+04
%5 = fptosi double %4 to i64
%6 = add nsw i64 %5, 49152
%7 = tail call i32 @_cos_fix(i64 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ AccelStateHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void AccelStateLogging() { UAVObjLogging(AccelStateHandle()); }


x86 assembly (clang, -O0):
<AccelStateLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <AccelStateHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccelStateLogging>:
push   %rax
xor    %eax,%eax
call   1040 <AccelStateHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @AccelStateLogging() {
%1 = call i32 (...) @AccelStateHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AccelStateLogging() {
%1 = tail call i32 (...) @AccelStateHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
int area(int a, int b) {
  int area = a * b;
  return (area);
}


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

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

LLVM IR (-O0):
define i32 @area(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @area(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ ss_flags;
  int /*<<< orphan*/ ss_size;
  int /*<<< orphan*/ ss_sp;
};
typedef TYPE_1__ stack_t;

/* Variables and functions */
int /*<<< orphan*/ test_msg(char *, char *, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
void show_ss(char *prefix, stack_t *s) {
  test_msg("%20s: at %p (size %8zu flags %#2x)\n", prefix, s->ss_sp, s->ss_size,
           s->ss_flags);
}


x86 assembly (clang, -O0):
<show_ss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%r8d
lea    0xec0(%rip),%rdi
call   1030 <test_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_ss>:
mov    %rdi,%rax
mov    0x8(%rsi),%edx
mov    (%rsi),%r8d
mov    0x4(%rsi),%ecx
lea    0xedd(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <test_msg@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32 }
@.str = [36 x i8] c"%20s: at %p (size %8zu flags %x)\0A\00"
define void @show_ss(i8* %0, %struct.TYPE_3__* %1) {
%3 = alloca i8*
%4 = alloca %struct.TYPE_3__*
store i8* %0, i8** %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %4
%5 = load i8*, i8** %3
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 2
%8 = load i32, i32* %7
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @test_msg(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %8, i32 %11, i32 %14)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32 }
@.str = [36 x i8] c"%20s: at %p (size %8zu flags %x)\0A\00"
define void @show_ss(i8* %0, %struct.TYPE_3__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 2
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @test_msg(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4, i32 %6, i32 %8)
ret void
}
void Noop() { asm("nop"); }


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

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

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

LLVM IR (-O2):
define void @Noop() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned int gb_rom_size(const void *rom_start) {
  const char *ptr = (const char *)rom_start;
  return 0x8000 << ptr[0x148];
}


x86 assembly (clang, -O0):
<gb_rom_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x148(%rax),%ecx
mov    $0x8000,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_rom_size>:
mov    0x148(%rdi),%cl
mov    $0x8000,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @gb_rom_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 328
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = shl i32 32768, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @gb_rom_size(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 328
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 32768, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Footer_ism3();
int /*<<< orphan*/ Header_ism3(char *, int /*<<< orphan*/);
int /*<<< orphan*/ PassDirectHtml(char *);
int /*<<< orphan*/ printf(char *);
void Tutorial(void) {
  Header_ism3("Tutorial", 0);
  printf("</center><blockquote>");
  PassDirectHtml("idns.tutorial.txt");
  printf("</blockquote>");
  Footer_ism3();
}


x86 assembly (clang, -O0):
<Tutorial>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
xor    %esi,%esi
call   1030 <Header_ism3@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
call   1060 <PassDirectHtml@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <Footer_ism3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tutorial>:
push   %rax
lea    0xeb8(%rip),%rdi
xor    %esi,%esi
call   1030 <Header_ism3@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
call   1060 <PassDirectHtml@plt>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <Footer_ism3@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Tutorial\00"
@.str.1 = [22 x i8] c"</center><blockquote>\00"
@.str.2 = [18 x i8] c"idns.tutorial.txt\00"
@.str.3 = [14 x i8] c"</blockquote>\00"
define void @Tutorial() {
%1 = call i32 @Header_ism3(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @PassDirectHtml(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (...) @Footer_ism3()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Tutorial\00"
@.str.1 = [22 x i8] c"</center><blockquote>\00"
@.str.2 = [18 x i8] c"idns.tutorial.txt\00"
@.str.3 = [14 x i8] c"</blockquote>\00"
define void @Tutorial() {
%1 = tail call i32 @Header_ism3(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @PassDirectHtml(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (...) @Footer_ism3()
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int xstrpcmp(const void *s1, const void *s2) {
  return strcmp(*((const char **)s1), *((const char **)s2));
}


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

x86 assembly (clang, -O2):
<xstrpcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @xstrpcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @xstrpcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
int clickplc_exe_EndOfSubProgramm_dec(unsigned char *stream, void *obj) {
  int encsize = 4;
  return (encsize);
}


x86 assembly (clang, -O0):
<clickplc_exe_EndOfSubProgramm_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @clickplc_exe_EndOfSubProgramm_dec(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 4
}
int do_562() { return 562; }


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

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

LLVM IR (-O0):
define i32 @do_562() {
ret i32 562
}

LLVM IR (-O2):
define i32 @do_562() {
ret i32 562
}
/* Variables and functions */
int getbitu(unsigned char const *, int, int);
unsigned int getbitu2(const unsigned char *buff, int p1, int l1, int p2,
                      int l2) {
  return (getbitu(buff, p1, l1) << l2) + getbitu(buff, p2, l2);
}


x86 assembly (clang, -O0):
<getbitu2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <getbitu@plt>
mov    -0x18(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <getbitu@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbitu2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r15d
mov    %ecx,%r14d
mov    %rdi,%rbp
call   1030 <getbitu@plt>
mov    %eax,%ebx
mov    %r15d,%ecx
shl    %cl,%ebx
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %r15d,%edx
call   1030 <getbitu@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getbitu2(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @getbitu(i8* %11, i32 %12, i32 %13)
%15 = load i32, i32* %10
%16 = shl i32 %14, %15
%17 = load i8*, i8** %6
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = call i32 @getbitu(i8* %17, i32 %18, i32 %19)
%21 = add nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @getbitu2(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @getbitu(i8* %0, i32 %1, i32 %2)
%7 = shl i32 %6, %4
%8 = tail call i32 @getbitu(i8* %0, i32 %3, i32 %4)
%9 = add nsw i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ updateProgressBar();
void sigalrm_handler(void) {
  updateProgressBar();
  alarm(1);
}


x86 assembly (clang, -O0):
<sigalrm_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <updateProgressBar@plt>
mov    $0x1,%edi
call   1040 <alarm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigalrm_handler>:
push   %rax
xor    %eax,%eax
call   1030 <updateProgressBar@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <alarm@plt>

LLVM IR (-O0):
define void @sigalrm_handler() {
%1 = call i32 (...) @updateProgressBar()
%2 = call i32 @alarm(i32 1)
ret void
}

LLVM IR (-O2):
define void @sigalrm_handler() {
%1 = tail call i32 (...) @updateProgressBar()
%2 = tail call i32 @alarm(i32 1)
ret void
}
/* Type definitions */
struct alisp_object {
  int dummy;
};

/* Variables and functions */
int alisp_get_refs(struct alisp_object *);
int /*<<< orphan*/ alisp_set_refs(struct alisp_object *, unsigned int);
unsigned int alisp_dec_refs(struct alisp_object *p) {
  unsigned r = alisp_get_refs(p) - 1;
  alisp_set_refs(p, r);
  return r;
}


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

x86 assembly (clang, -O2):
<alisp_dec_refs>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <alisp_get_refs@plt>
mov    %eax,%ebp
add    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <alisp_set_refs@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.alisp_object = type { i32 }
define i32 @alisp_dec_refs(%struct.alisp_object* %0) {
%2 = alloca %struct.alisp_object*
%3 = alloca i32
store %struct.alisp_object* %0, %struct.alisp_object** %2
%4 = load %struct.alisp_object*, %struct.alisp_object** %2
%5 = call i32 @alisp_get_refs(%struct.alisp_object* %4)
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load %struct.alisp_object*, %struct.alisp_object** %2
%8 = load i32, i32* %3
%9 = call i32 @alisp_set_refs(%struct.alisp_object* %7, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.alisp_object = type { i32 }
define i32 @alisp_dec_refs(%struct.alisp_object* %0) {
%2 = tail call i32 @alisp_get_refs(%struct.alisp_object* %0)
%3 = add nsw i32 %2, -1
%4 = tail call i32 @alisp_set_refs(%struct.alisp_object* %0, i32 %3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sort(int *, int);
int main() {
  int array[50];
  int size = 5;
  array[0] = 5;
  array[1] = 4;
  array[2] = 3;
  array[3] = 2;
  array[4] = 1;
  sort(array, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0xd4(%rbp)
movl   $0x5,-0xd0(%rbp)
movl   $0x4,-0xcc(%rbp)
movl   $0x3,-0xc8(%rbp)
movl   $0x2,-0xc4(%rbp)
movl   $0x1,-0xc0(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0xd4(%rbp),%esi
call   1030 <sort@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xc8,%rsp
movaps 0xee2(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x1,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
xor    %eax,%eax
add    $0xc8,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %3
%4 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
store i32 5, i32* %4
%5 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 1
store i32 4, i32* %5
%6 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 2
store i32 3, i32* %6
%7 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 3
store i32 2, i32* %7
%8 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 4
store i32 1, i32* %8
%9 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @sort(i32* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [50 x i32]
%2 = bitcast [50 x i32]* %1 to i8*
%3 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%4 = bitcast [50 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 5, i32 4, i32 3, i32 2>, <4 x i32>* %4
%5 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 4
store i32 1, i32* %5
%6 = call i32 @sort(i32* %3, i32 5)
ret i32 0
}
/* Variables and functions */
int rand();
float rand_scalar(void) { return (rand() % 32767) - 16384; }


x86 assembly (clang, -O0):
<rand_scalar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7fff,%ecx
cltd
idiv   %ecx
sub    $0x4000,%edx
cvtsi2ss %edx,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_scalar>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff80010003,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xe,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0xf,%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0xffffc000,%eax
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rand_scalar() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 32767
%3 = sub nsw i32 %2, 16384
%4 = sitofp i32 %3 to float
ret float %4
}

LLVM IR (-O2):
define float @rand_scalar() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 32767
%3 = add nsw i32 %2, -16384
%4 = sitofp i32 %3 to float
ret float %4
}
int f6(int *i) {
  (*i)++;
  return (*i)++;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    (%rdi),%ecx
lea    0x1(%rcx),%eax
add    $0x2,%ecx
mov    %ecx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @f6(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
%4 = add nsw i32 %2, 2
store i32 %4, i32* %0
ret i32 %3
}
double test_log1p(double x) { return __builtin_log1p(x); }


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

x86 assembly (clang, -O2):
<test_log1p>:
jmp    1030 <log1p@plt>

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

LLVM IR (-O2):
define double @test_log1p(double %0) {
%2 = tail call double @log1p(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ threadId;
typedef int /*<<< orphan*/ ptid;
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned long *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ pthread_self();
unsigned long gettid() {
  pthread_t ptid = pthread_self();
  unsigned long threadId = 0;
  memcpy(&threadId, &ptid,
         (((sizeof(threadId)) < (sizeof(ptid))) ? (sizeof(threadId))
                                                : (sizeof(ptid))));
  return threadId;
}


x86 assembly (clang, -O0):
<gettid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettid>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %eax,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @gettid() {
%1 = alloca i32
%2 = alloca i64
%3 = call i32 (...) @pthread_self()
store i32 %3, i32* %1
store i64 0, i64* %2
%4 = call i32 @memcpy(i64* %2, i32* %1, i32 4)
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @gettid() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 (...) @pthread_self()
store i32 %4, i32* %1
%5 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%6 = call i32 @memcpy(i64* %2, i32* %1, i32 4)
%7 = load i64, i64* %2
ret i64 %7
}
int apply(int (*func)(int), int x) { return func(x); }


x86 assembly (clang, -O0):
<apply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @apply(i32 (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 %0(i32 %1)
ret i32 %3
}
int duplicate(int arg) { return arg * 2; }


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

x86 assembly (clang, -O2):
<duplicate>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @duplicate(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void h8max_outb(unsigned char d, unsigned char a) {
  *(unsigned short *)(0x800600 + (a << 1)) = d;
}


x86 assembly (clang, -O0):
<h8max_outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    %ax,%cx
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
add    $0x800600,%eax
cltq
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h8max_outb>:
mov    %esi,%eax
mov    %di,0x800600(%rax,%rax,1)
ret

LLVM IR (-O0):
define void @h8max_outb(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i16
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 1
%10 = add nsw i32 8390144, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i16*
store i16 %6, i16* %12
ret void
}

LLVM IR (-O2):
define void @h8max_outb(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i16
%4 = zext i8 %1 to i64
%5 = shl nuw nsw i64 %4, 1
%6 = or i64 %5, 8390144
%7 = inttoptr i64 %6 to i16*
store i16 %3, i16* %7
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_58(uint64_t x) {
  __asm__("rolq $58, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_58>:
mov    %rdi,%rax
rol    $0x3a,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_58(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$58, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_58(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$58, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
void *thread_function(void *arg) {
  int x = *(int *)arg;
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_function(i8* nocapture readnone %0) {
ret i8* null
}