xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ endl();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void pausar(void) {
  getchar();
  printf("Presione una tecla para continuar . . .");
  endl();
  getchar();
}


x86 assembly (clang, -O0):
<pausar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <endl@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pausar>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <endl@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Presione una tecla para continuar . . .\00"
define void @pausar() {
%1 = call i32 (...) @getchar()
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @endl()
%4 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Presione una tecla para continuar . . .\00"
define void @pausar() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @endl()
%4 = tail call i32 (...) @getchar()
ret void
}
char isquote(char c) {
  if (c == '\"')
    return '\"';
  else if (c == '\'')
    return '\'';
  else
    return 0;
}


x86 assembly (clang, -O0):
<isquote>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x22,%eax
jne    1120 <isquote+0x20>
movb   $0x22,-0x1(%rbp)
jmp    113a <isquote+0x3a>
movsbl -0x2(%rbp),%eax
cmp    $0x27,%eax
jne    1136 <isquote+0x36>
movb   $0x27,-0x1(%rbp)
jmp    113a <isquote+0x3a>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isquote>:
xor    %eax,%eax
cmp    $0x27,%dil
mov    $0x27,%ecx
cmovne %eax,%ecx
cmp    $0x22,%dil
mov    $0x22,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @isquote(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 34
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 34, i8* %2
br label %14
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 39
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 39, i8* %2
br label %14
13: ; preds = %8
store i8 0, i8* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @isquote(i8 signext %0) {
%2 = icmp eq i8 %0, 39
%3 = select i1 %2, i8 39, i8 0
%4 = icmp eq i8 %0, 34
%5 = select i1 %4, i8 34, i8 %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
void write_integer_(int *z, int *fd) { write(*fd, z, sizeof(int)); }


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

x86 assembly (clang, -O2):
<write_integer_>:
mov    %rdi,%rax
mov    (%rsi),%edi
mov    %rax,%rsi
mov    $0x4,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @write_integer_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @write(i32 %3, i32* %0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello world");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ shutdown(int, char *, int);
int get(FILE *stream) {
  int value;
  rewind(stream);
  if (fscanf(stream, "%d", &value) != 1)
    shutdown(4, "Error reading /proc entry", 120 - 1);
  return value;
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rewind@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     1178 <get+0x48>
mov    $0x4,%edi
lea    0xe95(%rip),%rsi
mov    $0x77,%edx
call   1030 <shutdown@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <rewind@plt>
lea    0xebc(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     116c <get+0x3c>
lea    0xea6(%rip),%rsi
mov    $0x4,%edi
mov    $0x77,%edx
call   1030 <shutdown@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [26 x i8] c"Error reading /proc entry\00"
define i32 @get(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @rewind(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @shutdown(i32 4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 119)
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [26 x i8] c"Error reading /proc entry\00"
define i32 @get(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @rewind(i32* %0)
%5 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = icmp eq i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @shutdown(i32 4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 119)
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ print_tri(int *, int, int, int);
void swap(int *ptr, int i, int j, int len) {
  int tmp = ptr[i];
  ptr[i] = ptr[j];
  ptr[j] = tmp;
  print_tri(ptr, len, i, j);
  return;
}


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

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%esi
movslq %edx,%r8
mov    (%rdi,%r8,4),%edx
mov    %edx,(%rdi,%rax,4)
mov    %esi,(%rdi,%r8,4)
mov    %ecx,%esi
mov    %eax,%edx
mov    %r8d,%ecx
jmp    1030 <print_tri@plt>

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %9
%15 = load i32*, i32** %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32*, i32** %5
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 %19, i32* %23
%24 = load i32, i32* %9
%25 = load i32*, i32** %5
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
store i32 %24, i32* %28
%29 = load i32*, i32** %5
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = call i32 @print_tri(i32* %29, i32 %30, i32 %31, i32 %32)
ret void
}

LLVM IR (-O2):
define void @swap(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
store i32 %10, i32* %6
store i32 %7, i32* %9
%11 = tail call i32 @print_tri(i32* %0, i32 %3, i32 %1, i32 %2)
ret void
}
char *strreplacechar(char *str, char oldc, char newc) {
  char *s;
  s = str;
  while (*s) {
    if (*s == oldc)
      *s = newc;
    s++;
  }
  return s;
}


x86 assembly (clang, -O0):
<strreplacechar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <strreplacechar+0x55>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <strreplacechar+0x44>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <strreplacechar+0x1b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strreplacechar>:
mov    %rdi,%rax
mov    (%rdi),%cl
jmp    1118 <strreplacechar+0x18>
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1125 <strreplacechar+0x25>
cmp    %sil,%cl
jne    1110 <strreplacechar+0x10>
mov    %dl,(%rax)
jmp    1110 <strreplacechar+0x10>
ret

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

LLVM IR (-O2):
define i8* @strreplacechar(i8* %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
%16 = phi i8* [ %0, %3 ], [ %12, %11 ]
ret i8* %16
}
/* Variables and functions */
int ENXIO;
int pm8921_usb_ovp_disable(int disable) { return -ENXIO; }


x86 assembly (clang, -O0):
<pm8921_usb_ovp_disable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ed0(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_usb_ovp_disable>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @pm8921_usb_ovp_disable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENXIO
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8921_usb_ovp_disable(i32 %0) {
%2 = load i32, i32* @ENXIO
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ stable_grail_common_sort(int **, int, int **, int);
void stable_grail_sort_fixed_buffer(int **arr, int Len) {
  int *ExtBuf[512];
  stable_grail_common_sort(arr, Len, ExtBuf, 512);
}


x86 assembly (clang, -O0):
<stable_grail_sort_fixed_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x1010(%rbp),%rdx
mov    $0x200,%ecx
call   1030 <stable_grail_common_sort@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stable_grail_sort_fixed_buffer>:
sub    $0x1008,%rsp
mov    %rsp,%rdx
mov    $0x200,%ecx
call   1030 <stable_grail_common_sort@plt>
add    $0x1008,%rsp
ret

LLVM IR (-O0):
define void @stable_grail_sort_fixed_buffer(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca [512 x i32*]
store i32** %0, i32*** %3
store i32 %1, i32* %4
%6 = load i32**, i32*** %3
%7 = load i32, i32* %4
%8 = getelementptr inbounds [512 x i32*], [512 x i32*]* %5, i64 0, i64 0
%9 = call i32 @stable_grail_common_sort(i32** %6, i32 %7, i32** %8, i32 512)
ret void
}

LLVM IR (-O2):
define void @stable_grail_sort_fixed_buffer(i32** %0, i32 %1) {
%3 = alloca [512 x i32*]
%4 = bitcast [512 x i32*]* %3 to i8*
%5 = getelementptr inbounds [512 x i32*], [512 x i32*]* %3, i64 0, i64 0
%6 = call i32 @stable_grail_common_sort(i32** %0, i32 %1, i32** %5, i32 512)
ret void
}
int d_le_rm1(double a1, double *a2) { return (((a1) <= (*a2))); }


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

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

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

LLVM IR (-O2):
define i32 @d_le_rm1(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp oge double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strntrim(char *, int /*<<< orphan*/);
char *strtrim(char *str) {
  strntrim(str, strlen(str));
  return (str);
}


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

x86 assembly (clang, -O2):
<strtrim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <strntrim@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strtrim(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @strntrim(i8* %0, i32 %2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_11058() {
  Assert_real((isqrt(11058) == 105),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1510, ("Integer square root of 11058 should be 105"));
}


x86 assembly (clang, -O0):
<t_sqrt_11058>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b32,%edi
call   1030 <isqrt@plt>
cmp    $0x69,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x5e6,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_11058>:
push   %rax
mov    $0x2b32,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x69,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x5e6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 11058 should be 105\00"
define void @t_sqrt_11058() {
%1 = call i32 @isqrt(i32 11058)
%2 = icmp eq i32 %1, 105
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1510, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 11058 should be 105\00"
define void @t_sqrt_11058() {
%1 = tail call i32 @isqrt(i32 11058)
%2 = icmp eq i32 %1, 105
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1510, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
unsigned svz_hash_key_length(char *key) {
  unsigned len = 0;
  assert(key);
  while (*key++)
    len++;
  len++;
  return len;
}


x86 assembly (clang, -O0):
<svz_hash_key_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1152 <svz_hash_key_length+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <svz_hash_key_length+0x1c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svz_hash_key_length>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
cmpb   $0x0,(%rbx)
je     113c <svz_hash_key_length+0x2c>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x0,(%rbx,%rax,1)
lea    0x1(%rax),%rax
jne    1130 <svz_hash_key_length+0x20>
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @svz_hash_key_length(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 1, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add i32 %6, 1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ my_error_msg(char *, char *);
int sem_wait(int /*<<< orphan*/ *);
void my_sem_wait(sem_t *semi, char *errormsg) {
  if (sem_wait(semi) == -1) {
    my_error_msg("semwait", errormsg);
  }
}


x86 assembly (clang, -O0):
<my_sem_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sem_wait@plt>
cmp    $0xffffffff,%eax
jne    1152 <my_sem_wait+0x32>
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <my_error_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sem_wait>:
push   %rbx
mov    %rsi,%rbx
call   1040 <sem_wait@plt>
cmp    $0xffffffff,%eax
je     1130 <my_sem_wait+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <my_error_msg@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"semwait\00"
define void @my_sem_wait(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 @sem_wait(i32* %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @my_error_msg(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"semwait\00"
define void @my_sem_wait(i32* %0, i8* %1) {
%3 = tail call i32 @sem_wait(i32* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @my_error_msg(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_push_hl(void) { op_write1(0xe5); }


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

x86 assembly (clang, -O2):
<op_enc_push_hl>:
mov    $0xe5,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_push_hl() {
%1 = call i32 @op_write1(i32 229)
ret void
}

LLVM IR (-O2):
define void @op_enc_push_hl() {
%1 = tail call i32 @op_write1(i32 229)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XFocusChangeEvent;

/* Variables and functions */
unsigned long get_XFocusChangeEvent_window(void *_p) {
  return (unsigned long)((XFocusChangeEvent *)_p)->window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XFocusChangeEvent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XFocusChangeEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
execv(name, args) char *name;
char **args;
{
  extern char **environ;
  execve(name, args, environ);
}


x86 assembly (clang, -O0):
<execv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2eb9(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1030 <execve@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execv>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rdx
xor    %eax,%eax
jmp    1030 <execve@plt>

LLVM IR (-O0):
@environ = external global i8**
define i32 @execv(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 i8*, i8** %4
%7 = load i8**, i8*** %5
%8 = load i8**, i8*** @environ
%9 = call i32 (i8*, i8**, i8**, ...) bitcast (i32 (...)* @execve to i32 (i8*, i8**, i8**, ...)*)(i8* %6, i8** %7, i8** %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@environ = external global i8**
define i32 @execv(i8* %0, i8** %1) {
%3 = load i8**, i8*** @environ
%4 = tail call i32 (i8*, i8**, i8**, ...) bitcast (i32 (...)* @execve to i32 (i8*, i8**, i8**, ...)*)(i8* %0, i8** %1, i8** %3)
ret i32 undef
}
/* Variables and functions */
int myfunc(int);
int myfunc2(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int input;
  scanf("%d", &input);
  printf("%d\n", input);
  printf("%p\n", myfunc(input));
  printf("%d\n", myfunc2(input));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <myfunc@plt>
mov    %eax,%esi
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1030 <myfunc2@plt>
mov    %eax,%esi
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0xea2(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%edi
call   1050 <myfunc@plt>
lea    0xe8e(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0xc(%rsp),%edi
call   1030 <myfunc2@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @myfunc(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = call i32 @myfunc2(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
void ajMemExit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ajMemExit() {
ret void
}
void fb_throw(unsigned long maxlen, void (*f)(void *, unsigned long)) {}


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

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

LLVM IR (-O0):
define void @fb_throw(i64 %0, void (i8*, i64)* %1) {
%3 = alloca i64
%4 = alloca void (i8*, i64)*
store i64 %0, i64* %3
store void (i8*, i64)* %1, void (i8*, i64)** %4
ret void
}

LLVM IR (-O2):
define void @fb_throw(i64 %0, void (i8*, i64)* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_read_clock_offset_complete_get_status(const uint8_t *event) {
  return event[2];
}


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

x86 assembly (clang, -O2):
<hci_event_read_clock_offset_complete_get_status>:
mov    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hci_event_read_clock_offset_complete_get_status(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_read_clock_offset_complete_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
void omp_smoosh() {}


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

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

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

LLVM IR (-O2):
define void @omp_smoosh() {
ret void
}
int *func() {
  int x = 10;
  int *ptr = &x;
  return ptr;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @func() {
%1 = alloca i32
ret i32* %1
}
void WT_WRITE_BARRIER(void) { return; }


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

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

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

LLVM IR (-O2):
define void @WT_WRITE_BARRIER() {
ret void
}
/* Variables and functions */
int read(int, char *, unsigned int);
int TCPrecv(int fd, char *str, unsigned int len) {
  char *ptr = str;
  int nread;
  nread = read(fd, ptr, len);
  if (nread == -1)
    return -1;
  else if (nread == 0)
    return -2;
  return nread;
}


x86 assembly (clang, -O0):
<TCPrecv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    1152 <TCPrecv+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <TCPrecv+0x63>
cmpl   $0x0,-0x24(%rbp)
jne    1168 <TCPrecv+0x58>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1173 <TCPrecv+0x63>
jmp    116d <TCPrecv+0x5d>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TCPrecv>:
push   %rax
call   1030 <read@plt>
test   %eax,%eax
mov    $0xfffffffe,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @TCPrecv(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -2, i32 %4
ret i32 %6
}
__attribute__((no, noclone)) void foo(char *p) {
  asm volatile("" : : "r"(p) : "memory");
}


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

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

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

LLVM IR (-O2):
define void @foo(i8* %0) {
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fdsignal1(int);
int tasksignalfd(int fd) {
  fdsignal1(fd);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @tasksignalfd(i32 %0) {
%2 = tail call i32 @fdsignal1(i32 %0)
ret i32 0
}
/* Variables and functions */
scalar_t__ palindrome(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *s;
  scanf("%s", s);
  if (palindrome(s))
    printf("Is a Palindrome\n");
  else
    printf("Is not a palindrome\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <palindrome@plt>
cmp    $0x0,%rax
je     1173 <main+0x43>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <main+0x4f>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <scanf@plt>
call   1040 <palindrome@plt>
test   %rax,%rax
lea    0xeb7(%rip),%rax
lea    0xec4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [17 x i8] c"Is a Palindrome\0A\00"
@.str.2 = [21 x i8] c"Is not a palindrome\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = load i8*, i8** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @palindrome(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@str = [20 x i8] c"Is not a palindrome\00"
@str.3 = [16 x i8] c"Is a Palindrome\00"
define i32 @main() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* undef)
%2 = tail call i64 @palindrome(i8* undef)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
/* Variables and functions */
unsigned short NumberOnly();
int /*<<< orphan*/ WriteInstruction(char *);
int /*<<< orphan*/ WriteNumber(unsigned short);
void CR_FillUp(void) {
  unsigned short int nNum = NumberOnly();
  WriteInstruction("ld b,");
  WriteNumber(nNum);
  WriteInstruction("call fillu");
}


x86 assembly (clang, -O0):
<CR_FillUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <NumberOnly@plt>
mov    %ax,-0x2(%rbp)
lea    0xeb6(%rip),%rdi
call   1040 <WriteInstruction@plt>
movzwl -0x2(%rbp),%edi
call   1030 <WriteNumber@plt>
lea    0xea7(%rip),%rdi
call   1040 <WriteInstruction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_FillUp>:
push   %rbx
xor    %eax,%eax
call   1050 <NumberOnly@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
call   1040 <WriteInstruction@plt>
movzwl %bx,%edi
call   1030 <WriteNumber@plt>
lea    0xeb1(%rip),%rdi
pop    %rbx
jmp    1040 <WriteInstruction@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ld b,\00"
@.str.1 = [11 x i8] c"call fillu\00"
define void @CR_FillUp() {
%1 = alloca i16
%2 = call zeroext i16 (...) @NumberOnly()
store i16 %2, i16* %1
%3 = call i32 @WriteInstruction(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i16, i16* %1
%5 = call i32 @WriteNumber(i16 zeroext %4)
%6 = call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ld b,\00"
@.str.1 = [11 x i8] c"call fillu\00"
define void @CR_FillUp() {
%1 = tail call zeroext i16 (...) @NumberOnly()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @WriteNumber(i16 zeroext %1)
%4 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int SSL_accept(int /*<<< orphan*/ *);
scalar_t__ waitforit(int /*<<< orphan*/ *);
int do_accept(SSL *ssl) {
  int ret;
again:
  ret = SSL_accept(ssl);
  if (ret < 0) {
    if (waitforit(ssl)) {
      goto again;
    } else {
      return -1;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<do_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <SSL_accept@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1166 <do_accept+0x46>
mov    -0x10(%rbp),%rdi
call   1030 <waitforit@plt>
cmp    $0x0,%rax
je     115a <do_accept+0x3a>
jmp    112c <do_accept+0xc>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <do_accept+0x4c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_accept>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <SSL_accept@plt>
test   %eax,%eax
jns    114e <do_accept+0x2e>
mov    %rbx,%rdi
call   1030 <waitforit@plt>
test   %rax,%rax
jne    1130 <do_accept+0x10>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @do_accept(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
br label %5
5: ; preds = %14, %1
%6 = load i32*, i32** %3
%7 = call i32 @SSL_accept(i32* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i32*, i32** %3
%12 = call i64 @waitforit(i32* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
br label %5
15: ; preds = %10
store i32 -1, i32* %2
br label %18
16: ; preds = %5
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %15
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @do_accept(i32* %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @SSL_accept(i32* %0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i64 @waitforit(i32* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2, %5
%9 = phi i32 [ -1, %5 ], [ %3, %2 ]
ret i32 %9
}
void OnFatalException(void) {}


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

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

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

LLVM IR (-O2):
define void @OnFatalException() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bsd_ntohl(uint32_t a) {
  return (((uint32_t)((((((uint32_t)a) & 0xff) << 24) |
                       (((((uint32_t)a) >> 8) & 0xff) << 16) |
                       (((((uint32_t)a) >> 16) & 0xff) << 8) |
                       (((((uint32_t)a) >> 24) & 0xff))))));
}


x86 assembly (clang, -O0):
<bsd_ntohl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bsd_ntohl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = shl i32 %8, 16
%10 = or i32 %5, %9
%11 = load i32, i32* %2
%12 = ashr i32 %11, 16
%13 = and i32 %12, 255
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
%16 = load i32, i32* %2
%17 = ashr i32 %16, 24
%18 = and i32 %17, 255
%19 = or i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @bsd_ntohl(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_decode();
int /*<<< orphan*/ test_encode();
int /*<<< orphan*/ test_seq_length();
int main(int argc, char *argv[]) {
  test_seq_length();
  test_decode();
  test_encode();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_seq_length@plt>
mov    $0x0,%al
call   1050 <test_decode@plt>
mov    $0x0,%al
call   1040 <test_encode@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_seq_length()
%7 = call i32 (...) @test_decode()
%8 = call i32 (...) @test_encode()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_seq_length()
%4 = tail call i32 (...) @test_decode()
%5 = tail call i32 (...) @test_encode()
ret i32 0
}
__attribute__((always_)) int unregister_trace_kfree(
    void (*probe)(void *__data, unsigned long call_site, const void *ptr),
    void *data) {
  return -38;
}


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

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

LLVM IR (-O0):
define i32 @unregister_trace_kfree(void (i8*, i64, i8*)* %0, i8* %1) {
%3 = alloca void (i8*, i64, i8*)*
%4 = alloca i8*
store void (i8*, i64, i8*)* %0, void (i8*, i64, i8*)** %3
store i8* %1, i8** %4
ret i32 -38
}

LLVM IR (-O2):
define i32 @unregister_trace_kfree(void (i8*, i64, i8*)* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -38
}
float num_max(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<num_max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <num_max+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <num_max+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_max>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @num_max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @num_max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int indexs(int i, int nfs) {
  int mm = i;
  while (mm > nfs)
    mm -= nfs;
  return mm;
}


x86 assembly (clang, -O0):
<indexs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    112c <indexs+0x2c>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1110 <indexs+0x10>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexs>:
mov    %edi,%eax
add    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
sub    %esi,%eax
cmp    %esi,%eax
jg     1110 <indexs+0x10>
ret

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

LLVM IR (-O2):
define i32 @indexs(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = icmp sgt i32 %4, %1
%6 = sub nsw i32 %4, %1
br i1 %5, label %3, label %7
7: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int MyFunc_A();
int MyFunc_B() { return MyFunc_A(); }


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

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

LLVM IR (-O0):
define i32 @MyFunc_B() {
%1 = call i32 (...) @MyFunc_A()
ret i32 %1
}

LLVM IR (-O2):
define i32 @MyFunc_B() {
%1 = tail call i32 (...) @MyFunc_A()
ret i32 %1
}
unsigned int lrand1(unsigned int *s) {
  unsigned int i;
  i = *s;
  i = ((1664525 * i) + 1013904223);
  *s = i;
  return i & 0xffffffff;
}


x86 assembly (clang, -O0):
<lrand1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
imul   $0x19660d,-0xc(%rbp),%eax
add    $0x3c6ef35f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrand1>:
imul   $0x19660d,(%rdi),%eax
add    $0x3c6ef35f,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @lrand1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = mul i32 1664525, %6
%8 = add i32 %7, 1013904223
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
store i32 %9, i32* %10
%11 = load i32, i32* %3
%12 = and i32 %11, -1
ret i32 %12
}

LLVM IR (-O2):
define i32 @lrand1(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 1664525
%4 = add i32 %3, 1013904223
store i32 %4, i32* %0
ret i32 %4
}