xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank3Low(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ vrc2_4_SetChrROMBank3();
void vrc2_4_setParamsCXX2(uint16_t addr, uint8_t val) {
  __setCHRBank3Low(addr, val);
  vrc2_4_SetChrROMBank3();
}


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

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

LLVM IR (-O0):
define void @vrc2_4_setParamsCXX2(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 @__setCHRBank3Low(i32 %5, i32 %6)
%8 = call i32 (...) @vrc2_4_SetChrROMBank3()
ret void
}

LLVM IR (-O2):
define void @vrc2_4_setParamsCXX2(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank3Low(i32 %0, i32 %1)
%4 = tail call i32 (...) @vrc2_4_SetChrROMBank3()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glPopAttrib();
void qglPopAttrib(void) { glPopAttrib(); }


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

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

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

LLVM IR (-O2):
define void @qglPopAttrib() {
%1 = tail call i32 (...) @glPopAttrib()
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t av_clip_int16_c(int a) {
  if ((a + 0x8000U) & ~0xFFFF)
    return (a >> 31) ^ 0x7FFF;
  else
    return a;
}


x86 assembly (clang, -O0):
<av_clip_int16_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x8000,%eax
and    $0xffff0000,%eax
cmp    $0x0,%eax
je     1130 <av_clip_int16_c+0x30>
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
xor    $0x7fff,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <av_clip_int16_c+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_clip_int16_c>:
cmp    $0xffff8001,%edi
mov    $0xffff8000,%ecx
cmovge %edi,%ecx
cmp    $0x7fff,%ecx
mov    $0x7fff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @av_clip_int16_c(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add i32 %4, 32768
%6 = and i32 %5, -65536
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = ashr i32 %9, 31
%11 = xor i32 %10, 32767
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @av_clip_int16_c(i32 %0) {
%2 = icmp sgt i32 %0, -32768
%3 = select i1 %2, i32 %0, i32 -32768
%4 = icmp slt i32 %3, 32767
%5 = select i1 %4, i32 %3, i32 32767
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t sparents_hashfn(uint32_t inode) { return (inode % 16384); }


x86 assembly (clang, -O0):
<sparents_hashfn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4000,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sparents_hashfn>:
mov    %edi,%eax
lea    0x3fff(%rax),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xffffc000,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sparents_hashfn(i32 %0) {
%2 = srem i32 %0, 16384
ret i32 %2
}
const char *rcsid(const char *p) {
  return rcsid(p = "@(#)$Id: apptype.c 10 2006-07-10 18:22:27Z hyin $");
}


x86 assembly (clang, -O0):
<rcsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <rcsid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcsid>:
jmp    1100 <rcsid>

LLVM IR (-O0):
@.str = [50 x i8] c"@(#)$Id: apptype.c 10 2006-07-10 18:22:27Z hyin $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int builtin_exit(size_t argc, char **argv) {
  if (argc < 2) {
    exit(0);
  } else {
    int exitval;
    sscanf(argv[1], "%d", &exitval);
    exit(exitval);
  }
}


x86 assembly (clang, -O0):
<builtin_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x2,-0x8(%rbp)
jae    1142 <builtin_exit+0x22>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeaf(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<builtin_exit>:
push   %rax
cmp    $0x1,%rdi
ja     112e <builtin_exit+0xe>
xor    %edi,%edi
call   1040 <exit@plt>
mov    0x8(%rsi),%rdi
lea    0xec7(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @builtin_exit(i64 %0, i8** %1) {
%3 = alloca i64
%4 = alloca i8**
%5 = alloca i32
store i64 %0, i64* %3
store i8** %1, i8*** %4
%6 = load i64, i64* %3
%7 = icmp ult i64 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%15 = load i32, i32* %5
%16 = call i32 @exit(i32 %15)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @builtin_exit(i64 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = icmp ult i64 %0, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = bitcast i32* %3 to i8*
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = call i32 @exit(i32 %12)
unreachable
}
int getTemp(void) { return 20; }


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

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

LLVM IR (-O0):
define i32 @getTemp() {
ret i32 20
}

LLVM IR (-O2):
define i32 @getTemp() {
ret i32 20
}
char *strmapto(char *dst, char const *s, char (*f)(char)) {
  if (!(*s))
    return ("\0");
  *dst = f(*s);
  *(dst + 1) = *strmapto(dst + 1, s + 1, f);
  return (dst);
}


x86 assembly (clang, -O0):
<strmapto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1141 <strmapto+0x31>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1180 <strmapto+0x70>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%edi
call   *%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strmapto@plt>
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmapto>:
push   %r15
push   %r14
push   %rbx
mov    (%rsi),%al
test   %al,%al
je     1147 <strmapto+0x37>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
movsbl %al,%edi
call   *%rdx
mov    %al,(%r15)
lea    0x1(%r15),%rdi
add    $0x1,%rbx
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <strmapto@plt>
mov    (%rax),%al
mov    %al,0x1(%r15)
jmp    114e <strmapto+0x3e>
lea    0xeb2(%rip),%r15
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] zeroinitializer
define i8* @strmapto(i8* %0, i8* nocapture %1, i8 (i8)* nocapture %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3, %8
%7 = phi i8* [ %0, %8 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %3 ]
ret i8* %7
8: ; preds = %3
%9 = tail call signext i8 %2(i8 signext %4)
store i8 %9, i8* %0
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = getelementptr inbounds i8, i8* %1, i64 1
%12 = tail call i8* @strmapto(i8* %10, i8* %11, i8 (i8)* %2)
%13 = load i8, i8* %12
store i8 %13, i8* %10
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
void free_vector(float *vec, int nl) { free(vec + nl); }


x86 assembly (clang, -O0):
<free_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_vector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_vector(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load float*, float** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds float, float* %5, i64 %7
%9 = call i32 @free(float* %8)
ret void
}

LLVM IR (-O2):
define void @free_vector(float* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds float, float* %0, i64 %3
%5 = tail call i32 @free(float* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int test_ais_22(void) {
  fprintf(stderr, "test_ais_22() failed: Not Written\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_ais_22>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ais_22>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"test_ais_22() failed: Not Written\0A\00"
define i32 @test_ais_22() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"test_ais_22() failed: Not Written\0A\00"
define i32 @test_ais_22() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emq_route_key_release(void *);
void emq_route_key_list_free_handler(void *value) {
  emq_route_key_release(value);
}


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

x86 assembly (clang, -O2):
<emq_route_key_list_free_handler>:
jmp    1030 <emq_route_key_release@plt>

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

LLVM IR (-O2):
define void @emq_route_key_list_free_handler(i8* %0) {
%2 = tail call i32 @emq_route_key_release(i8* %0)
ret void
}
int min(int a, int b, int c) {
  if (a > b)
    return b < c ? b : c;
  else
    return a < c ? a : c;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1141 <min+0x41>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1130 <min+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <min+0x36>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <min+0x64>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1158 <min+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115e <min+0x5e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
%5 = select i1 %4, i32 %1, i32 %2
%6 = icmp slt i32 %5, %0
%7 = select i1 %6, i32 %5, i32 %0
ret i32 %7
}
float calct(float segmentEnd, float segmentLength, float time) {
  float segmentStart = segmentEnd - segmentLength;
  float t = (time - segmentStart) / segmentLength;
  return t;
}


x86 assembly (clang, -O0):
<calct>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calct>:
subss  %xmm1,%xmm0
subss  %xmm0,%xmm2
divss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @calct(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = fsub float %9, %10
store float %11, float* %7
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fsub float %12, %13
%15 = load float, float* %5
%16 = fdiv float %14, %15
store float %16, float* %8
%17 = load float, float* %8
ret float %17
}

LLVM IR (-O2):
define float @calct(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = fsub float %2, %4
%6 = fdiv float %5, %1
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int cpu_cores() { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<cpu_cores>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_cores>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @cpu_cores() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @cpu_cores() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
short int shortint_ignoring_unsignedchar(short int x, unsigned char y) {
  return x;
}


x86 assembly (clang, -O0):
<shortint_ignoring_unsignedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @shortint_ignoring_unsignedchar(i16 signext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @shortint_ignoring_unsignedchar(i16 returned signext %0, i8 zeroext %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ test_list_iter_add();
int /*<<< orphan*/ test_list_iter_remove();
void test_list_iter() {
  test_list_iter_add();
  test_list_iter_remove();
}


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

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

LLVM IR (-O0):
define void @test_list_iter() {
%1 = call i32 (...) @test_list_iter_add()
%2 = call i32 (...) @test_list_iter_remove()
ret void
}

LLVM IR (-O2):
define void @test_list_iter() {
%1 = tail call i32 (...) @test_list_iter_add()
%2 = tail call i32 (...) @test_list_iter_remove()
ret void
}
int eom(double t, double y[], double dydt[], void *params) {
  dydt[0] = y[1];
  dydt[1] = -y[0];
  return 0;
}


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

x86 assembly (clang, -O2):
<eom>:
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  (%rdi),%xmm0
xorps  0xeec(%rip),%xmm0
movlps %xmm0,0x8(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @eom(double %0, double* %1, double* %2, i8* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca i8*
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store i8* %3, i8** %8
%9 = load double*, double** %6
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %7
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = fneg double %16
%18 = load double*, double** %7
%19 = getelementptr inbounds double, double* %18, i64 1
store double %17, double* %19
ret i32 0
}

LLVM IR (-O2):
define i32 @eom(double %0, double* nocapture %1, double* nocapture writeonly %2, i8* nocapture readnone %3) {
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
store double %6, double* %2
%7 = load double, double* %1
%8 = fneg double %7
%9 = getelementptr inbounds double, double* %2, i64 1
store double %8, double* %9
ret i32 0
}
void RTCritSectLeave(void) {}


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

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

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

LLVM IR (-O2):
define void @RTCritSectLeave() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MIDI_ContinueSong();
void MUSIC_Continue(void) { MIDI_ContinueSong(); }


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

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

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

LLVM IR (-O2):
define void @MUSIC_Continue() {
%1 = tail call i32 (...) @MIDI_ContinueSong()
ret void
}
/* Type definitions */
struct kset {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kset_put(struct kset *);
void subsys_put(struct kset *s) {
  kset_put(s);
  return;
}


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

x86 assembly (clang, -O2):
<subsys_put>:
jmp    1030 <kset_put@plt>

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

LLVM IR (-O2):
%struct.kset = type { i32 }
define void @subsys_put(%struct.kset* %0) {
%2 = tail call i32 @kset_put(%struct.kset* %0)
ret void
}
/* Variables and functions */
void *inv_malloc(unsigned int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *kzalloc(size_t size, unsigned int gfp_flags) {
  void *tmp = inv_malloc((unsigned int)size);
  (void)gfp_flags;
  if (tmp)
    memset(tmp, 0, size);
  return tmp;
}


x86 assembly (clang, -O0):
<kzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <inv_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1158 <kzalloc+0x38>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kzalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <inv_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <kzalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @kzalloc(i64 %0, i32 %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i8* @inv_malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %0)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ send(int, char *, size_t, int /*<<< orphan*/);
ssize_t send_message(int sockfd, char *buf, size_t len) {
  return send(sockfd, buf, len, 0);
}


x86 assembly (clang, -O0):
<send_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @send_message(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void draw_line() {
  printf("_____________________________________________________________________"
         "________\n");
}


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

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

LLVM IR (-O0):
@.str = [79 x i8] c"_____________________________________________________________________________\0A\00"
define void @draw_line() {
%1 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [78 x i8] c"_____________________________________________________________________________\00"
define void @draw_line() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rb_table {
  int dummy;
};

/* Variables and functions */
void **rb_probe(struct rb_table *, void *);
void *rb_replace(struct rb_table *table, void *item) {
  void **p = rb_probe(table, item);
  if (p == NULL || *p == item)
    return NULL;
  else {
    void *r = *p;
    *p = item;
    return r;
  }
}


x86 assembly (clang, -O0):
<rb_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <rb_probe@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <rb_replace+0x3d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    115a <rb_replace+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    1178 <rb_replace+0x68>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_replace>:
push   %rbx
mov    %rsi,%rbx
call   1030 <rb_probe@plt>
test   %rax,%rax
je     112e <rb_replace+0x1e>
mov    %rax,%rcx
mov    (%rax),%rax
cmp    %rbx,%rax
je     112e <rb_replace+0x1e>
mov    %rbx,(%rcx)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.rb_table = type { i32 }
define i8* @rb_replace(%struct.rb_table* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.rb_table*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
store %struct.rb_table* %0, %struct.rb_table** %4
store i8* %1, i8** %5
%8 = load %struct.rb_table*, %struct.rb_table** %4
%9 = load i8*, i8** %5
%10 = call i8** @rb_probe(%struct.rb_table* %8, i8* %9)
store i8** %10, i8*** %6
%11 = load i8**, i8*** %6
%12 = icmp eq i8** %11, null
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = load i8*, i8** %5
%17 = icmp eq i8* %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13, %2
store i8* null, i8** %3
br label %25
19: ; preds = %13
%20 = load i8**, i8*** %6
%21 = load i8*, i8** %20
store i8* %21, i8** %7
%22 = load i8*, i8** %5
%23 = load i8**, i8*** %6
store i8* %22, i8** %23
%24 = load i8*, i8** %7
store i8* %24, i8** %3
br label %25
25: ; preds = %19, %18
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
%struct.rb_table = type { i32 }
define i8* @rb_replace(%struct.rb_table* %0, i8* %1) {
%3 = tail call i8** @rb_probe(%struct.rb_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
br i1 %7, label %9, label %8
8: ; preds = %5
store i8* %1, i8** %3
br label %9
9: ; preds = %2, %5, %8
%10 = phi i8* [ %6, %8 ], [ null, %5 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ __BASENAME__(char *);
int /*<<< orphan*/ _test_skip(int /*<<< orphan*/, int, char *);
int main(void) {
  _test_skip(
      __BASENAME__(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/apple/swift-corelibs-libdispatch/refs/"
          "heads/main/tests/dispatch_transform.c"),
      870, "Dispatch data transforms test");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <__BASENAME__@plt>
mov    %eax,%edi
mov    $0x366,%esi
lea    0xf5d(%rip),%rdx
call   1030 <_test_skip@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <__BASENAME__@plt>
lea    0xf72(%rip),%rdx
mov    %eax,%edi
mov    $0x366,%esi
call   1030 <_test_skip@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apple/swift-corelibs-libdispatch/refs/heads/main/tests/dispatch_transform.c\00"
@.str.1 = [30 x i8] c"Dispatch data transforms test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @__BASENAME__(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @_test_skip(i32 %2, i32 870, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apple/swift-corelibs-libdispatch/refs/heads/main/tests/dispatch_transform.c\00"
@.str.1 = [30 x i8] c"Dispatch data transforms test\00"
define i32 @main() {
%1 = tail call i32 @__BASENAME__(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_test_skip(i32 %1, i32 870, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(int /*<<< orphan*/, int);
void ft_putstr_fd(const char *s, int fd) {
  while (*s)
    ft_putchar_fd(*s++, fd);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <ft_putstr_fd+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0xc(%rbp),%esi
call   1030 <ft_putchar_fd@plt>
jmp    111f <ft_putstr_fd+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <ft_putstr_fd+0x35>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <ft_putchar_fd@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr_fd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @ft_putchar_fd(i32 %9, i32 %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
int do_402() { return 402; }


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

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

LLVM IR (-O0):
define i32 @do_402() {
ret i32 402
}

LLVM IR (-O2):
define i32 @do_402() {
ret i32 402
}
char *strnmov(register char *dst, register const char *src, register int len) {
  while ((*dst++ = *src++) && --len >= 0)
    ;
  return dst - 1;
}


x86 assembly (clang, -O0):
<strnmov>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%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)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1154 <strnmov+0x54>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
setge  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1164 <strnmov+0x64>
jmp    1169 <strnmov+0x69>
jmp    110f <strnmov+0xf>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnmov>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
je     112b <strnmov+0x2b>
add    $0x1,%rsi
lea    -0x1(%rdx),%ecx
test   %edx,%edx
mov    %ecx,%edx
jg     1110 <strnmov+0x10>
ret

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

LLVM IR (-O2):
define i8* @strnmov(i8* writeonly %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i8* [ %0, %3 ], [ %10, %4 ]
%6 = phi i8* [ %1, %3 ], [ %11, %4 ]
%7 = phi i32 [ %2, %3 ], [ %12, %4 ]
%8 = load i8, i8* %6
store i8 %8, i8* %5
%9 = icmp ne i8 %8, 0
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = add nsw i32 %7, -1
%13 = icmp sgt i32 %7, 0
%14 = select i1 %9, i1 %13, i1 false
br i1 %14, label %4, label %15
15: ; preds = %4
ret i8* %5
}
double floor(double x) {
  int res = (int)x;
  return (double)res;
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int _dgr(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _f2d(int);
int _fls(int a, int b) { return _dgr(_f2d(b), _f2d(a)); }


x86 assembly (clang, -O0):
<_fls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <_f2d@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_f2d@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <_dgr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fls>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <_f2d@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <_f2d@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_dgr@plt>

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

LLVM IR (-O2):
define i32 @_fls(i32 %0, i32 %1) {
%3 = tail call i32 @_f2d(i32 %1)
%4 = tail call i32 @_f2d(i32 %0)
%5 = tail call i32 @_dgr(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G23_f(char *s) {
  debug("G23_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G23_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G23_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G23_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G23_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G23_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G23_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_subs_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test45(__m64 a, __m64 b) { return _mm_subs_pi8(a, b); }


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

x86 assembly (clang, -O2):
<test45>:
jmp    1030 <_mm_subs_pi8@plt>

LLVM IR (-O0):
define i32 @test45(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 @_mm_subs_pi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test45(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_pi8(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ __CONST_SOCKADDR_ARG;

/* Variables and functions */
int connect(int, int /*<<< orphan*/, int /*<<< orphan*/);
int __connect(int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) {
  return connect(fd, addr, len);
}


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

x86 assembly (clang, -O2):
<__connect>:
jmp    1030 <connect@plt>

LLVM IR (-O0):
define i32 @__connect(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 = load i32, i32* %6
%10 = call i32 @connect(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @__connect(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @connect(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void catFILE(FILE *in, FILE *out) {
  register int ch;
  while ((ch = getc(in)) != EOF)
    putc(ch, out);
  return;
}


x86 assembly (clang, -O0):
<catFILE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     115c <catFILE+0x3c>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
jmp    1130 <catFILE+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catFILE>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    0x2eb1(%rip),%r15
cmp    (%r15),%eax
je     1157 <catFILE+0x37>
nopl   0x0(%rax)
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    (%r15),%eax
jne    1140 <catFILE+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @catFILE(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putc(i32 %7, i32* %1)
%9 = tail call i32 @getc(i32* %0)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
float sinh(float);
float Float_sinh(float x) { return sinh(x); }


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

x86 assembly (clang, -O2):
<Float_sinh>:
jmp    1030 <sinh@plt>

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

LLVM IR (-O2):
define float @Float_sinh(float %0) {
%2 = tail call float @sinh(float %0)
ret float %2
}
int of_platform_populate(struct device_node *root,
                         const struct of_device_id *matches,
                         struct device_d *parent) {
  return -38;
}


x86 assembly (clang, -O0):
<of_platform_populate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffda,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device_node = type opaque
%struct.of_device_id = type opaque
%struct.device_d = type opaque
define i32 @of_platform_populate(%struct.device_node* %0, %struct.of_device_id* %1, %struct.device_d* %2) {
%4 = alloca %struct.device_node*
%5 = alloca %struct.of_device_id*
%6 = alloca %struct.device_d*
store %struct.device_node* %0, %struct.device_node** %4
store %struct.of_device_id* %1, %struct.of_device_id** %5
store %struct.device_d* %2, %struct.device_d** %6
ret i32 -38
}

LLVM IR (-O2):
%struct.device_node = type opaque
%struct.of_device_id = type opaque
%struct.device_d = type opaque
define i32 @of_platform_populate(%struct.device_node* nocapture readnone %0, %struct.of_device_id* nocapture readnone %1, %struct.device_d* nocapture readnone %2) {
ret i32 -38
}
int get_integer_length(int integer_value) {
  if (integer_value < -8388608 || integer_value > 8388607) {
    return 6;
  } else if (integer_value < -32768 || integer_value > 32767) {
    return 5;
  } else if (integer_value < -128 || integer_value > 127) {
    return 4;
  } else {
    return 3;
  }
}


x86 assembly (clang, -O0):
<get_integer_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xff800000,-0x8(%rbp)
jl     1121 <get_integer_length+0x21>
cmpl   $0x7fffff,-0x8(%rbp)
jle    112d <get_integer_length+0x2d>
movl   $0x6,-0x4(%rbp)
jmp    117a <get_integer_length+0x7a>
cmpl   $0xffff8000,-0x8(%rbp)
jl     1147 <get_integer_length+0x47>
cmpl   $0x7fff,-0x8(%rbp)
jle    1153 <get_integer_length+0x53>
movl   $0x5,-0x4(%rbp)
jmp    117a <get_integer_length+0x7a>
cmpl   $0xffffff80,-0x8(%rbp)
jl     1167 <get_integer_length+0x67>
cmpl   $0x7f,-0x8(%rbp)
jle    1173 <get_integer_length+0x73>
movl   $0x4,-0x4(%rbp)
jmp    117a <get_integer_length+0x7a>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_integer_length>:
lea    -0x800000(%rdi),%ecx
mov    $0x6,%eax
cmp    $0xff000000,%ecx
jb     112d <get_integer_length+0x2d>
movswl %di,%ecx
mov    $0x5,%eax
cmp    %edi,%ecx
jne    112d <get_integer_length+0x2d>
movsbl %dil,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
setne  %al
add    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @get_integer_length(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, -8388608
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 8388607
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 6, i32* %2
br label %25
10: ; preds = %6
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, -32768
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 32767
br i1 %15, label %16, label %17
16: ; preds = %13, %10
store i32 5, i32* %2
br label %25
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, -128
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp sgt i32 %21, 127
br i1 %22, label %23, label %24
23: ; preds = %20, %17
store i32 4, i32* %2
br label %25
24: ; preds = %20
store i32 3, i32* %2
br label %25
25: ; preds = %24, %23, %16, %9
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_integer_length(i32 %0) {
%2 = add i32 %0, -8388608
%3 = icmp ult i32 %2, -16777216
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add nsw i32 %0, -32768
%6 = icmp ult i32 %5, -65536
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = add nsw i32 %0, -128
%9 = icmp ult i32 %8, -256
%10 = select i1 %9, i32 4, i32 3
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 6, %1 ], [ 5, %4 ], [ %10, %7 ]
ret i32 %12
}