xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ screentext_newline();
int /*<<< orphan*/ screentext_writecharnc(char);
int /*<<< orphan*/ update_cursor();
void screentext_print(char *c) {
  for (; *c; c++) {
    if (*c == '\n')
      screentext_newline();
    else
      screentext_writecharnc(*c);
  }
  update_cursor();
}


x86 assembly (clang, -O0):
<screentext_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1187 <screentext_print+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1165 <screentext_print+0x35>
mov    $0x0,%al
call   1040 <screentext_newline@plt>
jmp    1171 <screentext_print+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1050 <screentext_writecharnc@plt>
jmp    1176 <screentext_print+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    113c <screentext_print+0xc>
mov    $0x0,%al
call   1030 <update_cursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screentext_print>:
push   %rbx
mov    %rdi,%rbx
jmp    114b <screentext_print+0x1b>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <screentext_newline@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1140 <screentext_print+0x10>
test   %al,%al
je     1164 <screentext_print+0x34>
movsbl %al,%edi
call   1050 <screentext_writecharnc@plt>
add    $0x1,%rbx
jmp    114b <screentext_print+0x1b>
xor    %eax,%eax
pop    %rbx
jmp    1030 <update_cursor@plt>

LLVM IR (-O0):
define void @screentext_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %19, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 (...) @screentext_newline()
br label %18
14: ; preds = %7
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = call i32 @screentext_writecharnc(i8 signext %16)
br label %18
18: ; preds = %14, %12
br label %19
19: ; preds = %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %3
22: ; preds = %3
%23 = call i32 (...) @update_cursor()
ret void
}

LLVM IR (-O2):
define void @screentext_print(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i8* [ %0, %1 ], [ %10, %9 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %11
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 (...) @screentext_newline()
br label %9
7: ; preds = %2
%8 = tail call i32 @screentext_writecharnc(i8 signext %4)
br label %9
9: ; preds = %5, %7
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
%12 = tail call i32 (...) @update_cursor()
ret void
}
char *langDbgMemVram() { return "VRAM"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"VRAM\00"
define i8* @langDbgMemVram() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
float foo_s(float a, float b) { return -(a * b); }


x86 assembly (clang, -O0):
<foo_s>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_s>:
xorps  0xef9(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @foo_s(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 = fmul float %5, %6
%8 = fneg float %7
ret float %8
}

LLVM IR (-O2):
define float @foo_s(float %0, float %1) {
%3 = fneg float %0
%4 = fmul float %3, %1
ret float %4
}
void foo043() {}


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

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

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

LLVM IR (-O2):
define void @foo043() {
ret void
}
int Msat_IntVecSortCompare2(int *pp1, int *pp2) {
  if (*pp1 > *pp2)
    return -1;
  if (*pp1 < *pp2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<Msat_IntVecSortCompare2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <Msat_IntVecSortCompare2+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <Msat_IntVecSortCompare2+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <Msat_IntVecSortCompare2+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <Msat_IntVecSortCompare2+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Msat_IntVecSortCompare2>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Msat_IntVecSortCompare2(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** %4
%7 = load i32, i32* %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = icmp sgt i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %20
12: ; preds = %2
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %3
br label %20
19: ; preds = %12
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @Msat_IntVecSortCompare2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
%6 = icmp slt i32 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ enable_servo(int);
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_servo_position(int, int);
void servoInit() {
  enable_servo(3);
  set_servo_position(3, 1850);
  msleep(200);
  printf("Servo initialized!\n");
}


x86 assembly (clang, -O0):
<servoInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1050 <enable_servo@plt>
mov    $0x3,%edi
mov    $0x73a,%esi
call   1060 <set_servo_position@plt>
mov    $0xc8,%edi
call   1030 <msleep@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<servoInit>:
push   %rax
mov    $0x3,%edi
call   1050 <enable_servo@plt>
mov    $0x3,%edi
mov    $0x73a,%esi
call   1060 <set_servo_position@plt>
mov    $0xc8,%edi
call   1040 <msleep@plt>
lea    0xe95(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Servo initialized!\0A\00"
define void @servoInit() {
%1 = call i32 @enable_servo(i32 3)
%2 = call i32 @set_servo_position(i32 3, i32 1850)
%3 = call i32 @msleep(i32 200)
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Servo initialized!\00"
define void @servoInit() {
%1 = tail call i32 @enable_servo(i32 3)
%2 = tail call i32 @set_servo_position(i32 3, i32 1850)
%3 = tail call i32 @msleep(i32 200)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ perror(char *);
long getnsec(clockid_t clockid) {
  struct timespec ts;
  if (clock_gettime(clockid, &ts) == -1)
    perror("clock_gettime failed");
  return (long)ts.tv_sec * 1000000000 + (long)ts.tv_nsec;
}


x86 assembly (clang, -O0):
<getnsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0xffffffff,%eax
jne    114c <getnsec+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnsec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0xffffffff,%eax
je     1146 <getnsec+0x26>
imul   $0x3b9aca00,0x10(%rsp),%rax
9a 3b
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
jmp    1133 <getnsec+0x13>

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@.str = [21 x i8] c"clock_gettime failed\00"
define i64 @getnsec(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%11 = load i64, i64* %10
%12 = mul nsw i64 %11, 1000000000
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%14 = load i64, i64* %13
%15 = add nsw i64 %12, %14
ret i64 %15
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@.str = [21 x i8] c"clock_gettime failed\00"
define i64 @getnsec(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = call i32 @clock_gettime(i32 %0, %struct.timespec* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%10 = load i64, i64* %9
%11 = mul nsw i64 %10, 1000000000
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%13 = load i64, i64* %12
%14 = add nsw i64 %11, %13
ret i64 %14
}
int slashesCount(char *pattern) {
  int i = 0;
  int count = 0;
  while (pattern[i] != '\0') {
    if (pattern[i] == '\\') {
      count++;
    }
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<slashesCount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <slashesCount+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1149 <slashesCount+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <slashesCount+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slashesCount>:
xor    %eax,%eax
jmp    1117 <slashesCount+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x5c,%cl
je     1110 <slashesCount+0x10>
test   %cl,%cl
jne    1113 <slashesCount+0x13>
ret

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

LLVM IR (-O2):
define i32 @slashesCount(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 92, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mcfioC_InfoStreamInt(int, int, int *);
void mcfio_infostreamint_(int *stream, int *key, int *values) {
  mcfioC_InfoStreamInt(*stream, *key, values);
}


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

x86 assembly (clang, -O2):
<mcfio_infostreamint_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <mcfioC_InfoStreamInt@plt>

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

LLVM IR (-O2):
define void @mcfio_infostreamint_(i32* nocapture %0, i32* nocapture %1, i32* %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @mcfioC_InfoStreamInt(i32 %4, i32 %5, i32* %2)
ret void
}
int my_strlen(char *str) {
  int loop;
  loop = 0;
  while (str[loop] != '\0')
    ++loop;
  return (loop);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
unsigned int randomish() {
  static unsigned int x = 123456789;
  static unsigned int y = 362436069;
  static unsigned int z = 521288629;
  static unsigned int w = 88675123;
  unsigned int t;
  t = x ^ (x << 11);
  x = y;
  y = z;
  z = w;
  return w = w ^ (w >> 19) ^ (t ^ (t >> 8));
}


x86 assembly (clang, -O0):
<randomish>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    0x2f10(%rip),%ecx
shl    $0xb,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    0x2f06(%rip),%eax
mov    %eax,0x2efc(%rip)
mov    0x2efe(%rip),%eax
mov    %eax,0x2ef4(%rip)
mov    0x2ef6(%rip),%eax
mov    %eax,0x2eec(%rip)
mov    0x2eea(%rip),%eax
mov    0x2ee4(%rip),%ecx
shr    $0x13,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
shr    $0x8,%edx
xor    %edx,%ecx
xor    %ecx,%eax
mov    %eax,0x2ecc(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomish>:
mov    0x2f1a(%rip),%ecx
mov    %ecx,%eax
shl    $0xb,%eax
xor    %ecx,%eax
mov    0x2f11(%rip),%ecx
mov    %ecx,0x2f07(%rip)
mov    0x2f09(%rip),%ecx
mov    %ecx,0x2eff(%rip)
mov    0x2f01(%rip),%ecx
mov    %ecx,0x2ef7(%rip)
mov    %eax,%edx
shr    $0x8,%edx
xor    %ecx,%eax
shr    $0x13,%ecx
xor    %edx,%eax
xor    %ecx,%eax
mov    %eax,0x2ee7(%rip)
ret

LLVM IR (-O0):
@randomish.x = internal global i32 123456789
@randomish.y = internal global i32 362436069
@randomish.z = internal global i32 521288629
@randomish.w = internal global i32 88675123
define i32 @randomish() {
%1 = alloca i32
%2 = load i32, i32* @randomish.x
%3 = load i32, i32* @randomish.x
%4 = shl i32 %3, 11
%5 = xor i32 %2, %4
store i32 %5, i32* %1
%6 = load i32, i32* @randomish.y
store i32 %6, i32* @randomish.x
%7 = load i32, i32* @randomish.z
store i32 %7, i32* @randomish.y
%8 = load i32, i32* @randomish.w
store i32 %8, i32* @randomish.z
%9 = load i32, i32* @randomish.w
%10 = load i32, i32* @randomish.w
%11 = lshr i32 %10, 19
%12 = xor i32 %9, %11
%13 = load i32, i32* %1
%14 = load i32, i32* %1
%15 = lshr i32 %14, 8
%16 = xor i32 %13, %15
%17 = xor i32 %12, %16
store i32 %17, i32* @randomish.w
ret i32 %17
}

LLVM IR (-O2):
@randomish.x = internal unnamed_addr global i32 123456789
@randomish.y = internal unnamed_addr global i32 362436069
@randomish.z = internal unnamed_addr global i32 521288629
@randomish.w = internal unnamed_addr global i32 88675123
define i32 @randomish() {
%1 = load i32, i32* @randomish.x
%2 = shl i32 %1, 11
%3 = xor i32 %2, %1
%4 = load i32, i32* @randomish.y
store i32 %4, i32* @randomish.x
%5 = load i32, i32* @randomish.z
store i32 %5, i32* @randomish.y
%6 = load i32, i32* @randomish.w
store i32 %6, i32* @randomish.z
%7 = lshr i32 %6, 19
%8 = lshr i32 %3, 8
%9 = xor i32 %8, %3
%10 = xor i32 %9, %6
%11 = xor i32 %10, %7
store i32 %11, i32* @randomish.w
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void plugin_close_rotor(void) {
  printf("PrintAzimuth/Elevation plugin closed.\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"PrintAzimuth/Elevation plugin closed.\0A\00"
define void @plugin_close_rotor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"PrintAzimuth/Elevation plugin closed.\00"
define void @plugin_close_rotor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
int OffsetOfSubstring(char *line, char *token) {
  char *inset = strstr(line, token);
  if (!inset)
    return -1;
  else
    return inset - line;
}


x86 assembly (clang, -O0):
<OffsetOfSubstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1148 <OffsetOfSubstring+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <OffsetOfSubstring+0x46>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OffsetOfSubstring>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @OffsetOfSubstring(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i8* @strstr(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @OffsetOfSubstring(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fibonacci(int *, int const);
int /*<<< orphan*/ matrix();
int /*<<< orphan*/ print_vector(int *, int const);
int /*<<< orphan*/ printf(char *);
int main(void) {
  const int size = 20;
  int series[size];
  fibonacci(series, size);
  printf("Fibonacci\n");
  print_vector(series, size);
  printf("\n");
  matrix();
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1050 <fibonacci@plt>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1060 <print_vector@plt>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <matrix@plt>
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1060 <fibonacci@plt>
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1070 <print_vector@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <matrix@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Fibonacci\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 20, i32* %2
%4 = call i8* @llvm.stacksave()
store i8* %4, i8** %3
%5 = alloca i32, i64 20
%6 = call i32 @fibonacci(i32* %5, i32 20)
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @print_vector(i32* %5, i32 20)
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @matrix()
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
%12 = load i8*, i8** %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@str = [10 x i8] c"Fibonacci\00"
define i32 @main() {
%1 = alloca [20 x i32]
%2 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%3 = call i32 @fibonacci(i32* %2, i32 20)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%5 = call i32 @print_vector(i32* %2, i32 20)
%6 = call i32 @putchar(i32 10)
%7 = call i32 (...) @matrix()
%8 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
bool nrf52_errata_209(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_209() {
ret i32 0
}
/* Variables and functions */
int *allocc(int, int, int /*<<< orphan*/);
int *allocclause(int inst, int len) { return allocc(inst, len, 0); }


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

x86 assembly (clang, -O2):
<allocclause>:
xor    %edx,%edx
jmp    1030 <allocc@plt>

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

LLVM IR (-O2):
define i32* @allocclause(i32 %0, i32 %1) {
%3 = tail call i32* @allocc(i32 %0, i32 %1, i32 0)
ret i32* %3
}
int power_management_stop_reading() { return -1; }


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

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

LLVM IR (-O0):
define i32 @power_management_stop_reading() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @power_management_stop_reading() {
ret i32 -1
}
void inc_syscr(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @inc_syscr(%struct.task_struct* nocapture %0) {
ret void
}
unsigned xrop3_216_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S ^ T;
  stk2 = D & stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_216_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_216_1_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %eax,%ecx
mov    %esi,%eax
xor    %dil,%al
movzbl %al,%eax
not    %ecx
and    %eax,%ecx
or     %dil,%sil
movzbl %sil,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_216_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_216_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i8 %1, %0
%8 = zext i8 %7 to i32
%9 = or i32 %6, %4
%10 = xor i32 %9, -1
%11 = and i32 %10, %8
%12 = or i8 %1, %0
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ _ACC_fatal(char *);
void *malloc(size_t);
void *_ACC_alloc(size_t size) {
  void *addr;
  addr = malloc(size);
  if (addr == NULL) {
    _ACC_fatal("cannot allocate memory");
  }
  return addr;
}


x86 assembly (clang, -O0):
<_ACC_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <_ACC_alloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <_ACC_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ACC_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <_ACC_alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <_ACC_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"cannot allocate memory\00"
define i8* @_ACC_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @_ACC_fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [23 x i8] c"cannot allocate memory\00"
define noalias i8* @_ACC_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @_ACC_fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_multprec_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(494, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_multprec_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1ee,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_multprec_start_system>:
mov    $0x1ee,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @write_multprec_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 494, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ version;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bios_cfg_read_entry_io(int /*<<< orphan*/ *, int, int);
__attribute__((unused)) uint32_t bios_cfg_version(void) {
  uint32_t version;
  bios_cfg_read_entry_io(&version, 0x01, sizeof(version));
  return version;
}


x86 assembly (clang, -O0):
<bios_cfg_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <bios_cfg_read_entry_io@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bios_cfg_version>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <bios_cfg_read_entry_io@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bios_cfg_version() {
%1 = alloca i32
%2 = call i32 @bios_cfg_read_entry_io(i32* %1, i32 1, i32 4)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @bios_cfg_version() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @bios_cfg_read_entry_io(i32* %1, i32 1, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
int PNGAbs(int val) { return val < 0 ? -val : val; }


x86 assembly (clang, -O0):
<PNGAbs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <PNGAbs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <PNGAbs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @PNGAbs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
char *strcpy(char *d, const char *s) {
  char *d0;
  d0 = d;
  while (*(d++) = *(s++))
    ;
  return d0;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void av_bsf_list_parse_str() {}


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

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

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

LLVM IR (-O2):
define void @av_bsf_list_parse_str() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int x() { f(); }


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

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

LLVM IR (-O0):
define i32 @x() {
%1 = alloca i32
%2 = call i32 (...) @f()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @x() {
%1 = tail call i32 (...) @f()
ret i32 undef
}
/* Variables and functions */
int recap(char const *, char const *, int /*<<< orphan*/ *);
int rematch(const char *re, const char *text) { return recap(re, text, NULL); }


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

x86 assembly (clang, -O2):
<rematch>:
xor    %edx,%edx
jmp    1030 <recap@plt>

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

LLVM IR (-O2):
define i32 @rematch(i8* %0, i8* %1) {
%3 = tail call i32 @recap(i8* %0, i8* %1, i32* null)
ret i32 %3
}
int foo2(void) { return (-1); }


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

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

LLVM IR (-O0):
define i32 @foo2() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @foo2() {
ret i32 -1
}
void Com_ScriptModule_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @Com_ScriptModule_Shutdown() {
ret void
}
/* Variables and functions */
int fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int _write_buf(int c) { return fputc(c, stdout); }


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

x86 assembly (clang, -O2):
<_write_buf>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define i32 @_write_buf(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputc(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ RAND_bytes(void *, int);
void ptls_openssl_random_bytes(void *buf, size_t len) {
  RAND_bytes(buf, (int)len);
}


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

x86 assembly (clang, -O2):
<ptls_openssl_random_bytes>:
jmp    1030 <RAND_bytes@plt>

LLVM IR (-O0):
define void @ptls_openssl_random_bytes(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = call i32 @RAND_bytes(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @ptls_openssl_random_bytes(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @RAND_bytes(i8* %0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) {
  assert(cond);
  assert(mutex);
  return cond_wait(cond, mutex);
}


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

x86 assembly (clang, -O2):
<pthread_cond_wait>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cond_wait@plt>

LLVM IR (-O0):
define i32 @pthread_cond_wait(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 = call i32 @assert(i32* %5)
%7 = load i32*, i32** %4
%8 = call i32 @assert(i32* %7)
%9 = load i32*, i32** %3
%10 = load i32*, i32** %4
%11 = call i32 @cond_wait(i32* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @pthread_cond_wait(i32* %0, i32* %1) {
%3 = tail call i32 @assert(i32* %0)
%4 = tail call i32 @assert(i32* %1)
%5 = tail call i32 @cond_wait(i32* %0, i32* %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ helper(int);
int second_level_caller();
int main() {
  int k = second_level_caller();
  if (k == 1)
    exit(helper(k));
  else
    exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <second_level_caller@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1162 <main+0x32>
mov    -0x8(%rbp),%edi
call   1040 <helper@plt>
mov    %eax,%edi
call   1030 <exit@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <second_level_caller@plt>
cmp    $0x1,%eax
jne    114e <main+0x1e>
mov    $0x1,%edi
call   1040 <helper@plt>
mov    %eax,%edi
call   1030 <exit@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @second_level_caller()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @helper(i32 %7)
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %0
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @second_level_caller()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @helper(i32 1)
%5 = tail call i32 @exit(i32 %4)
unreachable
6: ; preds = %0
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _dictValFreeDestructor(void *privdata, void *val) {
  ((void)privdata);
  free((void *)val);
}


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

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

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

LLVM IR (-O2):
define void @_dictValFreeDestructor(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void foo368() {}


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

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

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

LLVM IR (-O2):
define void @foo368() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int scan_file(char *, char *);
int main(int argc, char *argv[]) {
  int status;
  if (argc != 3) {
    printf("Usage: %s <file.c> <language file>\n", argv[0]);
    return 1;
  }
  status = scan_file(argv[1], argv[2]);
  return status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <scan_file@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1134 <main+0x14>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
pop    %rax
jmp    1040 <scan_file@plt>
mov    (%rsi),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Usage: %s <file.c> <language file>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 3
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @scan_file(i8* %17, i8* %20)
store i32 %21, i32* %6
%22 = load i32, i32* %6
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %9
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage: %s <file.c> <language file>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %13
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @scan_file(i8* %9, i8* %11)
br label %13
13: ; preds = %7, %4
%14 = phi i32 [ 1, %4 ], [ %12, %7 ]
ret i32 %14
}
float __ocl_fast_distance_float(float src1, float src2) {
  float t = src1 - src2;
  return t < 0 ? -t : t;
}


x86 assembly (clang, -O0):
<__ocl_fast_distance_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1146 <__ocl_fast_distance_float+0x46>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1150 <__ocl_fast_distance_float+0x50>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_fast_distance_float>:
subss  %xmm1,%xmm0
movaps 0xef5(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_fast_distance_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fsub float %6, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = fcmp olt float %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load float, float* %5
%13 = fneg float %12
br label %16
14: ; preds = %2
%15 = load float, float* %5
br label %16
16: ; preds = %14, %11
%17 = phi float [ %13, %11 ], [ %15, %14 ]
ret float %17
}

LLVM IR (-O2):
define float @__ocl_fast_distance_float(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp olt float %3, 0.000000e+00
%5 = fneg float %3
%6 = select i1 %4, float %5, float %3
ret float %6
}