xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void *kcalloc(size_t len, size_t size, int flags) {
  void *p;
  if ((p = calloc(len, size)) == NULL) {
    printf("kcalloc failing!\n");
    fflush(0);
    exit(-1);
  }
  return p;
}


x86 assembly (clang, -O0):
<kcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    118b <kcalloc+0x4b>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <fflush@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcalloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     114d <kcalloc+0xd>
pop    %rcx
ret
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <fflush@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"kcalloc failing!\0A\00"
define i8* @kcalloc(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = call i8* @calloc(i64 %8, i64 %9)
store i8* %10, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @fflush(i32 0)
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %3
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
@str = [17 x i8] c"kcalloc failing!\00"
define noalias i8* @kcalloc(i64 %0, i64 %1, i32 %2) {
%4 = tail call i8* @calloc(i64 %0, i64 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @fflush(i32 0)
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ of1275_exit(int);
exit(int status) {
  of1275_exit(status);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <of1275_exit@plt>
jmp    1123 <exit+0x13>

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <of1275_exit@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <exit+0x10>

LLVM IR (-O0):
define i32 @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @of1275_exit(i32 %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
define i32 @exit(i32 %0) {
%2 = tail call i32 @of1275_exit(i32 %0)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int count(char *name, int size) {
  printf("%20s = %d\n", name, size);
  return size;
}


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

x86 assembly (clang, -O2):
<count>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%20s = %d\0A\00"
define i32 @count(i8* %0, i32 returned %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Pl_Update_Choice_Point0(int /*<<< orphan*/ *);
void Pl_Defeasible_Undo() { Pl_Update_Choice_Point0(NULL); }


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

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

LLVM IR (-O0):
define void @Pl_Defeasible_Undo() {
%1 = call i32 @Pl_Update_Choice_Point0(i32* null)
ret void
}

LLVM IR (-O2):
define void @Pl_Defeasible_Undo() {
%1 = tail call i32 @Pl_Update_Choice_Point0(i32* null)
ret void
}
/* Variables and functions */
int read(int, char *, int);
int readc(int h, char *c) {
  int i;
  i = read(h, c, 1);
  if (i == 1)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<readc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1149 <readc+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1150 <readc+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readc>:
push   %rax
mov    $0x1,%edx
call   1030 <read@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @readc(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @read(i32 %0, i8* %1, i32 1)
%4 = icmp ne i32 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
int int_shifts_are_logical() {
  int x = ~0;
  int shifted_val = x >> 1;
  return x == shifted_val;
}


x86 assembly (clang, -O0):
<int_shifts_are_logical>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_shifts_are_logical() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %1
%3 = load i32, i32* %1
%4 = ashr i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @int_shifts_are_logical() {
ret i32 1
}
/* Variables and functions */
int sha512(unsigned char *, unsigned long long, unsigned char *);
int crypto_hash_sha512(unsigned char *dst, unsigned char *src,
                       unsigned long long len) {
  return sha512(src, len, dst);
}


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

x86 assembly (clang, -O2):
<crypto_hash_sha512>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <sha512@plt>

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

LLVM IR (-O2):
define i32 @crypto_hash_sha512(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @sha512(i8* %1, i64 %2, i8* %0)
ret i32 %4
}
void rop3_74_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | *D;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_74_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_74_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8, i8* %6
%51 = zext i8 %50 to i32
%52 = and i32 %49, %51
%53 = or i32 %46, %52
%54 = trunc i32 %53 to i8
%55 = load i8*, i8** %4
store i8 %54, i8* %55
ret void
}

LLVM IR (-O2):
define void @rop3_74_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
void print_error_file(char *filename) {
  fprintf(stderr, "%sERROR:%s Can't open file: %s\n", "\x1b[31m", "\x1b[0m",
          filename);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<print_error_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%r8
lea    0xec0(%rip),%rsi
lea    0xed9(%rip),%rdx
lea    0xed8(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_error_file>:
push   %rax
mov    %rdi,%r8
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xee5(%rip),%rdx
lea    0xee4(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"%sERROR:%s Can't open file: %s\0A\00"
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@EXIT_FAILURE = global i32 0
define void @print_error_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"%sERROR:%s Can't open file: %s\0A\00"
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@EXIT_FAILURE = global i32 0
define void @print_error_file(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
x(struct {
  struct {
    int (*(*foo)(int (*arg1)(double)))(float arg2);
  } foo;
} baz) {
  return (0);
}


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

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

LLVM IR (-O0):
%struct.anon = type { %struct.anon.0 }
%struct.anon.0 = type { i32 (float)* (i32 (double)*)* }
define i32 @x(i32 (float)* (i32 (double)*)* %0) {
%2 = alloca %struct.anon
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%4 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %3, i32 0, i32 0
store i32 (float)* (i32 (double)*)* %0, i32 (float)* (i32 (double)*)** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @x(i32 (float)* (i32 (double)*)* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ form_out(char *, int);
int gett(char *);
int /*<<< orphan*/ lang_out(char *, int);
void main() {
  char text[1000];
  int i = 0;
  int len = 0;
  for (i = 0; i <= 1000; ++i) {
    text[i] = 0;
  }
  len = gett(text);
  form_out(text, len);
  lang_out(text, len);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x3f4(%rbp)
movl   $0x0,-0x3f8(%rbp)
movl   $0x0,-0x3f4(%rbp)
cmpl   $0x3e8,-0x3f4(%rbp)
jg     118c <main+0x5c>
movslq -0x3f4(%rbp),%rax
movb   $0x0,-0x3f0(%rbp,%rax,1)
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    1159 <main+0x29>
lea    -0x3f0(%rbp),%rdi
call   1040 <gett@plt>
mov    %eax,-0x3f8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    -0x3f8(%rbp),%esi
call   1050 <form_out@plt>
lea    -0x3f0(%rbp),%rdi
mov    -0x3f8(%rbp),%esi
call   1030 <lang_out@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rbx
mov    $0x3e9,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1040 <gett@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1060 <form_out@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <lang_out@plt>
add    $0x3e8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = call i32 @gett(i8* %3)
%5 = call i32 @form_out(i8* %3, i32 %4)
%6 = call i32 @lang_out(i8* %3, i32 %4)
ret void
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int);
int shim_pkey_free(int pkey) { return shim_enosys(0, pkey); }


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

x86 assembly (clang, -O2):
<shim_pkey_free>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_pkey_free(i32 %0) {
%2 = tail call i32 @shim_enosys(i32 0, i32 %0)
ret i32 %2
}
/* Variables and functions */
unsigned int sleep(unsigned int);
__attribute__((__weak__, __always___)) unsigned int
softboundmpx_sleep(unsigned int seconds) {
  return sleep(seconds);
}


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

x86 assembly (clang, -O2):
<softboundmpx_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret i32 %2
}
/* Variables and functions */
float rand_uniform();
int ai_pool_func(int *num_rounds_played) {
  (*num_rounds_played)++;
  if (*num_rounds_played >= 10) {
    int get_up = rand_uniform() < 0.1f;
    if (get_up) {
      *num_rounds_played = 0;
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<ai_pool_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0xa,(%rax)
jl     1179 <ai_pool_func+0x69>
mov    $0x0,%al
call   1030 <rand_uniform@plt>
movaps %xmm0,%xmm1
movss  0xeba(%rip),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1174 <ai_pool_func+0x64>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1180 <ai_pool_func+0x70>
jmp    1179 <ai_pool_func+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_pool_func>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rdi)
mov    $0x1,%ebp
cmp    $0x9,%eax
jl     1143 <ai_pool_func+0x33>
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand_uniform@plt>
movss  0xeca(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1143 <ai_pool_func+0x33>
movl   $0x0,(%rbx)
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ai_pool_func(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = icmp sge i32 %9, 10
br i1 %10, label %11, label %20
11: ; preds = %1
%12 = call float (...) @rand_uniform()
%13 = fcmp olt float %12, 0x3FB99999A0000000
%14 = zext i1 %13 to i32
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = load i32*, i32** %3
store i32 0, i32* %18
store i32 0, i32* %2
br label %21
19: ; preds = %11
br label %20
20: ; preds = %19, %1
store i32 1, i32* %2
br label %21
21: ; preds = %20, %17
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @ai_pool_func(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
%4 = icmp sgt i32 %2, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call float (...) @rand_uniform()
%7 = fcmp olt float %6, 0x3FB99999A0000000
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 0, i32* %0
br label %9
9: ; preds = %5, %1, %8
%10 = phi i32 [ 0, %8 ], [ 1, %1 ], [ 1, %5 ]
ret i32 %10
}
/* Variables and functions */
int getNumOfSubstring(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *, char *);
int main() {
  char a[100], b[100];
  scanf("%s%s", a, b);
  int count = getNumOfSubstring(a, b);
  printf("%d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xeac(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <getNumOfSubstring@plt>
mov    %eax,-0xe4(%rbp)
mov    -0xe4(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xebf(%rip),%rdi
lea    0x70(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <getNumOfSubstring@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i32 @getNumOfSubstring(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int EOF;
int islegal(int c) {
  if (c >= ' ') {
    if (c <= '~') {
      return (1);
    }
  }
  if (c == ' ')
    return (1);
  if (c == '\t')
    return (1);
  if (c == '\n')
    return (1);
  if (c == EOF)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<islegal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     112c <islegal+0x2c>
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <islegal+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1193 <islegal+0x93>
jmp    112c <islegal+0x2c>
cmpl   $0x20,-0x8(%rbp)
jne    1142 <islegal+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1193 <islegal+0x93>
cmpl   $0x9,-0x8(%rbp)
jne    1158 <islegal+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1193 <islegal+0x93>
cmpl   $0xa,-0x8(%rbp)
jne    116e <islegal+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1193 <islegal+0x93>
mov    -0x8(%rbp),%eax
mov    0x2e70(%rip),%rcx
cmp    (%rcx),%eax
jne    118c <islegal+0x8c>
movl   $0x1,-0x4(%rbp)
jmp    1193 <islegal+0x93>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islegal>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%eax
setb   %al
lea    -0x9(%rdi),%ecx
cmp    $0x2,%ecx
setb   %cl
or     %al,%cl
mov    0x2ecd(%rip),%rax
cmp    %edi,(%rax)
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @islegal(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = add i32 %0, -9
%5 = icmp ult i32 %4, 2
%6 = or i1 %3, %5
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %7, %0
%9 = select i1 %6, i1 true, i1 %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int u8isupperlatini(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8isupperlatinc(char *c) { return u8isupperlatini(u8tointc(c)); }


x86 assembly (clang, -O0):
<u8isupperlatinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointc@plt>
mov    %eax,%edi
call   1040 <u8isupperlatini@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isupperlatinc>:
push   %rax
call   1030 <u8tointc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isupperlatini@plt>

LLVM IR (-O0):
define i32 @u8isupperlatinc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointc(i8* %3)
%5 = call i32 @u8isupperlatini(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8isupperlatinc(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8isupperlatini(i32 %2)
ret i32 %3
}
/* Variables and functions */
double cos(double);
double sin(double);
void sincos(double radians, double *s, double *c) {
  *s = sin(radians);
  *c = cos(radians);
  return;
}


x86 assembly (clang, -O0):
<sincos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sincos(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = call double @sin(double %7)
%9 = load double*, double** %5
store double %8, double* %9
%10 = load double, double* %4
%11 = call double @cos(double %10)
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @sincos(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call double @sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret void
}
int test_imm_F8int16_reg(short val) {
  return ((val) & (0xF8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F8int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xf8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F8int16_reg>:
test   $0xf8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F8int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 248
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F8int16_reg(i16 signext %0) {
%2 = and i16 %0, 248
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, char *, int, size_t);
void *malloc(size_t);
void *emalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (p == NULL)
    eprintf("malloc of %u bytes failed:",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/armon/statsite/refs/heads/master/deps/"
            "check-0.10.0/src/check_error.c",
            64 - 2, n);
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <emalloc+0x40>
mov    -0x8(%rbp),%rcx
lea    0xeb1(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x3e,%edx
call   1040 <eprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114f <emalloc+0x2f>
lea    0xec5(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    $0x3e,%edx
mov    %r14,%rcx
call   1040 <eprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"malloc of %u bytes failed:\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/armon/statsite/refs/heads/master/deps/check-0.10.0/src/check_error.c\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @eprintf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 62, i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [27 x i8] c"malloc of %u bytes failed:\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/armon/statsite/refs/heads/master/deps/check-0.10.0/src/check_error.c\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @eprintf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i32 62, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
int /*<<< orphan*/ printf(char *);
int main3() {
  char m[7] = "623619";
  foo(m + 4);
  printf("SE ARRIVO QUI HO FINITO\n");
  return 0;
}


x86 assembly (clang, -O0):
<main3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x7(%rbp),%rdi
add    $0x4,%rdi
call   1040 <foo@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main3>:
push   %rax
movl   $0x393136,0x3(%rsp)
movl   $0x36333236,(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <foo@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main3.m = [7 x i8] c"623619\00"
@.str = [25 x i8] c"SE ARRIVO QUI HO FINITO\0A\00"
define i32 @main3() {
%1 = alloca [7 x i8]
%2 = bitcast [7 x i8]* %1 to i8*
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = call i32 @foo(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main3.m = [7 x i8] c"623619\00"
@str = [24 x i8] c"SE ARRIVO QUI HO FINITO\00"
define i32 @main3() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 4
%4 = call i32 @foo(i8* %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void trackmem_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @trackmem_cleanup() {
ret void
}
int doStatementFunction() {
  auto int n = 3;
  auto int m = 4;
  do {
    return n;
  } while (m);
}


x86 assembly (clang, -O0):
<doStatementFunction>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @doStatementFunction() {
ret i32 3
}
/* Variables and functions */
scalar_t__ isLittleEndian();
int little2bigi(int);
int little2hosti(int num) {
  if (isLittleEndian())
    return num;
  return little2bigi(num);
}


x86 assembly (clang, -O0):
<little2hosti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <isLittleEndian@plt>
cmp    $0x0,%rax
je     1147 <little2hosti+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <little2hosti+0x32>
mov    -0x8(%rbp),%edi
call   1040 <little2bigi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<little2hosti>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <isLittleEndian@plt>
test   %rax,%rax
je     1133 <little2hosti+0x13>
mov    %ebx,%eax
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1040 <little2bigi@plt>

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

LLVM IR (-O2):
define i32 @little2hosti(i32 %0) {
%2 = tail call i64 (...) @isLittleEndian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @little2bigi(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ strncasecmp(char const *, char *, int);
char *wpa_cmd_results();
int wpa_cmd_ok() {
  const char *result = wpa_cmd_results();
  return !strncasecmp(result, "OK", 2);
}


x86 assembly (clang, -O0):
<wpa_cmd_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <wpa_cmd_results@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cmd_ok>:
push   %rax
xor    %eax,%eax
call   1030 <wpa_cmd_results@plt>
lea    0xed1(%rip),%rsi
mov    %rax,%rdi
mov    $0x2,%edx
call   1040 <strncasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
define i32 @wpa_cmd_ok() {
%1 = alloca i8*
%2 = call i8* (...) @wpa_cmd_results()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define i32 @wpa_cmd_ok() {
%1 = tail call i8* (...) @wpa_cmd_results()
%2 = tail call i32 @strncasecmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int FIncSorter(const void *a, const void *b) {
  return *((float *)a) > *((float *)b);
}


x86 assembly (clang, -O0):
<FIncSorter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIncSorter>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss (%rsi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @FIncSorter(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fcmp ogt float %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @FIncSorter(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ show_double(double);
int /*<<< orphan*/ show_long(long);
int /*<<< orphan*/ show_short(short);
int main() {
  int val = 12345;
  short s_val = (short)val;
  long l_val = (long)val;
  double d_val = (double)val;
  show_short(s_val);
  show_long(l_val);
  show_double(d_val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3039,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movswl -0xa(%rbp),%edi
call   1040 <show_short@plt>
mov    -0x18(%rbp),%rdi
call   1030 <show_long@plt>
movsd  -0x20(%rbp),%xmm0
call   1050 <show_double@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3039,%edi
call   1040 <show_short@plt>
mov    $0x3039,%edi
call   1030 <show_long@plt>
movsd  0xeb3(%rip),%xmm0
call   1050 <show_double@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = alloca i64
%5 = alloca double
store i32 0, i32* %1
store i32 12345, i32* %2
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i16
store i16 %7, i16* %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to double
store double %11, double* %5
%12 = load i16, i16* %3
%13 = call i32 @show_short(i16 signext %12)
%14 = load i64, i64* %4
%15 = call i32 @show_long(i64 %14)
%16 = load double, double* %5
%17 = call i32 @show_double(double %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @show_short(i16 signext 12345)
%2 = tail call i32 @show_long(i64 12345)
%3 = tail call i32 @show_double(double 1.234500e+04)
ret i32 0
}
/* Variables and functions */
char *calloc(int, int);
int rand();
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *channel_make_name() {
  char *out = calloc(21, 1);
  snprintf(out, 20, "chan-%d", rand());
  return out;
}


x86 assembly (clang, -O0):
<channel_make_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x15,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%ecx
mov    $0x14,%esi
lea    0xe94(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<channel_make_name>:
push   %rbx
mov    $0x15,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <rand@plt>
lea    0xeaf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %eax,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"chan-%d\00"
define i8* @channel_make_name() {
%1 = alloca i8*
%2 = call i8* @calloc(i32 21, i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 (...) @rand()
%5 = call i32 @snprintf(i8* %3, i32 20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"chan-%d\00"
define i8* @channel_make_name() {
%1 = tail call dereferenceable_or_null(21) i8* @calloc(i32 21, i32 1)
%2 = tail call i32 (...) @rand()
%3 = tail call i32 @snprintf(i8* %1, i32 20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite_safe(float *, int, int, int /*<<< orphan*/ *);
void dump_float(float value, FILE *fp) {
  fwrite_safe(&value, sizeof(float), 1, fp);
  return;
}


x86 assembly (clang, -O0):
<dump_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite_safe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_float>:
push   %rax
mov    %rdi,%rcx
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite_safe@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @dump_float(float %0, i32* %1) {
%3 = alloca float
store float %0, float* %3
%4 = call i32 @fwrite_safe(float* %3, i32 4, i32 1, i32* %1)
ret void
}
int iInitMyNetwork(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @iInitMyNetwork() {
ret i32 0
}

LLVM IR (-O2):
define i32 @iInitMyNetwork() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int cookie_gen(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len) {
  unsigned int i;
  for (i = 0; i < 20; i++, cookie++) {
    *cookie = i;
  }
  *cookie_len = 20;
  return 1;
}


x86 assembly (clang, -O0):
<cookie_gen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jae    1146 <cookie_gen+0x46>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <cookie_gen+0x17>
mov    -0x18(%rbp),%rax
movl   $0x14,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cookie_gen>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rsi)
movl   $0x13121110,0x10(%rsi)
movl   $0x14,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cookie_gen(i32* nocapture readnone %0, i8* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = bitcast i8* %1 to <16 x i8>*
store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* %4
%5 = getelementptr inbounds i8, i8* %1, i64 16
store i8 16, i8* %5
%6 = getelementptr inbounds i8, i8* %1, i64 17
store i8 17, i8* %6
%7 = getelementptr inbounds i8, i8* %1, i64 18
store i8 18, i8* %7
%8 = getelementptr inbounds i8, i8* %1, i64 19
store i8 19, i8* %8
store i32 20, i32* %2
ret i32 1
}
void ScaleRowUp2_16_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowUp2_16_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strlen(char *);
void draw_prompt(char *input_string) {
  printf("] ");
  if (strlen(input_string) > 0)
    printf("%s", input_string);
}


x86 assembly (clang, -O0):
<draw_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    115f <draw_prompt+0x3f>
mov    -0x8(%rbp),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_prompt>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
jle    1151 <draw_prompt+0x31>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"] \00"
@.str.1 = [3 x i8] c"%s\00"
define void @draw_prompt(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %1
ret void
}