xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_with_tab(char *);
int /*<<< orphan*/ print_label(int);
void gen_jump(int label) {
  output_with_tab("jump ");
  print_label(label);
  newline();
}


x86 assembly (clang, -O0):
<gen_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_label@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_jump>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    %ebx,%edi
call   1040 <print_label@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"jump \00"
define void @gen_jump(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @print_label(i32 %4)
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"jump \00"
define void @gen_jump(i32 %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_label(i32 %0)
%4 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wd_clear_ldor(int);
void floppy_timeout(void) { wd_clear_ldor(0x33); }


x86 assembly (clang, -O0):
<floppy_timeout>:
push   %rbp
mov    %rsp,%rbp
mov    $0x33,%edi
call   1030 <wd_clear_ldor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<floppy_timeout>:
mov    $0x33,%edi
jmp    1030 <wd_clear_ldor@plt>

LLVM IR (-O0):
define void @floppy_timeout() {
%1 = call i32 @wd_clear_ldor(i32 51)
ret void
}

LLVM IR (-O2):
define void @floppy_timeout() {
%1 = tail call i32 @wd_clear_ldor(i32 51)
ret void
}
void initNatives(void) {}


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

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

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

LLVM IR (-O2):
define void @initNatives() {
ret void
}
int wordCount(char *sentence_array, int *numWords) {
  if (sentence_array == '\0') {
    printf("ERROR: array entered was null.\n");
    return 1;
  }
  *numWords = CountWords(sentence_array, 0, 0, 1000);
  return 0;
}


x86 assembly (clang, -O0):
<wordCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <wordCount+0x35>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1178 <wordCount+0x58>
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    $0x3e8,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <CountWords@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordCount>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1141 <wordCount+0x21>
mov    %rsi,%rbx
xor    %ebp,%ebp
xor    %esi,%esi
xor    %edx,%edx
mov    $0x3e8,%ecx
xor    %eax,%eax
call   1040 <CountWords@plt>
mov    %eax,(%rbx)
jmp    1152 <wordCount+0x32>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"ERROR: array entered was null.\0A\00"
define i32 @wordCount(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %14
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @CountWords to i32 (i8*, i32, i32, i32, ...)*)(i8* %11, i32 0, i32 0, i32 1000)
%13 = load i32*, i32** %5
store i32 %12, i32* %13
store i32 0, i32* %3
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@str = [31 x i8] c"ERROR: array entered was null.\00"
define i32 @wordCount(i8* %0, i32* nocapture writeonly %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @CountWords to i32 (i8*, i32, i32, i32, ...)*)(i8* %0, i32 0, i32 0, i32 1000)
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %9
}
/* Variables and functions */
float cosf(float);
float HMM_CosF(float Radians) {
  float Result = cosf(Radians);
  return (Result);
}


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

x86 assembly (clang, -O2):
<HMM_CosF>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define float @HMM_CosF(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
/* Variables and functions */
char *realpath(char const *, char *);
char *__realpath_chk(const char *path, char *resolved_path,
                     size_t resolved_len) {
  return realpath(path, resolved_path);
}


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

x86 assembly (clang, -O2):
<__realpath_chk>:
jmp    1030 <realpath@plt>

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

LLVM IR (-O2):
define i8* @__realpath_chk(i8* nocapture %0, i8* %1, i64 %2) {
%4 = tail call i8* @realpath(i8* %0, i8* %1)
ret i8* %4
}
/* Type definitions */
struct ifaddrs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeifaddrs(struct ifaddrs *);
scalar_t__ getifaddrs(struct ifaddrs **);
int /*<<< orphan*/ perror(char *);
int main() {
  struct ifaddrs *ifap = 0;
  if (getifaddrs(&ifap) < 0) {
    perror("xxx:");
    return -1;
  }
  freeifaddrs(ifap);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <getifaddrs@plt>
cmp    $0x0,%rax
jge    1172 <main+0x42>
lea    0xe9f(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <main+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <freeifaddrs@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <getifaddrs@plt>
test   %rax,%rax
js     1153 <main+0x23>
mov    (%rsp),%rdi
call   1040 <freeifaddrs@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea6(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ifaddrs = type { i32 }
@.str = [5 x i8] c"xxx:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.ifaddrs*
store i32 0, i32* %1
store %struct.ifaddrs* null, %struct.ifaddrs** %2
%3 = call i64 @getifaddrs(%struct.ifaddrs** %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %10
7: ; preds = %0
%8 = load %struct.ifaddrs*, %struct.ifaddrs** %2
%9 = call i32 @freeifaddrs(%struct.ifaddrs* %8)
store i32 0, i32* %1
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
%struct.ifaddrs = type { i32 }
@.str = [5 x i8] c"xxx:\00"
define i32 @main() {
%1 = alloca %struct.ifaddrs*
%2 = bitcast %struct.ifaddrs** %1 to i8*
store %struct.ifaddrs* null, %struct.ifaddrs** %1
%3 = call i64 @getifaddrs(%struct.ifaddrs** %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %0
%8 = load %struct.ifaddrs*, %struct.ifaddrs** %1
%9 = call i32 @freeifaddrs(%struct.ifaddrs* %8)
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ -1, %5 ], [ 0, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long, char);
void printsize(long long n) {
  char unit = 'K';
  n /= 1024;
  if (n > 1024) {
    n /= 1024;
    unit = 'M';
  }
  if (n > 1024) {
    n /= 1024;
    unit = 'G';
  }
  printf("%4lld%c", n, unit);
}


x86 assembly (clang, -O0):
<printsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x4b,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
cmpq   $0x400,-0x8(%rbp)
jle    1156 <printsize+0x46>
mov    -0x8(%rbp),%rax
mov    $0x400,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
movb   $0x4d,-0x9(%rbp)
cmpq   $0x400,-0x8(%rbp)
jle    117a <printsize+0x6a>
mov    -0x8(%rbp),%rax
mov    $0x400,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
movb   $0x47,-0x9(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe7b(%rip),%rdi
movsbl -0x9(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printsize>:
cmp    $0x100400,%rdi
mov    $0x100000,%eax
mov    $0x400,%ecx
cmovge %rax,%rcx
mov    %rdi,%rax
shr    $0x20,%rax
je     1138 <printsize+0x28>
mov    %rdi,%rax
cqto
idiv   %rcx
jmp    113e <printsize+0x2e>
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
cmp    $0x100400,%rdi
setge  %cl
add    %cl,%cl
add    $0x4b,%cl
lea    0x3ff(%rax),%rsi
test   %rax,%rax
cmovns %rax,%rsi
sar    $0xa,%rsi
cmp    $0x401,%rax
cmovl  %rax,%rsi
movzbl %cl,%eax
mov    $0x47,%ecx
cmovl  %eax,%ecx
movzbl %cl,%edx
lea    0xe82(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%4lld%c\00"
define void @printsize(i64 %0) {
%2 = alloca i64
%3 = alloca i8
store i64 %0, i64* %2
store i8 75, i8* %3
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 1024
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = icmp sgt i64 %6, 1024
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = sdiv i64 %9, 1024
store i64 %10, i64* %2
store i8 77, i8* %3
br label %11
11: ; preds = %8, %1
%12 = load i64, i64* %2
%13 = icmp sgt i64 %12, 1024
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i64, i64* %2
%16 = sdiv i64 %15, 1024
store i64 %16, i64* %2
store i8 71, i8* %3
br label %17
17: ; preds = %14, %11
%18 = load i64, i64* %2
%19 = load i8, i8* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %18, i8 signext %19)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%4lld%c\00"
define void @printsize(i64 %0) {
%2 = icmp sgt i64 %0, 1049599
%3 = select i1 %2, i64 1048576, i64 1024
%4 = sdiv i64 %0, %3
%5 = select i1 %2, i8 77, i8 75
%6 = icmp sgt i64 %4, 1024
%7 = sdiv i64 %4, 1024
%8 = select i1 %6, i64 %7, i64 %4
%9 = select i1 %6, i8 71, i8 %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %8, i8 signext %9)
ret void
}
double pathconN_nm9_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<pathconN_nm9_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm9_sq>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @pathconN_nm9_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_set_overflow_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_set_overflow_callback"
         "\n");
}


x86 assembly (clang, -O0):
<pa_stream_set_overflow_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [49 x i8] c"NOT IMPLEMENTED:pa_stream_set_overflow_callback\0A\00"
define i32 @pa_stream_set_overflow_callback() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [48 x i8] c"NOT IMPLEMENTED:pa_stream_set_overflow_callback\00"
define i32 @pa_stream_set_overflow_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 == *s2) {
    if (*s1 == 0)
      return 0;
    s1++;
    s2++;
  }
  return (unsigned char)*s1 - (unsigned char)*s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movzbl %al,%eax
movzbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(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 = %20, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %25
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %33
20: ; preds = %14
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %5
br label %6
25: ; preds = %6
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8*, i8** %5
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = sub nsw i32 %28, %31
store i32 %32, i32* %3
br label %33
33: ; preds = %25, %19
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = zext i8 %18 to i32
%21 = zext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
bool insideP(int w, int h, int i, int j) {
  return (i >= 0) && (j >= 0) && (i < w) && (j < h);
}


x86 assembly (clang, -O0):
<insideP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jl     114b <insideP+0x4b>
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jl     114b <insideP+0x4b>
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x11(%rbp)
jge    114b <insideP+0x4b>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insideP>:
mov    %ecx,%eax
or     %edx,%eax
setns  %al
cmp    %edi,%edx
setl   %dl
and    %al,%dl
cmp    %esi,%ecx
setl   %al
and    %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @insideP(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = or i32 %3, %2
%6 = icmp sgt i32 %5, -1
%7 = icmp slt i32 %2, %0
%8 = and i1 %7, %6
%9 = icmp slt i32 %3, %1
%10 = and i1 %9, %8
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int my_free(unsigned int size, void *c) {
  if (c) {
    free(c);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<my_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113f <my_free+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    1146 <my_free+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_free>:
test   %rsi,%rsi
je     1128 <my_free+0x18>
push   %rax
mov    %rsi,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_free(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Type definitions */
struct workqueue_struct {
  int dummy;
};
struct delayed_work {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cancel_delayed_work_sync(struct delayed_work *);
__attribute__((always_)) void
cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
                                  struct delayed_work *work) {
  cancel_delayed_work_sync(work);
}


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

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

LLVM IR (-O0):
%struct.workqueue_struct = type { i32 }
%struct.delayed_work = type { i32 }
define void @cancel_rearming_delayed_workqueue(%struct.workqueue_struct* %0, %struct.delayed_work* %1) {
%3 = alloca %struct.workqueue_struct*
%4 = alloca %struct.delayed_work*
store %struct.workqueue_struct* %0, %struct.workqueue_struct** %3
store %struct.delayed_work* %1, %struct.delayed_work** %4
%5 = load %struct.delayed_work*, %struct.delayed_work** %4
%6 = call i32 @cancel_delayed_work_sync(%struct.delayed_work* %5)
ret void
}

LLVM IR (-O2):
%struct.workqueue_struct = type { i32 }
%struct.delayed_work = type { i32 }
define void @cancel_rearming_delayed_workqueue(%struct.workqueue_struct* nocapture readnone %0, %struct.delayed_work* %1) {
%3 = tail call i32 @cancel_delayed_work_sync(%struct.delayed_work* %1)
ret void
}
unsigned long long int rdtsc(void) {
  unsigned a, d;
  __asm__ volatile("rdtsc" : "=a"(a), "=d"(d));
  return ((unsigned long long)a) | (((unsigned long long)d) << 32);
  ;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
const char *cast_to_const_char_ptr(const void *p) { return p; }


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

x86 assembly (clang, -O2):
<cast_to_const_char_ptr>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @cast_to_const_char_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @cast_to_const_char_ptr(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *simplifyPath(char *);
int main(int argc, char **argv) {
  printf("%s\n", simplifyPath(argv[1]));
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @simplifyPath(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
const char *scamper_do_sting_usage(void) {
  return "sting [-c count] [-d dport] [-f distribution] [-h request]\n"
         "      [-H hole] [-i inter] [-m mean] [-s sport] [-U userid]";
}


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

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

LLVM IR (-O0):
@.str = [119 x i8] c"sting [-c count] [-d dport] [-f distribution] [-h request]\0A [-H hole] [-i inter] [-m mean] [-s sport] [-U userid]\00"
define i8* @scamper_do_sting_usage() {
ret i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [119 x i8] c"sting [-c count] [-d dport] [-f distribution] [-h request]\0A [-H hole] [-i inter] [-m mean] [-s sport] [-U userid]\00"
define i8* @scamper_do_sting_usage() {
ret i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str, i64 0, i64 0)
}
void halt(void) { asm volatile("# halt()\n\thlt\n\t" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "# halt()\0A\09hlt\0A\09", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct bytebuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bytebuffer_append(struct bytebuffer *, char const *, int);
scalar_t__ strlen(char const *);
void bytebuffer_puts(struct bytebuffer *b, const char *str) {
  bytebuffer_append(b, str, (int)strlen(str));
}


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

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

LLVM IR (-O0):
%struct.bytebuffer = type { i32 }
define void @bytebuffer_puts(%struct.bytebuffer* %0, i8* %1) {
%3 = alloca %struct.bytebuffer*
%4 = alloca i8*
store %struct.bytebuffer* %0, %struct.bytebuffer** %3
store i8* %1, i8** %4
%5 = load %struct.bytebuffer*, %struct.bytebuffer** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = trunc i64 %8 to i32
%10 = call i32 @bytebuffer_append(%struct.bytebuffer* %5, i8* %6, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.bytebuffer = type { i32 }
define void @bytebuffer_puts(%struct.bytebuffer* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @bytebuffer_append(%struct.bytebuffer* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void signal_handler(int signal) {
  printf("SIGALRM received\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"SIGALRM received\0A\00"
@EXIT_SUCCESS = global i32 0
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [17 x i8] c"SIGALRM received\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void signed_char_or_signed_char_signed_int(signed char *LHS, signed int RHS) {
  (*LHS) |= RHS;
}


x86 assembly (clang, -O0):
<signed_char_or_signed_char_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_or_signed_char_signed_int>:
or     %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @signed_char_or_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = or i8 %3, %4
store i8 %5, i8* %0
ret void
}
int sum(int n1, int n2, int n3, int n4, int n5, int n6) {
  return n1 + n2 + n3 + n4 + n5 + n6;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
add    %r8d,%eax
add    %r9d,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = add nsw i32 %1, %0
%8 = add nsw i32 %7, %2
%9 = add nsw i32 %8, %3
%10 = add nsw i32 %9, %4
%11 = add nsw i32 %10, %5
ret i32 %11
}
void foo_1_1_2_2_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_2_1_1_2_1() {
ret void
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i_inverse(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec3i *psvec3i_inverse(struct vec3i *result,
                                                       struct vec3i *a) {
  vec3i_inverse((int32_t *)result, (int32_t *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec3i_inverse>:
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 <vec3i_inverse@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_inverse(%struct.vec3i* returned %0, %struct.vec3i* %1) {
%3 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%4 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%5 = tail call i32 @vec3i_inverse(i32* %3, i32* %4)
ret %struct.vec3i* %0
}
/* Variables and functions */
int small_leaf(int);
int small_func(int arg) { return small_leaf(arg); }


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

x86 assembly (clang, -O2):
<small_func>:
jmp    1030 <small_leaf@plt>

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

LLVM IR (-O2):
define i32 @small_func(i32 %0) {
%2 = tail call i32 @small_leaf(i32 %0)
ret i32 %2
}
void RTStrDupExTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrDupExTag() {
ret void
}
/* Variables and functions */
size_t HUF_compress_internal(void *, size_t, void const *, size_t, unsigned int,
                             unsigned int, int /*<<< orphan*/);
size_t HUF_compress2(void *dst, size_t dstSize, const void *src, size_t srcSize,
                     unsigned maxSymbolValue, unsigned huffLog) {
  return HUF_compress_internal(dst, dstSize, src, srcSize, maxSymbolValue,
                               huffLog, 0);
}


x86 assembly (clang, -O0):
<HUF_compress2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <HUF_compress_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HUF_compress2>:
push   %rax
movl   $0x0,(%rsp)
call   1030 <HUF_compress_internal@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @HUF_compress2(i8* %0, i64 %1, i8* %2, i64 %3, i32 %4, i32 %5) {
%7 = tail call i64 @HUF_compress_internal(i8* %0, i64 %1, i8* %2, i64 %3, i32 %4, i32 %5, i32 0)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_free(char *file, int line, void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<my_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @my_free(i8* nocapture readnone %0, i32 %1, i8* nocapture %2) {
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int /*<<< orphan*/);
void foo1(void) {
#pragma omp critical
#pragma omp critical(foo)
#pragma omp critical(bar)
  bar(0);
}


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

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

LLVM IR (-O0):
define void @foo1() {
%1 = call i32 @bar(i32 0)
ret void
}

LLVM IR (-O2):
define void @foo1() {
%1 = tail call i32 @bar(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ stderr;
void xfree(void *ptr) {
  if (ptr) {
    free(ptr);
    ptr = NULL;
  } else {
    fprintf(stderr, "common.c: Trying to free a NULL pointer");
  }
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114d <xfree+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1162 <xfree+0x42>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     112a <xfree+0xa>
jmp    1030 <free@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"common.c: Trying to free a NULL pointer\00"
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
store i8* null, i8** %2
br label %11
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"common.c: Trying to free a NULL pointer\00"
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void iface1_destructor(void *context) {
  printf("A - version 0 destructor context %p\n", context);
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"A - version 0 destructor context %p\0A\00"
define void @iface1_destructor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"A - version 0 destructor context %p\0A\00"
define void @iface1_destructor(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int uptcp_sockatmark(int arg) {
  printf("FIXME: sockatmark()\n");
  return -1;
}


x86 assembly (clang, -O0):
<uptcp_sockatmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uptcp_sockatmark>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"FIXME: sockatmark()\0A\00"
define i32 @uptcp_sockatmark(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@str = [20 x i8] c"FIXME: sockatmark()\00"
define i32 @uptcp_sockatmark(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
struct list_head *list_remove(struct list_head *, struct list_head *);
void list_delete(struct list_head *root) {
  while (root)
    root = list_remove(root, root);
}


x86 assembly (clang, -O0):
<list_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113d <list_delete+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <list_remove@plt>
mov    %rax,-0x8(%rbp)
jmp    111c <list_delete+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_delete>:
push   %rax
test   %rdi,%rdi
je     1130 <list_delete+0x20>
mov    %rdi,%rax
nopl   0x0(%rax)
mov    %rax,%rdi
mov    %rax,%rsi
call   1030 <list_remove@plt>
test   %rax,%rax
jne    1120 <list_delete+0x10>
pop    %rax
ret

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_delete(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
br label %3
3: ; preds = %6, %1
%4 = load %struct.list_head*, %struct.list_head** %2
%5 = icmp ne %struct.list_head* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load %struct.list_head*, %struct.list_head** %2
%8 = load %struct.list_head*, %struct.list_head** %2
%9 = call %struct.list_head* @list_remove(%struct.list_head* %7, %struct.list_head* %8)
store %struct.list_head* %9, %struct.list_head** %2
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_delete(%struct.list_head* %0) {
%2 = icmp eq %struct.list_head* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi %struct.list_head* [ %5, %3 ], [ %0, %1 ]
%5 = tail call %struct.list_head* @list_remove(%struct.list_head* %4, %struct.list_head* %4)
%6 = icmp eq %struct.list_head* %5, null
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *xmalloc(int);
char *xstrdup(const char *p) {
  int len = strlen(p) + 1;
  char *rv = xmalloc(len);
  memcpy(rv, p, len);
  return rv;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @xmalloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @xmalloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abort_gzip();
void read_error() { abort_gzip(); }


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

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

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

LLVM IR (-O2):
define void @read_error() {
%1 = tail call i32 (...) @abort_gzip()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void move_Y(int dir) {
  if (dir == 0) {
    printf("Stop Y motor\n");
  } else {
    printf("Move Y to %s\n", (dir > 0) ? "++" : "--");
  }
}


x86 assembly (clang, -O0):
<move_Y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1138 <move_Y+0x28>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115e <move_Y+0x4e>
mov    -0x4(%rbp),%ecx
lea    0xedd(%rip),%rsi
lea    0xed3(%rip),%rax
cmp    $0x0,%ecx
cmovg  %rax,%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_Y>:
test   %edi,%edi
je     1144 <move_Y+0x24>
lea    0xee3(%rip),%rax
lea    0xedf(%rip),%rsi
cmovg  %rax,%rsi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Stop Y motor\0A\00"
@.str.1 = [14 x i8] c"Move Y to %s\0A\00"
@.str.2 = [3 x i8] c"++\00"
@.str.3 = [3 x i8] c"--\00"
define void @move_Y(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Move Y to %s\0A\00"
@.str.2 = [3 x i8] c"++\00"
@.str.3 = [3 x i8] c"--\00"
@str = [13 x i8] c"Stop Y motor\00"
define void @move_Y(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = icmp sgt i32 %0, 0
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %3
ret void
}