xunge/DecIR huggingface dataset:
int diff(s1, s2)
char *s1, *s2;
{
  while (1) {
    if (*s1 == 0 && *s2 == 0)
      return (0);
    if (*s1 != *s2)
      return (1);
    s1++;
    s2++;
  }
}


x86 assembly (clang, -O0):
<diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1138 <diff+0x38>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1138 <diff+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1177 <diff+0x77>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115a <diff+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1177 <diff+0x77>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <diff+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff>:
mov    (%rdi),%r8b
mov    (%rsi),%r9b
xor    %eax,%eax
mov    %r8d,%ecx
or     %r9b,%cl
je     113b <diff+0x3b>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %r9b,%r8b
jne    113c <diff+0x3c>
movzbl (%rdi,%rcx,1),%r8d
movzbl (%rsi,%rcx,1),%r9d
add    $0x1,%rcx
mov    %r8d,%edx
or     %r9b,%dl
jne    1120 <diff+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @diff(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %22, label %8
8: ; preds = %2, %14
%9 = phi i8 [ %19, %14 ], [ %5, %2 ]
%10 = phi i8 [ %17, %14 ], [ %3, %2 ]
%11 = phi i8* [ %16, %14 ], [ %1, %2 ]
%12 = phi i8* [ %15, %14 ], [ %0, %2 ]
%13 = icmp eq i8 %10, %9
br i1 %13, label %14, label %22
14: ; preds = %8
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = getelementptr inbounds i8, i8* %11, i64 1
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
%19 = load i8, i8* %16
%20 = icmp eq i8 %19, 0
%21 = select i1 %18, i1 %20, i1 false
br i1 %21, label %22, label %8
22: ; preds = %8, %14, %2
%23 = phi i32 [ 0, %2 ], [ 1, %8 ], [ 0, %14 ]
ret i32 %23
}
/* Type definitions */
struct i2c {
  int dummy;
};

/* Variables and functions */
long getBCD(int /*<<< orphan*/);
int /*<<< orphan*/ getWord(struct i2c *, int, int);
long getHostVoltage(struct i2c *i2c) {
  return getBCD(getWord(i2c, 0x69, 0x03));
}


x86 assembly (clang, -O0):
<getHostVoltage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x69,%esi
mov    $0x3,%edx
call   1040 <getWord@plt>
mov    %eax,%edi
call   1030 <getBCD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHostVoltage>:
push   %rax
mov    $0x69,%esi
mov    $0x3,%edx
call   1040 <getWord@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <getBCD@plt>

LLVM IR (-O0):
%struct.i2c = type { i32 }
define i64 @getHostVoltage(%struct.i2c* %0) {
%2 = alloca %struct.i2c*
store %struct.i2c* %0, %struct.i2c** %2
%3 = load %struct.i2c*, %struct.i2c** %2
%4 = call i32 @getWord(%struct.i2c* %3, i32 105, i32 3)
%5 = call i64 @getBCD(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
%struct.i2c = type { i32 }
define i64 @getHostVoltage(%struct.i2c* %0) {
%2 = tail call i32 @getWord(%struct.i2c* %0, i32 105, i32 3)
%3 = tail call i64 @getBCD(i32 %2)
ret i64 %3
}
/* Type definitions */
struct run {
  int dummy;
};

/* Variables and functions */
struct run *run_new_with_arg(int /*<<< orphan*/ *);
struct run *run_new(void) {
  return run_new_with_arg(NULL);
}


x86 assembly (clang, -O0):
<run_new>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <run_new_with_arg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_new>:
xor    %edi,%edi
jmp    1030 <run_new_with_arg@plt>

LLVM IR (-O0):
%struct.run = type { i32 }
define %struct.run* @run_new() {
%1 = call %struct.run* @run_new_with_arg(i32* null)
ret %struct.run* %1
}

LLVM IR (-O2):
%struct.run = type { i32 }
define %struct.run* @run_new() {
%1 = tail call %struct.run* @run_new_with_arg(i32* null)
ret %struct.run* %1
}
int clampi(int v, int min, int max) {
  return v < min ? min : (v > max ? max : v);
}


x86 assembly (clang, -O0):
<clampi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clampi+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clampi+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <clampi+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clampi+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampi>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @clampi(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clampi(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int makeSum(int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int input, sum;
  scanf("%d", &input);
  sum = makeSum(input);
  printf("Sum from 1 to %d is %d\n", input, sum);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <makeSum@plt>
mov    0x4(%rsp),%esi
lea    0xead(%rip),%rdi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [24 x i8] c"Sum from 1 to %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @makeSum(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [24 x i8] c"Sum from 1 to %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @makeSum(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %5)
ret i32 0
}
void foo_2_2_1_2_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_2_2_2_1_1() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
float *nr_vector(long nl, long nh) {
  float *v;
  v = (float *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(float)));
  if (!v)
    nrerror("allocation failure in vector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<nr_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <nr_vector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nr_vector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <nr_vector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x2,%r14
sub    %r14,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @nr_vector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca float*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to float*
store float* %13, float** %5
%14 = load float*, float** %5
%15 = icmp ne float* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load float*, float** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds float, float* %19, i64 %21
%23 = getelementptr inbounds float, float* %22, i64 1
ret float* %23
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @nr_vector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to float*
%12 = sub i64 0, %0
%13 = getelementptr inbounds float, float* %11, i64 %12
%14 = getelementptr inbounds float, float* %13, i64 1
ret float* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_si128(int /*<<< orphan*/ const *);
uint32_t iunpackselect32(__m128i *initOffset, const __m128i *in, int slot) {
  uint32_t *begin = (uint32_t *)in;
  *initOffset = _mm_loadu_si128(in + 31);
  return begin[slot];
}


x86 assembly (clang, -O0):
<iunpackselect32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x7c,%rdi
call   1030 <_mm_loadu_si128@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iunpackselect32>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0x7c(%rsi),%rdi
call   1030 <_mm_loadu_si128@plt>
mov    %eax,0x0(%rbp)
movslq %r14d,%rax
mov    (%rbx,%rax,4),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @iunpackselect32(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %5
store i32* %8, i32** %7
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 31
%11 = call i32 @_mm_loadu_si128(i32* %10)
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @iunpackselect32(i32* nocapture writeonly %0, i32* %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 31
%5 = tail call i32 @_mm_loadu_si128(i32* %4)
store i32 %5, i32* %0
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_ScreenDown(void) { WriteInstruction("call scrd"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"call scrd\00"
define void @CR_ScreenDown() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"call scrd\00"
define void @CR_ScreenDown() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
int gedf2(double a, double b) { return a >= b; }


x86 assembly (clang, -O0):
<gedf2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gedf2>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @gedf2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oge double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gedf2(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ fmin(double, double);
float fminf(float x, float y) { return (float)fmin((double)x, (double)y); }


x86 assembly (clang, -O0):
<fminf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
call   1030 <fmin@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fminf>:
push   %rax
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
call   1030 <fmin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fminf(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 = fpext float %5 to double
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = call i64 @fmin(double %6, double %8)
%10 = sitofp i64 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @fminf(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fpext float %1 to double
%5 = tail call i64 @fmin(double %3, double %4)
%6 = sitofp i64 %5 to float
ret float %6
}
int test_imm_F8uint32_reg(unsigned int val) {
  return ((val) & (0xF8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F8uint32_reg(i32 %0) {
%2 = and i32 %0, 248
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_assign(float *, float *);
__attribute__((always_)) struct mat4 *psmat4_assign(struct mat4 *result,
                                                    struct mat4 *m) {
  mat4_assign((float *)result, (float *)m);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat4_assign>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_assign@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_assign(%struct.mat4* %0, %struct.mat4* %1) {
%3 = alloca %struct.mat4*
%4 = alloca %struct.mat4*
store %struct.mat4* %0, %struct.mat4** %3
store %struct.mat4* %1, %struct.mat4** %4
%5 = load %struct.mat4*, %struct.mat4** %3
%6 = bitcast %struct.mat4* %5 to float*
%7 = load %struct.mat4*, %struct.mat4** %4
%8 = bitcast %struct.mat4* %7 to float*
%9 = call i32 @mat4_assign(float* %6, float* %8)
%10 = load %struct.mat4*, %struct.mat4** %3
ret %struct.mat4* %10
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_assign(%struct.mat4* returned %0, %struct.mat4* %1) {
%3 = bitcast %struct.mat4* %0 to float*
%4 = bitcast %struct.mat4* %1 to float*
%5 = tail call i32 @mat4_assign(float* %3, float* %4)
ret %struct.mat4* %0
}
int iw_get_version_int(void) { return 0x010200; }


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

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

LLVM IR (-O0):
define i32 @iw_get_version_int() {
ret i32 66048
}

LLVM IR (-O2):
define i32 @iw_get_version_int() {
ret i32 66048
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  int /*<<< orphan*/ value;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_LOOKUP_ELEM;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_lookup_elem(int fd, void *key, void *value) {
  union bpf_attr attr = {
      .map_fd = fd,
      .key = ptr_to_u64(key),
      .value = ptr_to_u64(value),
  };
  return syscall(321, BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_lookup_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x20(%rbp),%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_lookup_elem>:
push   %rax
mov    %rdx,%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,(%rsp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x141,%edi
mov    $0x4,%ecx
call   1040 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_MAP_LOOKUP_ELEM = global i32 0
define i32 @bpf_lookup_elem(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast %union.bpf_attr* %7 to i32*
%9 = load i8*, i8** %6
%10 = call i32 @ptr_to_u64(i8* %9)
store i32 %10, i32* %8
%11 = load i32, i32* @BPF_MAP_LOOKUP_ELEM
%12 = call i32 @syscall(i32 321, i32 %11, %union.bpf_attr* %7, i32 4)
ret i32 %12
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_MAP_LOOKUP_ELEM = global i32 0
define i32 @bpf_lookup_elem(i32 %0, i8* nocapture readnone %1, i8* %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
%7 = tail call i32 @ptr_to_u64(i8* %2)
store i32 %7, i32* %6
%8 = load i32, i32* @BPF_MAP_LOOKUP_ELEM
%9 = call i32 @syscall(i32 321, i32 %8, %union.bpf_attr* %4, i32 4)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int askIntQuestion(char *question) {
  int answer = 0;
  printf("%s\n> ", question);
  scanf(" %i", &answer);
  fflush(stdin);
  return answer;
}


x86 assembly (clang, -O0):
<askIntQuestion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<askIntQuestion>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s\0A> \00"
@.str.1 = [4 x i8] c" %i\00"
@stdin = global i32 0
define i32 @askIntQuestion(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* @stdin
%8 = call i32 @fflush(i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s\0A> \00"
@.str.1 = [4 x i8] c" %i\00"
@stdin = global i32 0
define i32 @askIntQuestion(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* @stdin
%7 = call i32 @fflush(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(scalar_t__ *, void const *, int);
void inv_fifo_protocol_helper_decode_ambient_temperature_data(
    const void *in, uint16_t len, float *ambient_temperature) {
  uint16_t tmp;
  FifoProtocol_memcpy((&tmp), (in), (sizeof(tmp)));
  tmp = tmp;
  *ambient_temperature = ((float)(uint16_t)(tmp) / (float)(1ULL << (8)));
  (void)len;
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_decode_ambient_temperature_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x8,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
cvtsi2ssq -0x20(%rbp),%xmm0
movss  0xeb4(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_ambient_temperature_data>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rdi,%rsi
lea    0x8(%rsp),%rdi
mov    $0x8,%edx
call   1030 <FifoProtocol_memcpy@plt>
cvtsi2ssq 0x8(%rsp),%xmm0
mulss  0xec7(%rip),%xmm0
movss  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @inv_fifo_protocol_helper_decode_ambient_temperature_data(i8* %0, i64 %1, float* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca float*
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store float* %2, float** %6
%8 = load i8*, i8** %4
%9 = call i32 @FifoProtocol_memcpy(i64* %7, i8* %8, i32 8)
%10 = load i64, i64* %7
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = sitofp i64 %11 to float
%13 = fdiv float %12, 2.560000e+02
%14 = load float*, float** %6
store float %13, float* %14
%15 = load i64, i64* %5
ret void
}

LLVM IR (-O2):
define void @inv_fifo_protocol_helper_decode_ambient_temperature_data(i8* %0, i64 %1, float* nocapture writeonly %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @FifoProtocol_memcpy(i64* %4, i8* %0, i32 8)
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to float
%9 = fmul float %8, 3.906250e-03
store float %9, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x = 4, y = 3;
  assert(x == 4);
  assert(y == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
cmpl   $0x4,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
store i32 3, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
void av_picture_copy() {}


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

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

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

LLVM IR (-O2):
define void @av_picture_copy() {
ret void
}
/* Variables and functions */
float atof(char *);
float parse_number(char *string) { return atof(string); }


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

x86 assembly (clang, -O2):
<parse_number>:
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define float @parse_number(i8* nocapture %0) {
%2 = tail call float @atof(i8* %0)
ret float %2
}
/* Type definitions */
typedef unsigned int time_t;

/* Variables and functions */
int /*<<< orphan*/ time(unsigned int *);
void cpu_hog(unsigned int run_time) {
  time_t start_time, current_time;
  time(&start_time);
  current_time = start_time;
  while (current_time - start_time < run_time) {
    time(&current_time);
  }
}


x86 assembly (clang, -O0):
<cpu_hog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <time@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1147 <cpu_hog+0x37>
lea    -0xc(%rbp),%rdi
call   1030 <time@plt>
jmp    112a <cpu_hog+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_hog>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%rdi
call   1030 <time@plt>
mov    0x4(%rsp),%eax
mov    %eax,(%rsp)
test   %ebx,%ebx
je     1143 <cpu_hog+0x33>
mov    %rsp,%r14
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <time@plt>
mov    (%rsp),%eax
sub    0x4(%rsp),%eax
cmp    %ebx,%eax
jb     1130 <cpu_hog+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @cpu_hog(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @time(i32* %2)
%7 = load i32, i32* %2
store i32 %7, i32* %3
%8 = icmp eq i32 %0, 0
br i1 %8, label %15, label %9
9: ; preds = %1, %9
%10 = call i32 @time(i32* %3)
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = sub i32 %11, %12
%14 = icmp ult i32 %13, %0
br i1 %14, label %9, label %15
15: ; preds = %9, %1
ret void
}
int age(int num) {
  if (num == 1) {
    return 10;
  } else {
    num--;
    return age(num) + 2;
  }
}


x86 assembly (clang, -O0):
<age>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <age+0x21>
movl   $0xa,-0x4(%rbp)
jmp    1148 <age+0x38>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <age@plt>
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<age>:
cmp    $0x1,%edi
lea    0x8(%rdi,%rdi,1),%ecx
mov    $0xa,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @age(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = shl i32 %0, 1
%4 = add i32 %3, 8
%5 = select i1 %2, i32 10, i32 %4
ret i32 %5
}
/* Variables and functions */
int printf(char *, char const *);
int printDebug(const char *message) {
  int ret = 0;
  ret = printf("DEBUG: %s", message);
  return ret;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"DEBUG: %s\00"
define i32 @printDebug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
void date_never(struct tm *tm, struct tm *now, int *num) {
  time_t n = 0;
  localtime_r(&n, tm);
}


x86 assembly (clang, -O0):
<date_never>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x1c(%rbp),%rdi
call   1030 <localtime_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_never>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime_r@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @date_never(%struct.tm* %0, %struct.tm* %1, i32* %2) {
%4 = alloca %struct.tm*
%5 = alloca %struct.tm*
%6 = alloca i32*
%7 = alloca i32
store %struct.tm* %0, %struct.tm** %4
store %struct.tm* %1, %struct.tm** %5
store i32* %2, i32** %6
store i32 0, i32* %7
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @localtime_r(i32* %7, %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @date_never(%struct.tm* %0, %struct.tm* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @localtime_r(i32* %4, %struct.tm* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printResultsINTBOOL(int result) {
  printf("\n");
  printf("%s", result == 1 ? "TRUE" : "FALSE");
  printf("\n");
}


x86 assembly (clang, -O0):
<printResultsINTBOOL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
lea    0xed7(%rip),%rsi
lea    0xecb(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResultsINTBOOL>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x1,%ebx
lea    0xecc(%rip),%rax
lea    0xeca(%rip),%rsi
cmove  %rax,%rsi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c"TRUE\00"
@.str.3 = [6 x i8] c"FALSE\00"
define void @printResultsINTBOOL(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c"TRUE\00"
@.str.3 = [6 x i8] c"FALSE\00"
define void @printResultsINTBOOL(i32 %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = icmp eq i32 %0, 1
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = tail call i32 @putchar(i32 10)
ret void
}
void block_cli_if_recover_upcall(int id) {}


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

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

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

LLVM IR (-O2):
define void @block_cli_if_recover_upcall(i32 %0) {
ret void
}
/* Variables and functions */
int ResultD(int);
int strlen(char *);
int picolCommandStringLength(int argc, char **argv, void *pd) {
  char *s = argv[1];
  int n = strlen(s);
  return ResultD(n);
}


x86 assembly (clang, -O0):
<picolCommandStringLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1040 <ResultD@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<picolCommandStringLength>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ResultD@plt>

LLVM IR (-O0):
define i32 @picolCommandStringLength(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = call i32 @strlen(i8* %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = call i32 @ResultD(i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @picolCommandStringLength(i32 %0, i8** nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @strlen(i8* %5)
%7 = tail call i32 @ResultD(i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void glut_post_redisplay_p(void) { glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @glut_post_redisplay_p() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int e) {
  fprintf(stderr, "gcodepp: <gcode file>\n"
                  "\t-o <filename>:\n"
                  "\t--output <filename>: gcode output file\n"
                  "\t-vo\n"
                  "\t--verbose-output: verbose gcode output\n"
                  "\t-d\n"
                  "\t--debug: debug traces\n");
  exit(e);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [151 x i8] c"gcodepp: <gcode file>\0A\09-o <filename>:\0A\09--output <filename>: gcode output file\0A\09-vo\0A\09--verbose-output: verbose gcode output\0A\09-d\0A\09--debug: debug traces\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [151 x i8] c"gcodepp: <gcode file>\0A\09-o <filename>:\0A\09--output <filename>: gcode output file\0A\09-vo\0A\09--verbose-output: verbose gcode output\0A\09-d\0A\09--debug: debug traces\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_STOP;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int videoStop(int fd) {
  int ans;
  if ((ans = ioctl(fd, VIDEO_STOP, 0)) < 0) {
    perror("VIDEO STOP: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<videoStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1162 <videoStop+0x42>
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <videoStop+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoStop>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <ioctl@plt>
test   %eax,%eax
js     113b <videoStop+0x1b>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebe(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%ebx
jmp    1137 <videoStop+0x17>

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

LLVM IR (-O2):
@VIDEO_STOP = global i32 0
@.str = [13 x i8] c"VIDEO STOP: \00"
define i32 @videoStop(i32 %0) {
%2 = load i32, i32* @VIDEO_STOP
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
bool is_sorted(int *array, size_t n) {
  while (--n >= 1) {
    if (array[n] < array[n - 1]) {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<is_sorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x1,%rax
jb     1153 <is_sorted+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    114e <is_sorted+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    115a <is_sorted+0x5a>
jmp    110c <is_sorted+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sorted>:
add    $0xffffffffffffffff,%rsi
mov    %rsi,%rax
nopw   0x0(%rax,%rax,1)
sub    $0x1,%rax
jb     1124 <is_sorted+0x24>
mov    (%rdi,%rsi,4),%ecx
mov    %rax,%rsi
cmp    (%rdi,%rax,4),%ecx
jge    1110 <is_sorted+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_sorted(i32* nocapture %0, i64 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i64 [ %1, %2 ], [ %5, %7 ]
%5 = add i64 %4, -1
%6 = icmp eq i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = getelementptr inbounds i32, i32* %0, i64 %5
%9 = load i32, i32* %8
%10 = add i64 %4, -2
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp slt i32 %9, %12
br i1 %13, label %14, label %3
14: ; preds = %3, %7
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %15
}
char *strchrnul(const char *s, int c) {
  const char *p = s;
  while (*p && (*p != c))
    p++;
  return (char *)p;
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1138 <strchrnul+0x38>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1148 <strchrnul+0x48>
jmp    1159 <strchrnul+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <strchrnul+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <strchrnul+0x20>
cmp    %esi,%ecx
jne    1110 <strchrnul+0x10>
ret

LLVM IR (-O0):
define i8* @strchrnul(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %20, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i32, i32* %4
%17 = icmp ne i32 %15, %16
br label %18
18: ; preds = %12, %7
%19 = phi i1 [ false, %7 ], [ %17, %12 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %5
br label %7
23: ; preds = %18
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret i8* %4
}
unsigned short port_io_read_word(unsigned short port) {
  unsigned char data = 0;
  __asm__("in %%dx, %%ax" : "=a"(data) : "d"(port));
  return data;
}


x86 assembly (clang, -O0):
<port_io_read_word>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_io_read_word>:
mov    %edi,%edx
in     (%dx),%ax
movzbl %al,%eax
ret

LLVM IR (-O0):
define zeroext i16 @port_io_read_word(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
store i8 0, i8* %3
%4 = load i16, i16* %2
%5 = call i8 asm "in %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @port_io_read_word(i16 zeroext %0) {
%2 = tail call i8 asm "in %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = zext i8 %2 to i16
ret i16 %3
}