xunge/DecIR huggingface dataset:
int pool_syncforcpu(struct _WsbmBufStorage *buf, unsigned mode) { return 0; }


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

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

LLVM IR (-O0):
%struct._WsbmBufStorage = type opaque
define i32 @pool_syncforcpu(%struct._WsbmBufStorage* %0, i32 %1) {
%3 = alloca %struct._WsbmBufStorage*
%4 = alloca i32
store %struct._WsbmBufStorage* %0, %struct._WsbmBufStorage** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct._WsbmBufStorage = type opaque
define i32 @pool_syncforcpu(%struct._WsbmBufStorage* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int print_key(const void *k, const void *v, void *arg) {
  printf(" Key: %s, Val: %s\n", (char *)k, (char *)v);
  return 1;
}


x86 assembly (clang, -O0):
<print_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_key>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c" Key: %s, Val: %s\0A\00"
define i32 @print_key(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ print(int);
main() {
  int a = 10;
  print(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print(i32 10)
ret i32 0
}
void ff_hevc_put_hevc_qpel_h24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h24_10_sse4() {
ret void
}
int freeMatrix2(double **x, unsigned long rows) {
  unsigned long i;
  for (i = 0; i < rows; i++) {
    free(x[i]);
  }
  free(x);
  return 0;
}


x86 assembly (clang, -O0):
<freeMatrix2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <freeMatrix2+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <freeMatrix2+0x18>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMatrix2>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     1142 <freeMatrix2+0x32>
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeMatrix2+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @freeMatrix2(double** %0, i64 %1) {
%3 = alloca double**
%4 = alloca i64
%5 = alloca i64
store double** %0, double*** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load double**, double*** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds double*, double** %11, i64 %12
%14 = load double*, double** %13
%15 = bitcast double* %14 to i8*
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = load double**, double*** %3
%21 = bitcast double** %20 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @freeMatrix2(double** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds double*, double** %0, i64 %5
%7 = bitcast double** %6 to i8**
%8 = load i8*, i8** %7
tail call void @free(i8* %8)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = bitcast double** %0 to i8*
tail call void @free(i8* %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ end();
void endxlate(void) { end(); }


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

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

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

LLVM IR (-O2):
define void @endxlate() {
%1 = tail call i32 (...) @end()
ret void
}
init_ana() { ; }


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

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

LLVM IR (-O0):
define i32 @init_ana() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @init_ana() {
ret i32 undef
}
void cpu_relax(void) {}


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

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

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

LLVM IR (-O2):
define void @cpu_relax() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int saveConf(char *filePath) { return EXIT_SUCCESS; }


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

x86 assembly (clang, -O2):
<saveConf>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @saveConf(i8* nocapture readnone %0) {
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ regularPluarlForm(char *);
int main(int argc, const char *argv[]) {
  char str[100] = "test";
  regularPluarlForm(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1030 <memset@plt>
movb   $0x74,-0x80(%rbp)
movb   $0x65,-0x7f(%rbp)
movb   $0x73,-0x7e(%rbp)
movb   $0x74,-0x7d(%rbp)
lea    -0x80(%rbp),%rdi
call   1040 <regularPluarlForm@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x74736574,(%rsp)
mov    %rsp,%rdi
call   1030 <regularPluarlForm@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [100 x i8]* %6 to i8*
%8 = bitcast i8* %7 to [100 x i8]*
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 0
store i8 116, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 1
store i8 101, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 2
store i8 115, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 3
store i8 116, i8* %12
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = call i32 @regularPluarlForm(i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8 116, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 1
store i8 101, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 2
store i8 115, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 3
store i8 116, i8* %7
%8 = call i32 @regularPluarlForm(i8* %4)
ret i32 0
}
/* Variables and functions */
int function(char *, char *);
int main() { return function("asdf", "asdf"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rsi
mov    %rsi,%rdi
call   1030 <function@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    %rdi,%rsi
jmp    1030 <function@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @function(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = tail call i32 @function(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int getpagesize();
scalar_t__ sbrk(int /*<<< orphan*/);
char *get_high_address() { return (char *)sbrk(0) + (4 * getpagesize()); }


x86 assembly (clang, -O0):
<get_high_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <sbrk@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
shl    $0x2,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_high_address>:
push   %rbx
xor    %edi,%edi
call   1030 <sbrk@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <getpagesize@plt>
shl    $0x2,%eax
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_high_address() {
%1 = call i64 @sbrk(i32 0)
%2 = inttoptr i64 %1 to i8*
%3 = call i32 (...) @getpagesize()
%4 = mul nsw i32 4, %3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
ret i8* %6
}

LLVM IR (-O2):
define i8* @get_high_address() {
%1 = tail call i64 @sbrk(i32 0)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 (...) @getpagesize()
%4 = shl nsw i32 %3, 2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
ret i8* %6
}
/* Variables and functions */
int __VERIFIER_nondet_int();
scalar_t__ alloca(int);
int sumOfThirdBytes(int *, int);
int main() {
  int array_size = __VERIFIER_nondet_int();
  if (array_size < 1) {
    array_size = 1;
  }
  int *numbers = (int *)alloca(array_size * sizeof(int));
  return sumOfThirdBytes(numbers, array_size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    115a <main+0x2a>
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <sumOfThirdBytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0x1,%ebx
cmovg  %eax,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <alloca@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <sumOfThirdBytes@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %2
br label %8
8: ; preds = %7, %0
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @alloca(i32 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %3
%15 = load i32*, i32** %3
%16 = load i32, i32* %2
%17 = call i32 @sumOfThirdBytes(i32* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 1
%3 = select i1 %2, i32 %1, i32 1
%4 = shl i32 %3, 2
%5 = tail call i64 @alloca(i32 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @sumOfThirdBytes(i32* %6, i32 %3)
ret i32 %7
}
unsigned long proc_get_freq_kernel(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @proc_get_freq_kernel(i32 %0) {
ret i64 0
}
const char *ccnxPortalServerAbout_Name(void) { return "CCNx Portal Server"; }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"CCNx Portal Server\00"
define i8* @ccnxPortalServerAbout_Name() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"CCNx Portal Server\00"
define i8* @ccnxPortalServerAbout_Name() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *strset_(char *str, char c) {
  assert(str != NULL);
  char *s = str;
  for (; *s != '\0'; ++s)
    *s = c;
  return str;
}


x86 assembly (clang, -O0):
<strset_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1166 <strset_+0x56>
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113c <strset_+0x2c>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strset_>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
cmpb   $0x0,(%rbx)
je     113d <strset_+0x2d>
lea    0x1(%rbx),%rax
nop
mov    %bpl,-0x1(%rax)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1130 <strset_+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strset_(i8* returned %0, i8 signext %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %10, %8 ], [ %0, %2 ]
store i8 %1, i8* %9
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %2
ret i8* %0
}
int numcmp(const void *p1, const void *p2) {
  return (*(const int *)p1) - (*(const int *)p2);
}


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

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

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

LLVM IR (-O2):
define i32 @numcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
extern int CheckReturnsFloat(double (*cb)()) {
  double num = cb();
  if (1.23 - num > 0.001)
    return 1;
  return 6;
}


x86 assembly (clang, -O0):
<CheckReturnsFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   *-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  0xeea(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xed5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <CheckReturnsFloat+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <CheckReturnsFloat+0x48>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckReturnsFloat>:
push   %rax
xor    %eax,%eax
call   *%rdi
movsd  0xef3(%rip),%xmm1
subsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd 0xeed(%rip),%xmm1
setbe  %al
lea    (%rax,%rax,4),%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CheckReturnsFloat(double (...)* %0) {
%2 = alloca i32
%3 = alloca double (...)*
%4 = alloca double
store double (...)* %0, double (...)** %3
%5 = load double (...)*, double (...)** %3
%6 = call double (...) %5()
store double %6, double* %4
%7 = load double, double* %4
%8 = fsub double 1.230000e+00, %7
%9 = fcmp ogt double %8, 1.000000e-03
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 6, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @CheckReturnsFloat(double (...)* nocapture %0) {
%2 = tail call double (...) %0()
%3 = fsub double 1.230000e+00, %2
%4 = fcmp ogt double %3, 1.000000e-03
%5 = select i1 %4, i32 1, i32 6
ret i32 %5
}
int sequal(a, b)
char *a, *b;
{
  register char *p, *q;
  p = a;
  q = b;
  while (*p || *q)
    if (*p++ != *q++)
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<sequal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x29(%rbp)
jne    1141 <sequal+0x41>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1151 <sequal+0x51>
jmp    118e <sequal+0x8e>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1189 <sequal+0x89>
movl   $0x0,-0x4(%rbp)
jmp    1195 <sequal+0x95>
jmp    111c <sequal+0x1c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequal>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%r8d
movzbl (%rsi,%rax,1),%edx
mov    %r8d,%ecx
or     %dl,%cl
je     112c <sequal+0x2c>
add    $0x1,%rax
cmp    %dl,%r8b
je     1110 <sequal+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sequal(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %11, %2
%4 = phi i8* [ %0, %2 ], [ %12, %11 ]
%5 = phi i8* [ %1, %2 ], [ %13, %11 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %15, label %11
11: ; preds = %3
%12 = getelementptr inbounds i8, i8* %4, i64 1
%13 = getelementptr inbounds i8, i8* %5, i64 1
%14 = icmp eq i8 %6, %8
br i1 %14, label %3, label %15
15: ; preds = %3, %11
%16 = phi i32 [ 0, %11 ], [ 1, %3 ]
ret i32 %16
}
/* Variables and functions */
char *cmalloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *cstrdup(const char *p) {
  int n = strlen(p);
  char *q = cmalloc(n + 1);
  strcpy(q, p);
  return q;
}


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

x86 assembly (clang, -O2):
<cstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <cmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cstrdup(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)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i8* @cmalloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @cstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @cmalloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct TYPE_2__ {
  int /*<<< orphan*/ *chars;
};
typedef TYPE_1__ XwcTextItem;

/* Variables and functions */
void set_XwcTextItem_chars(void *_p, void *_v) {
  ((XwcTextItem *)_p)->chars = (wchar_t *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XwcTextItem_chars(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XwcTextItem_chars(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
void CleanupSockets() {}


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

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

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

LLVM IR (-O2):
define void @CleanupSockets() {
ret void
}
void FreeGrid(double **u, int m) {
  int i;
#pragma omp parallel for shared(m) private(i)
  for (i = 0; i < m; i++)
    free(u[i]);
  free(u);
}


x86 assembly (clang, -O0):
<FreeGrid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <FreeGrid+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <FreeGrid+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeGrid>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <FreeGrid+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <FreeGrid+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeGrid(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
void chngonline_(idtype, iver, anal_user_code, ier) int *idtype;
int *iver;
char *anal_user_code;
short int *ier;
{
  *iver = -1;
  *ier = 232;
}


x86 assembly (clang, -O0):
<chngonline_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x20(%rbp),%rax
movw   $0xe8,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<chngonline_>:
movl   $0xffffffff,(%rsi)
movw   $0xe8,(%rcx)
ret

LLVM IR (-O0):
define void @chngonline_(i32* %0, i32* %1, i8* %2, i16* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i16*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i16* %3, i16** %8
%9 = load i32*, i32** %6
store i32 -1, i32* %9
%10 = load i16*, i16** %8
store i16 232, i16* %10
ret void
}

LLVM IR (-O2):
define void @chngonline_(i32* nocapture readnone %0, i32* nocapture writeonly %1, i8* nocapture readnone %2, i16* nocapture writeonly %3) {
store i32 -1, i32* %1
store i16 232, i16* %3
ret void
}
void hlt(void) {}


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

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

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

LLVM IR (-O2):
define void @hlt() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int NRF24_SendPolling();
int /*<<< orphan*/ NRF24_SendPrepare(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ const *,
                                     int /*<<< orphan*/ const, int const);
int NRF24_SendPacketBlocking(uint8_t *mac_addr, const uint8_t *pbuff,
                             const uint16_t length, const int NoACK) {
  NRF24_SendPrepare(mac_addr, pbuff, length, NoACK);
  return NRF24_SendPolling();
}


x86 assembly (clang, -O0):
<NRF24_SendPacketBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <NRF24_SendPrepare@plt>
mov    $0x0,%al
call   1040 <NRF24_SendPolling@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @NRF24_SendPacketBlocking(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** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @NRF24_SendPrepare(i32* %9, i32* %10, i32 %11, i32 %12)
%14 = call i32 (...) @NRF24_SendPolling()
ret i32 %14
}

LLVM IR (-O2):
define i32 @NRF24_SendPacketBlocking(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @NRF24_SendPrepare(i32* %0, i32* %1, i32 %2, i32 %3)
%6 = tail call i32 (...) @NRF24_SendPolling()
ret i32 %6
}
unsigned int ct_calculate_percent(unsigned long long measure,
                                  unsigned long long base) {
  return 100ull * measure / base;
}


x86 assembly (clang, -O0):
<ct_calculate_percent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x64,-0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_calculate_percent>:
imul   $0x64,%rdi,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <ct_calculate_percent+0x16>
xor    %edx,%edx
div    %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i32 @ct_calculate_percent(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = mul i64 100, %5
%7 = load i64, i64* %4
%8 = udiv i64 %6, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ct_calculate_percent(i64 %0, i64 %1) {
%3 = mul i64 %0, 100
%4 = udiv i64 %3, %1
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int main(int argv, char **argc) {
  char str[] = "sdfasdfasdf";
  char *pstr = "asdfafdafds";
  putchar(str[2]);
  printf("\n");
  printf("%c\n", str[2]);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xeb1(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    0xeab(%rip),%rax
mov    %rax,-0x28(%rbp)
movsbl -0x1a(%rbp),%edi
call   1030 <putchar@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x1a(%rbp),%esi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x66,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb4(%rip),%rdi
mov    $0x66,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@__const.main.str = [12 x i8] c"sdfasdfasdf\00"
@.str = [12 x i8] c"asdfafdafds\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [12 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [12 x i8]* %6 to i8*
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 2
%10 = load i8, i8* %9
%11 = call i32 @putchar(i8 signext %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i8 signext 102)
%4 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 102)
%6 = tail call i32 @exit(i32 0)
unreachable
}
void BN_MONT_CTX_set_locked(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_MONT_CTX_set_locked() {
ret void
}
int sys_isatty(int file) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sys_isatty(i32 %0) {
ret i32 1
}
int isvowel(int c) {
  const unsigned letter_mask = (1 << ('a' - 'a')) | (1 << ('e' - 'a')) |
                               (1 << ('i' - 'a')) | (1 << ('o' - 'a')) |
                               (1 << ('u' - 'a'));
  unsigned x = (c | 32) - 'a';
  return ((x < 32) << (x & 31)) & letter_mask;
}


x86 assembly (clang, -O0):
<isvowel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x104111,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     $0x20,%eax
sub    $0x61,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%eax
and    $0x104111,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvowel>:
or     $0x20,%edi
lea    -0x61(%rdi),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
setb   %al
shl    %cl,%eax
and    $0x104111,%eax
ret

LLVM IR (-O0):
define i32 @isvowel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1065233, i32* %3
%5 = load i32, i32* %2
%6 = or i32 %5, 32
%7 = sub nsw i32 %6, 97
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ult i32 %8, 32
%10 = zext i1 %9 to i32
%11 = load i32, i32* %4
%12 = and i32 %11, 31
%13 = shl i32 %10, %12
%14 = and i32 %13, 1065233
ret i32 %14
}

LLVM IR (-O2):
define i32 @isvowel(i32 %0) {
%2 = or i32 %0, 32
%3 = add nsw i32 %2, -97
%4 = icmp ult i32 %3, 32
%5 = zext i1 %4 to i32
%6 = and i32 %3, 31
%7 = shl nuw i32 %5, %6
%8 = and i32 %7, 1065233
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int);
int /*<<< orphan*/ msf_frame_to_msf(long, int *, int *, int *);
void msf_print_frame(FILE *fp, long frame) {
  int minutes, seconds, frames;
  msf_frame_to_msf(frame, &minutes, &seconds, &frames);
  fprintf(fp, "%02d:%02d:%02d", minutes, seconds, frames);
}


x86 assembly (clang, -O0):
<msf_print_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <msf_frame_to_msf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msf_print_frame>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rax,%rdi
call   1040 <msf_frame_to_msf@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define void @msf_print_frame(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
%8 = load i64, i64* %4
%9 = call i32 @msf_frame_to_msf(i64 %8, i32* %5, i32* %6, i32* %7)
%10 = load i32*, i32** %3
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define void @msf_print_frame(i32* nocapture %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i32 @msf_frame_to_msf(i64 %1, i32* %3, i32* %4, i32* %5)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_mem_eq(int *, int *, int);
void test_assert_mem_eq_fail(void) {
  int a[6] = {1, 2, 3, 4, 5, 6};
  int b[6] = {6, 5, 4, 3, 2, 1};
  assert_mem_eq(a, b, 6);
}


x86 assembly (clang, -O0):
<test_assert_mem_eq_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xee0(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x6,%edx
call   1030 <assert_mem_eq@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_mem_eq_fail>:
sub    $0x38,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xefd(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x6,%edx
call   1030 <assert_mem_eq@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.test_assert_mem_eq_fail.a = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@__const.test_assert_mem_eq_fail.b = [6 x i32] [i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define void @test_assert_mem_eq_fail() {
%1 = alloca [6 x i32]
%2 = alloca [6 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i32 @assert_mem_eq(i32* %5, i32* %6, i32 6)
ret void
}

LLVM IR (-O2):
@__const.test_assert_mem_eq_fail.a = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@__const.test_assert_mem_eq_fail.b = [6 x i32] [i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define void @test_assert_mem_eq_fail() {
%1 = alloca [6 x i32]
%2 = alloca [6 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i32 @assert_mem_eq(i32* %5, i32* %6, i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char const *, int, char const *);
void __assert_fail(const char *expr, const char *file, int line) {
  printf("%s:%d: Assertion `%s' failed.\n", file, line, expr);
  abort();
}


x86 assembly (clang, -O0):
<__assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__assert_fail>:
push   %rax
mov    %rdi,%rcx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%s:%d: Assertion `%s' failed.\0A\00"
define void @__assert_fail(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
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s:%d: Assertion `%s' failed.\0A\00"
define void @__assert_fail(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar();
int baz();
int foo();
int main(void) {
  if (foo() != 254 || bar() != 4 || baz() != 8)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <foo@plt>
cmp    $0xfe,%eax
jne    1181 <main+0x41>
mov    $0x0,%al
call   1050 <bar@plt>
cmp    $0x4,%eax
jne    1181 <main+0x41>
mov    $0x0,%al
call   1040 <baz@plt>
cmp    $0x8,%eax
je     1188 <main+0x48>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <foo@plt>
cmp    $0xfe,%eax
jne    116b <main+0x2b>
xor    %eax,%eax
call   1050 <bar@plt>
cmp    $0x4,%eax
jne    116b <main+0x2b>
xor    %eax,%eax
call   1040 <baz@plt>
cmp    $0x8,%eax
jne    116b <main+0x2b>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, 254
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = call i32 (...) @bar()
%6 = icmp ne i32 %5, 4
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = call i32 (...) @baz()
%9 = icmp ne i32 %8, 8
br i1 %9, label %10, label %12
10: ; preds = %7, %4, %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 254
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = tail call i32 (...) @bar()
%5 = icmp eq i32 %4, 4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 (...) @baz()
%8 = icmp eq i32 %7, 8
br i1 %8, label %11, label %9
9: ; preds = %6, %3, %0
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %6
ret i32 0
}
/* Variables and functions */
unsigned int bin_search(char, char *, int /*<<< orphan*/, int);
void bin_search_call(void) {
  char a_string[] = "abcdwxyz";
  unsigned int x = bin_search('w', a_string, 0, 8);
  a_string[x] = 'W';
}


x86 assembly (clang, -O0):
<bin_search_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xedf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x9(%rbp),%rsi
mov    $0x77,%edi
xor    %edx,%edx
mov    $0x8,%ecx
call   1030 <bin_search@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movb   $0x57,-0x9(%rbp,%rax,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_search_call>:
sub    $0x18,%rsp
movabs $0x7a79787764636261,%rax
78 79 7a
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x77,%edi
xor    %edx,%edx
mov    $0x8,%ecx
call   1030 <bin_search@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.bin_search_call.a_string = [9 x i8] c"abcdwxyz\00"
define void @bin_search_call() {
%1 = alloca [9 x i8]
%2 = alloca i32
%3 = bitcast [9 x i8]* %1 to i8*
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%5 = call i32 @bin_search(i8 signext 119, i8* %4, i32 0, i32 8)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 %7
store i8 87, i8* %8
ret void
}

LLVM IR (-O2):
@__const.bin_search_call.a_string = [9 x i8] c"abcdwxyz\00"
define void @bin_search_call() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = call i32 @bin_search(i8 signext 119, i8* %2, i32 0, i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct packed_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dtou32(double, int /*<<< orphan*/);
int packed_buffer_append_u32(struct packed_buffer *, int /*<<< orphan*/);
int packed_buffer_append_du32(struct packed_buffer *pb, double d,
                              uint32_t scale) {
  return packed_buffer_append_u32(pb, dtou32(d, scale));
}


x86 assembly (clang, -O0):
<packed_buffer_append_du32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <dtou32@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <packed_buffer_append_u32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packed_buffer_append_du32>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <dtou32@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <packed_buffer_append_u32@plt>

LLVM IR (-O0):
%struct.packed_buffer = type { i32 }
define i32 @packed_buffer_append_du32(%struct.packed_buffer* %0, double %1, i32 %2) {
%4 = alloca %struct.packed_buffer*
%5 = alloca double
%6 = alloca i32
store %struct.packed_buffer* %0, %struct.packed_buffer** %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load %struct.packed_buffer*, %struct.packed_buffer** %4
%8 = load double, double* %5
%9 = load i32, i32* %6
%10 = call i32 @dtou32(double %8, i32 %9)
%11 = call i32 @packed_buffer_append_u32(%struct.packed_buffer* %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.packed_buffer = type { i32 }
define i32 @packed_buffer_append_du32(%struct.packed_buffer* %0, double %1, i32 %2) {
%4 = tail call i32 @dtou32(double %1, i32 %2)
%5 = tail call i32 @packed_buffer_append_u32(%struct.packed_buffer* %0, i32 %4)
ret i32 %5
}