xunge/DecIR huggingface dataset:
void delspace(char *Buf1, char *Buf2) {
  while (*Buf1 != '\0') {
    if ((*Buf1) == 0x20) {
      ++Buf1;
    } else
      *Buf2++ = *Buf1++;
  }
  *Buf2 = '\0';
}


x86 assembly (clang, -O0):
<delspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <delspace+0x64>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    113d <delspace+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    115f <delspace+0x5f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <delspace+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<delspace>:
jmp    1114 <delspace+0x14>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x20,%al
je     1110 <delspace+0x10>
test   %al,%al
je     1127 <delspace+0x27>
mov    %al,(%rsi)
add    $0x1,%rsi
jmp    1110 <delspace+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @delspace(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %12
i8 32, label %9
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
br label %9
9: ; preds = %3, %7
%10 = phi i8* [ %8, %7 ], [ %5, %3 ]
%11 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
12: ; preds = %3
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printNextGreaterElement(int *, int);
int main() {
  int arr[] = {4, 7, 3, 9, 10, 5};
  printNextGreaterElement(arr, 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <printNextGreaterElement@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <printNextGreaterElement@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 4, i32 7, i32 3, i32 9, i32 10, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
store i32 0, i32* %1
%3 = bitcast [6 x i32]* %2 to i8*
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%5 = call i32 @printNextGreaterElement(i32* %4, i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [6 x i32] [i32 4, i32 7, i32 3, i32 9, i32 10, i32 5]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @printNextGreaterElement(i32* %3, i32 6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read(int, unsigned char *, int);
int /*<<< orphan*/ write(int, unsigned char *, int);
int read_mouse_id(int fd) {
  unsigned char c = 0xF2;
  unsigned char id;
  write(fd, &c, 1);
  read(fd, &c, 1);
  if (c != 0xFA) {
    return (-1);
  }
  read(fd, &id, 1);
  return (id);
}


x86 assembly (clang, -O0):
<read_mouse_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movb   $0xf2,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
movzbl -0x9(%rbp),%eax
cmp    $0xfa,%eax
je     116c <read_mouse_id+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <read_mouse_id+0x64>
mov    -0x8(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
movzbl -0xa(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mouse_id>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movb   $0xf2,0x6(%rsp)
lea    0x6(%rsp),%r14
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
mov    $0xffffffff,%eax
cmpb   $0xfa,0x6(%rsp)
jne    116e <read_mouse_id+0x4e>
lea    0x7(%rsp),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1040 <read@plt>
movzbl 0x7(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @read_mouse_id(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %3
store i8 -14, i8* %4
%6 = load i32, i32* %3
%7 = call i32 @write(i32 %6, i8* %4, i32 1)
%8 = load i32, i32* %3
%9 = call i32 @read(i32 %8, i8* %4, i32 1)
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = icmp ne i32 %11, 250
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %19
14: ; preds = %1
%15 = load i32, i32* %3
%16 = call i32 @read(i32 %15, i8* %5, i32 1)
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
store i32 %18, i32* %2
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @read_mouse_id(i32 %0) {
%2 = alloca i8
%3 = alloca i8
store i8 -14, i8* %2
%4 = call i32 @write(i32 %0, i8* %2, i32 1)
%5 = call i32 @read(i32 %0, i8* %2, i32 1)
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, -6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @read(i32 %0, i8* %3, i32 1)
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
br label %12
12: ; preds = %1, %8
%13 = phi i32 [ %11, %8 ], [ -1, %1 ]
ret i32 %13
}
void simple_object_set_little_16(unsigned char *buf, unsigned short val) {
  buf[1] = (val >> 8) & 0xff;
  buf[0] = val & 0xff;
}


x86 assembly (clang, -O0):
<simple_object_set_little_16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_object_set_little_16>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @simple_object_set_little_16(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %9, i8* %11
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @simple_object_set_little_16(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %5
%6 = trunc i16 %1 to i8
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
double exp(double);
double Bbp1a(double x) { return x / (exp(x) - 1.0); }


x86 assembly (clang, -O0):
<Bbp1a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bbp1a>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <exp@plt>
addsd  0xedd(%rip),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Bbp1a(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @exp(double %4)
%6 = fsub double %5, 1.000000e+00
%7 = fdiv double %3, %6
ret double %7
}

LLVM IR (-O2):
define double @Bbp1a(double %0) {
%2 = tail call double @exp(double %0)
%3 = fadd double %2, -1.000000e+00
%4 = fdiv double %0, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ afficherInventaire();
int /*<<< orphan*/ appuyezEntree(char *);
void ouvrirInventaire(void) {
  afficherInventaire();
  appuyezEntree("\nAppuyez sur ENTREE pour revenir au jeu");
}


x86 assembly (clang, -O0):
<ouvrirInventaire>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <afficherInventaire@plt>
lea    0xece(%rip),%rdi
call   1040 <appuyezEntree@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ouvrirInventaire>:
push   %rax
xor    %eax,%eax
call   1030 <afficherInventaire@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <appuyezEntree@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0AAppuyez sur ENTREE pour revenir au jeu\00"
define void @ouvrirInventaire() {
%1 = call i32 (...) @afficherInventaire()
%2 = call i32 @appuyezEntree(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0AAppuyez sur ENTREE pour revenir au jeu\00"
define void @ouvrirInventaire() {
%1 = tail call i32 (...) @afficherInventaire()
%2 = tail call i32 @appuyezEntree(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  int s = 0;
  while (a >= 1) {
    a = a / 10;
    s++;
  }
  printf("%d\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     116c <main+0x4c>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
mov    -0xc(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %esi,%esi
test   %eax,%eax
jle    1168 <main+0x48>
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%edx
mov    %eax,%eax
imul   %rcx,%rax
shr    $0x23,%rax
add    $0x1,%esi
cmp    $0x9,%edx
ja     1150 <main+0x30>
mov    %eax,0x4(%rsp)
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 10
store i32 %10, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %5
13: ; preds = %5
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ 0, %0 ]
%8 = phi i32 [ %9, %6 ], [ %4, %0 ]
%9 = udiv i32 %8, 10
%10 = add nuw nsw i32 %7, 1
%11 = icmp ult i32 %8, 10
br i1 %11, label %12, label %6
12: ; preds = %6
store i32 %9, i32* %1
br label %13
13: ; preds = %12, %0
%14 = phi i32 [ %10, %12 ], [ 0, %0 ]
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printX(char *);
int main() {
  printX("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/bartoszbielawski/preload-example/refs/"
         "heads/master/main.c");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printX@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bartoszbielawski/preload-example/refs/heads/master/main.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printX(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bartoszbielawski/preload-example/refs/heads/master/main.c\00"
define i32 @main() {
%1 = tail call i32 @printX(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int strcmp(const char *s1, const char *s2) {
  asm("xor   %rcx, %rcx\r\n"
      ".Loop_strcmp:\r\n"
      "cmpb 	$0x00, (%rdi, %rcx, 1)\r\n"
      "je 	.Loop_strcmp_end\r\n"
      "movb 	(%rdi, %rcx, 1), %al\r\n"
      "movb	(%rsi, %rcx, 1), %dl\r\n"
      "cmpb 	%al, %dl\r\n"
      "jg 	.Lgreater\r\n"
      "jl 	.Lesser\r\n"
      "inc 	%rcx\r\n"
      "cmpb  	$0x00, (%rsi, %rcx, 1)\r\n"
      "je 	.Loop_strcmp_end\r\n"
      "jmp 	.Loop_strcmp\r\n"
      ".Loop_strcmp_end:\r\n"
      "mov 	$0x00, %rax\r\n"
      "jmp 	.Lstrcmp_end\r\n"
      ".Lgreater:\r\n"
      "mov 	$0x01, %rax\r\n"
      "jmp 	.Lstrcmp_end \r\n"
      ".Lesser:\r\n"
      "mov 	$-0x01, %rax\r\n"
      "jmp 	.Lstrcmp_end\r\n"
      ".Lstrcmp_end:\r\n");
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %rcx,%rcx
cmpb   $0x0,(%rdi,%rcx,1)
je     113f <strcmp+0x3f>
mov    (%rdi,%rcx,1),%al
mov    (%rsi,%rcx,1),%dl
cmp    %al,%dl
jg     114b <strcmp+0x4b>
jl     1157 <strcmp+0x57>
inc    %rcx
cmpb   $0x0,(%rsi,%rcx,1)
je     113f <strcmp+0x3f>
jmp    110f <strcmp+0xf>
mov    $0x0,%rax
jmp    1163 <strcmp+0x63>
mov    $0x1,%rax
jmp    1163 <strcmp+0x63>
mov    $0xffffffffffffffff,%rax
jmp    1163 <strcmp+0x63>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %rcx,%rcx
cmpb   $0x0,(%rdi,%rcx,1)
je     1120 <strcmp+0x20>
mov    (%rdi,%rcx,1),%al
mov    (%rsi,%rcx,1),%dl
cmp    %al,%dl
jg     1129 <strcmp+0x29>
jl     1132 <strcmp+0x32>
inc    %rcx
cmpb   $0x0,(%rsi,%rcx,1)
je     1120 <strcmp+0x20>
jmp    1103 <strcmp+0x3>
mov    $0x0,%rax
jmp    113b <strcmp+0x3b>
mov    $0x1,%rax
jmp    113b <strcmp+0x3b>
mov    $0xffffffffffffffff,%rax
jmp    113b <strcmp+0x3b>
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
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
tail call void asm sideeffect "xor %rcx, %rcx\0D\0A.Loop_strcmp:\0D\0Acmpb \09$$0x00, (%rdi, %rcx, 1)\0D\0Aje \09.Loop_strcmp_end\0D\0Amovb \09(%rdi, %rcx, 1), %al\0D\0Amovb\09(%rsi, %rcx, 1), %dl\0D\0Acmpb \09%al, %dl\0D\0Ajg \09.Lgreater\0D\0Ajl \09.Lesser\0D\0Ainc \09%rcx\0D\0Acmpb \09$$0x00, (%rsi, %rcx, 1)\0D\0Aje \09.Loop_strcmp_end\0D\0Ajmp \09.Loop_strcmp\0D\0A.Loop_strcmp_end:\0D\0Amov \09$$0x00, %rax\0D\0Ajmp \09.Lstrcmp_end\0D\0A.Lgreater:\0D\0Amov \09$$0x01, %rax\0D\0Ajmp \09.Lstrcmp_end \0D\0A.Lesser:\0D\0Amov \09$$-0x01, %rax\0D\0Ajmp \09.Lstrcmp_end\0D\0A.Lstrcmp_end:\0D\0A", "~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strjoin(char *a, char *b) {
  char *res = malloc(strlen(a) + strlen(b) + 1);
  if (res) {
    strcpy(res, a);
    strcat(res, b);
  }
  return res;
}


x86 assembly (clang, -O0):
<strjoin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     119f <strjoin+0x5f>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strjoin>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1186 <strjoin+0x46>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strjoin(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %22
15: ; preds = %2
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %5
%20 = load i8*, i8** %4
%21 = call i32 @strcat(i8* %19, i8* %20)
br label %22
22: ; preds = %15, %2
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define i8* @strjoin(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
%11 = tail call i32 @strcat(i8* %7, i8* %1)
br label %12
12: ; preds = %9, %2
ret i8* %7
}
/* Type definitions */
struct cube {
  int dummy;
};

/* Variables and functions */
void *find_index(struct cube *, int, short *, short *, short *, short *);
void *get_index(struct cube *cube, int index) {
  short w, x, y, z;
  return find_index(cube, index, &w, &x, &y, &z);
}


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0xe(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x12(%rbp),%r8
lea    -0x14(%rbp),%r9
call   1030 <find_index@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
push   %rax
lea    0x6(%rsp),%rdx
lea    0x4(%rsp),%rcx
lea    0x2(%rsp),%r8
mov    %rsp,%r9
call   1030 <find_index@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.cube = type { i32 }
define i8* @get_index(%struct.cube* %0, i32 %1) {
%3 = alloca %struct.cube*
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store %struct.cube* %0, %struct.cube** %3
store i32 %1, i32* %4
%9 = load %struct.cube*, %struct.cube** %3
%10 = load i32, i32* %4
%11 = call i8* @find_index(%struct.cube* %9, i32 %10, i16* %5, i16* %6, i16* %7, i16* %8)
ret i8* %11
}

LLVM IR (-O2):
%struct.cube = type { i32 }
define i8* @get_index(%struct.cube* %0, i32 %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
%7 = bitcast i16* %3 to i8*
%8 = bitcast i16* %4 to i8*
%9 = bitcast i16* %5 to i8*
%10 = bitcast i16* %6 to i8*
%11 = call i8* @find_index(%struct.cube* %0, i32 %1, i16* %3, i16* %4, i16* %5, i16* %6)
ret i8* %11
}
/* Variables and functions */
int strlen(char *);
int sMin(char *opt) {
  int l = strlen(opt) - 12;
  return l;
}


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

x86 assembly (clang, -O2):
<sMin>:
push   %rax
call   1030 <strlen@plt>
add    $0xfffffff4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sMin(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 12
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @sMin(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -12
ret i32 %3
}
void programming() {}


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

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

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

LLVM IR (-O2):
define void @programming() {
ret void
}
/* Variables and functions */
size_t max_size_t(size_t a, size_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max_size_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <max_size_t+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max_size_t+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_size_t>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max_size_t(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 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max_size_t(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
void *__memset(void *, char, size_t);
void *__constant_c_memset(void *dest, char c, size_t n) {
  return __memset(dest, c, n);
}


x86 assembly (clang, -O0):
<__constant_c_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rdx
movsbl %al,%esi
call   1030 <__memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__constant_c_memset>:
jmp    1030 <__memset@plt>

LLVM IR (-O0):
define i8* @__constant_c_memset(i8* %0, i8 signext %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 = load i64, i64* %6
%10 = call i8* @__memset(i8* %7, i8 signext %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @__constant_c_memset(i8* %0, i8 signext %1, i64 %2) {
%4 = tail call i8* @__memset(i8* %0, i8 signext %1, i64 %2)
ret i8* %4
}
double f4_cb_send_long(double (*cb)(long)) {
  long r = 33;
  return cb(r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x21,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_long>:
push   %rax
mov    %rdi,%rax
mov    $0x21,%edi
call   *%rax
addsd  0xeed(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_long(double (i64)* %0) {
%2 = alloca double (i64)*
%3 = alloca i64
store double (i64)* %0, double (i64)** %2
store i64 33, i64* %3
%4 = load double (i64)*, double (i64)** %2
%5 = load i64, i64* %3
%6 = call double %4(i64 %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_long(double (i64)* nocapture %0) {
%2 = tail call double %0(i64 33)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Type definitions */
struct roff_node {
  int dummy;
};
struct roff_meta {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ font_pop();
void post_font(const struct roff_meta *meta, struct roff_node *n) {
  font_pop();
}


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

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

LLVM IR (-O0):
%struct.roff_meta = type { i32 }
%struct.roff_node = type { i32 }
define void @post_font(%struct.roff_meta* %0, %struct.roff_node* %1) {
%3 = alloca %struct.roff_meta*
%4 = alloca %struct.roff_node*
store %struct.roff_meta* %0, %struct.roff_meta** %3
store %struct.roff_node* %1, %struct.roff_node** %4
%5 = call i32 (...) @font_pop()
ret void
}

LLVM IR (-O2):
%struct.roff_meta = type { i32 }
%struct.roff_node = type { i32 }
define void @post_font(%struct.roff_meta* nocapture readnone %0, %struct.roff_node* nocapture readnone %1) {
%3 = tail call i32 (...) @font_pop()
ret void
}
float graddotp3(float gx, float gy, float gz, float x, float y, float z) {
  return gx * x + gy * y + gz * z;
}


x86 assembly (clang, -O0):
<graddotp3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x8(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<graddotp3>:
mulss  %xmm4,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm5,%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @graddotp3(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %7
%14 = load float, float* %10
%15 = load float, float* %8
%16 = load float, float* %11
%17 = fmul float %15, %16
%18 = call float @llvm.fmuladd.f32(float %13, float %14, float %17)
%19 = load float, float* %9
%20 = load float, float* %12
%21 = call float @llvm.fmuladd.f32(float %19, float %20, float %18)
ret float %21
}

LLVM IR (-O2):
define float @graddotp3(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fmul float %1, %4
%8 = tail call float @llvm.fmuladd.f32(float %0, float %3, float %7)
%9 = tail call float @llvm.fmuladd.f32(float %2, float %5, float %8)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test1() { printf("call lib test1\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"call lib test1\00"
define void @test1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_env();
int main(void) {
  test_env();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_env@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_env()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GMP_RNDU;
int /*<<< orphan*/ mpfr_set_default_rounding_mode(int /*<<< orphan*/);
double sqrt(double);
double sqrt_hi(double x) {
  if (x == 0)
    return (0.0);
  mpfr_set_default_rounding_mode(GMP_RNDU);
  ;
  return (sqrt(x));
}


x86 assembly (clang, -O0):
<sqrt_hi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1152 <sqrt_hi+0x32>
jp     1152 <sqrt_hi+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116f <sqrt_hi+0x4f>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_hi>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1131 <sqrt_hi+0x11>
jp     1131 <sqrt_hi+0x11>
ret
push   %rax
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
movsd  %xmm1,(%rsp)
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
lea    0x8(%rsp),%rsp
jb     115e <sqrt_hi+0x3e>
sqrtsd %xmm0,%xmm0
ret
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
@GMP_RNDU = global i32 0
define double @sqrt_hi(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* @GMP_RNDU
%9 = call i32 @mpfr_set_default_rounding_mode(i32 %8)
%10 = load double, double* %3
%11 = call double @sqrt(double %10)
store double %11, double* %2
br label %12
12: ; preds = %7, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
@GMP_RNDU = global i32 0
define double @sqrt_hi(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @GMP_RNDU
%5 = tail call i32 @mpfr_set_default_rounding_mode(i32 %4)
%6 = tail call double @sqrt(double %0)
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 0.000000e+00, %1 ]
ret double %8
}
void foo7c() {}


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

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

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

LLVM IR (-O2):
define void @foo7c() {
ret void
}
int RTW_STATUS_CODE(int error_code) {
  if (error_code >= 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<RTW_STATUS_CODE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111d <RTW_STATUS_CODE+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <RTW_STATUS_CODE+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTW_STATUS_CODE>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @RTW_STATUS_CODE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @RTW_STATUS_CODE(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Variables and functions */
double log(double);
double Double_log(double x) { return log(x); }


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

x86 assembly (clang, -O2):
<Double_log>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define double @Double_log(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
void clnttcp_abort(void) {}


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

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

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

LLVM IR (-O2):
define void @clnttcp_abort() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ GPIOBaseValid(unsigned long);
void GPIOADCTriggerEnable(unsigned long ulPort, unsigned char ucPins) {
  DEBUG_ASSERT(GPIOBaseValid(ulPort));
  (*((volatile unsigned long *)(ulPort + 0x00000530))) |= ucPins;
}


x86 assembly (clang, -O0):
<GPIOADCTriggerEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <GPIOBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
movzbl -0x9(%rbp),%eax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    0x530(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x530(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOADCTriggerEnable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <GPIOBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    %ebp,%eax
or     %rax,0x530(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @GPIOADCTriggerEnable(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = call i32 @GPIOBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i8, i8* %4
%9 = zext i8 %8 to i64
%10 = load i64, i64* %3
%11 = add i64 %10, 1328
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @GPIOADCTriggerEnable(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIOBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = zext i8 %1 to i64
%6 = add i64 %0, 1328
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
/* Variables and functions */
double findMedianSortedArrays(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  int a[] = {1, 2, 3};
  int b[] = {2, 3, 4};
  double xxx = findMedianSortedArrays(a, 3, b, 3);
  printf("%f\n", xxx);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec0(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x28(%rbp),%rdx
mov    $0x3,%ecx
mov    %ecx,%esi
call   1040 <findMedianSortedArrays@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x20(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x18(%rsp)
mov    0xed4(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xec1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rdx
mov    $0x3,%esi
mov    $0x3,%ecx
call   1040 <findMedianSortedArrays@plt>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.b = [3 x i32] [i32 2, i32 3, i32 4]
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [3 x i32]
%6 = alloca [3 x i32]
%7 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = bitcast [3 x i32]* %5 to i8*
%9 = bitcast [3 x i32]* %6 to i8*
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%12 = call double @findMedianSortedArrays(i32* %10, i32 3, i32* %11, i32 3)
store double %12, double* %7
%13 = load double, double* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.b = [3 x i32] [i32 2, i32 3, i32 4]
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = bitcast [3 x i32]* %3 to i8*
%6 = bitcast [3 x i32]* %4 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%9 = call double @findMedianSortedArrays(i32* %7, i32 3, i32* %8, i32 3)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}
/* Variables and functions */
size_t strlen(const char *strSrc) {
  unsigned int count = 0;
  for (; *(strSrc + count) != '\0'; count++)
    ;
  return count;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    1128 <strlen+0x28>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = zext i32 %3 to i64
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void ick_lose(const char *m, int n, const char *s) {
  (void)m;
  (void)n;
  (void)s;
  abort();
}


x86 assembly (clang, -O0):
<ick_lose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<ick_lose>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @ick_lose(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** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @ick_lose(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
double tanh(double);
double tanh_fp(double x) {
  double fx = tanh(x);
  return 1 - (fx * fx);
}


x86 assembly (clang, -O0):
<tanh_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanh_fp>:
push   %rax
call   1030 <tanh@plt>
mulsd  %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tanh_fp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @tanh(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fneg double %6
%9 = call double @llvm.fmuladd.f64(double %8, double %7, double 1.000000e+00)
ret double %9
}

LLVM IR (-O2):
define double @tanh_fp(double %0) {
%2 = tail call double @tanh(double %0)
%3 = fneg double %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 1.000000e+00)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerCapComP__4__Control__disableEvents();
void GpioCaptureC__0__Msp430TimerControl__disableEvents(void) {
  Msp430TimerCapComP__4__Control__disableEvents();
}


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

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

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

LLVM IR (-O2):
define void @GpioCaptureC__0__Msp430TimerControl__disableEvents() {
%1 = tail call i32 (...) @Msp430TimerCapComP__4__Control__disableEvents()
ret void
}
/* Variables and functions */
scalar_t__ foo();
scalar_t__ foo2();
int main() {
  int i = 0;
  int sum = 0;
  for (i = 5; i < 50; i++) {
    sum += foo();
    sum += foo2();
  }
  return sum / 11;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    1184 <main+0x64>
mov    $0x0,%al
call   1040 <foo@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <foo2@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
mov    -0xc(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x2d,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <foo@plt>
mov    %rax,%r14
add    %ebx,%r14d
xor    %eax,%eax
call   1030 <foo2@plt>
mov    %rax,%rbx
add    %r14d,%ebx
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
movslq %ebx,%rax
imul   $0x2e8ba2e9,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 5, i32* %2
br label %4
4: ; preds = %18, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 50
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = call i64 (...) @foo()
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %3
%13 = call i64 (...) @foo2()
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %3
br label %18
18: ; preds = %7
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %4
21: ; preds = %4
%22 = load i32, i32* %3
%23 = sdiv i32 %22, 11
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = phi i32 [ 5, %0 ], [ %10, %1 ]
%4 = tail call i64 (...) @foo()
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
%7 = tail call i64 (...) @foo2()
%8 = trunc i64 %7 to i32
%9 = add i32 %6, %8
%10 = add nuw nsw i32 %3, 1
%11 = icmp eq i32 %10, 50
br i1 %11, label %12, label %1
12: ; preds = %1
%13 = sdiv i32 %9, 11
ret i32 %13
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int c = __VERIFIER_nondet_int();
  if (c < 2) {
    return 0;
  }
  while (x + c >= 0) {
    x = x - c;
    c = c + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1149 <main+0x39>
movl   $0x0,-0x4(%rbp)
jmp    117b <main+0x6b>
jmp    114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x0,%eax
jl     1174 <main+0x64>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114e <main+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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