xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ writeError(int, char *);
int medusaDisconnect(int hSocket) {
  close(hSocket);
  writeError(7, "Disconnect successful");
  return -1;
}


x86 assembly (clang, -O0):
<medusaDisconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    $0x7,%edi
lea    0xec1(%rip),%rsi
call   1040 <writeError@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medusaDisconnect>:
push   %rax
call   1030 <close@plt>
lea    0xed3(%rip),%rsi
mov    $0x7,%edi
call   1040 <writeError@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Disconnect successful\00"
define i32 @medusaDisconnect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = call i32 @writeError(i32 7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [22 x i8] c"Disconnect successful\00"
define i32 @medusaDisconnect(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = tail call i32 @writeError(i32 7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int baz(int x) {
  puts("in baz");
  return x * 4;
}


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

x86 assembly (clang, -O2):
<baz>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
shl    $0x2,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"in baz\00"
define i32 @baz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 4
ret i32 %5
}

LLVM IR (-O2):
@.str = [7 x i8] c"in baz\00"
define i32 @baz(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = shl nsw i32 %0, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void die(int sig) {
  puts("\ndeal with something, like close file and network connection...");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"\0Adeal with something, like close file and network connection...\00"
define void @die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [64 x i8] c"\0Adeal with something, like close file and network connection...\00"
define void @die(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *SafePointerFromUInt(unsigned int handle) {
  return (void *)(uintptr_t)(handle);
}


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

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

LLVM IR (-O0):
define i8* @SafePointerFromUInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @SafePointerFromUInt(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, char *, char *);
void main(void) { execl("/bin/sh", "sh", "-c", "ip addr", (char *)0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee3(%rip),%rsi
lea    0xedf(%rip),%rdx
lea    0xedb(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <execl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xee3(%rip),%rdx
lea    0xedf(%rip),%rcx
xor    %r8d,%r8d
jmp    1030 <execl@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
@.str.2 = [3 x i8] c"-c\00"
@.str.3 = [8 x i8] c"ip addr\00"
define void @main() {
%1 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* null)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
@.str.2 = [3 x i8] c"-c\00"
@.str.3 = [8 x i8] c"ip addr\00"
define void @main() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* null)
ret void
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
uint non_iterative_popcount_32(uint n) {
  n = n - ((n >> 1) & 0x55555555u);
  n = (n & 0x33333333u) + ((n >> 2) & 0x33333333u);
  n = (n + (n >> 4)) & 0x0F0F0F0Fu;
  return (n * 0x01010101u) >> 24;
}


x86 assembly (clang, -O0):
<non_iterative_popcount_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
imul   $0x1010101,-0x4(%rbp),%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<non_iterative_popcount_32>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @non_iterative_popcount_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
%17 = add nsw i32 %14, %16
%18 = and i32 %17, 252645135
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = mul i32 %19, 16843009
%21 = lshr i32 %20, 24
ret i32 %21
}

LLVM IR (-O2):
define i32 @non_iterative_popcount_32(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
int main() { return 4 < 3; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
long long bit06() { return 0x0000000000000040LL; }


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

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

LLVM IR (-O0):
define i64 @bit06() {
ret i64 64
}

LLVM IR (-O2):
define i64 @bit06() {
ret i64 64
}
/* Type definitions */
struct utmpx {
  int dummy;
};
struct utmp {
  int dummy;
};

/* Variables and functions */
scalar_t__ getutline(struct utmp const *);
struct utmpx *getutxline(const struct utmpx *utmp_entry) {
  return (struct utmpx *)getutline((const struct utmp *)utmp_entry);
}


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

x86 assembly (clang, -O2):
<getutxline>:
jmp    1030 <getutline@plt>

LLVM IR (-O0):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @getutxline(%struct.utmpx* %0) {
%2 = alloca %struct.utmpx*
store %struct.utmpx* %0, %struct.utmpx** %2
%3 = load %struct.utmpx*, %struct.utmpx** %2
%4 = bitcast %struct.utmpx* %3 to %struct.utmp*
%5 = call i64 @getutline(%struct.utmp* %4)
%6 = inttoptr i64 %5 to %struct.utmpx*
ret %struct.utmpx* %6
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @getutxline(%struct.utmpx* %0) {
%2 = bitcast %struct.utmpx* %0 to %struct.utmp*
%3 = tail call i64 @getutline(%struct.utmp* %2)
%4 = inttoptr i64 %3 to %struct.utmpx*
ret %struct.utmpx* %4
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void flush(void) {
  while ((*(volatile unsigned char *)0xc0013018) & (1 << 3))
    barrier();
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flush+0x9>
mov    $0xc0013018,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     113b <flush+0x2b>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    1119 <flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rbx
mov    $0xc0013018,%ebx
testb  $0x8,(%rbx)
je     112c <flush+0x1c>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <barrier@plt>
testb  $0x8,(%rbx)
jne    1120 <flush+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @flush() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i8, i8* inttoptr (i64 3221303320 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @barrier()
br label %1
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flush() {
%1 = load volatile i8, i8* inttoptr (i64 3221303320 to i8*)
%2 = and i8 %1, 8
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @barrier()
%6 = load volatile i8, i8* inttoptr (i64 3221303320 to i8*)
%7 = and i8 %6, 8
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void end(int x) {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<end>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @endwin()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @end(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int a = __VERIFIER_nondet_int();
  int b = __VERIFIER_nondet_int();
  int *c = &a;
  if (c != c) {
    goto ERROR;
  }
  if (a > a) {
    goto ERROR;
  }
  a = __VERIFIER_nondet_int();
  if (a > b) {
    if (a < b) {
    ERROR:
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     114e <main+0x3e>
jmp    1186 <main+0x76>
mov    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    115f <main+0x4f>
jmp    1186 <main+0x76>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1197 <main+0x87>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1192 <main+0x82>
jmp    1186 <main+0x76>
movl   $0xffffffff,-0x4(%rbp)
jmp    119e <main+0x8e>
jmp    1197 <main+0x87>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
int shrshl() {
  int x = 2, y = 3;
  return (1 << 15) + (2 >> 1) + (x << y);
}


x86 assembly (clang, -O0):
<shrshl>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
add    $0x8001,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @shrshl() {
%1 = alloca i32
%2 = alloca i32
store i32 2, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = shl i32 %3, %4
%6 = add nsw i32 32769, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @shrshl() {
ret i32 32785
}
int length(char s[]) {
  int i;
  for (i = 0; s[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <length+0x37>
jmp    1129 <length+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ mod3_fini2();
void mod3_fini(void) { mod3_fini2(); }


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

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

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

LLVM IR (-O2):
define void @mod3_fini() {
%1 = tail call i32 (...) @mod3_fini2()
ret void
}
/* Variables and functions */
scalar_t__ errno;
int strtol(char const *, char **, int);
int parse_int(int *dest, const char *str) {
  char *ptr;
  errno = 0;
  *dest = strtol(str, &ptr, 10);
  if (errno || !*ptr) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2eb9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2e91(%rip),%rax
cmpq   $0x0,(%rax)
jne    1166 <parse_int+0x56>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1172 <parse_int+0x62>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <parse_int+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    %rdi,%rbx
mov    0x2ebf(%rip),%r14
movq   $0x0,(%r14)
mov    %rsp,%rsi
mov    %rax,%rdi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,(%rbx)
mov    $0xffffffff,%eax
cmpq   $0x0,(%r14)
jne    114e <parse_int+0x3e>
mov    (%rsp),%rax
cmpb   $0x1,(%rax)
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@errno = global i64 0
define i32 @parse_int(i32* nocapture writeonly %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i64 0, i64* @errno
%5 = call i32 @strtol(i8* %1, i8** %3, i32 10)
store i32 %5, i32* %0
%6 = load i64, i64* @errno
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = sext i1 %11 to i32
br label %13
13: ; preds = %8, %2
%14 = phi i32 [ -1, %2 ], [ %12, %8 ]
ret i32 %14
}
reg0adrreg1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ r0 = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<reg0adrreg1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movss  0x10f444(%rax),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reg0adrreg1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %13
%17 = getelementptr inbounds float, float* %16, i64 277777
%18 = load float, float* %17
store float %18, float* %8
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @reg0adrreg1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
ret i32 undef
}
int main(int argc, char **argv) {
  int x;
  float r = argc;
  if (!(0 <= r)) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jae    1139 <main+0x39>
movl   $0x7,-0x14(%rbp)
jmp    1140 <main+0x40>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x2a,%ecx
mov    $0x7,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
store float %9, float* %7
%10 = load float, float* %7
%11 = fcmp ole float 0.000000e+00, %10
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, -1
%4 = select i1 %3, i32 42, i32 7
ret i32 %4
}
void X509_VAL_new(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_VAL_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_fdputstr(char *, int);
void error_open(char *path, int fd) {
  my_fdputstr("bash: ", fd);
  my_fdputstr(path, fd);
  my_fdputstr(": No such file or directory", fd);
  my_fdputstr("\n", fd);
}


x86 assembly (clang, -O0):
<error_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <my_fdputstr@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <my_fdputstr@plt>
mov    -0xc(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <my_fdputstr@plt>
mov    -0xc(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <my_fdputstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_open>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xee0(%rip),%rdi
call   1030 <my_fdputstr@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <my_fdputstr@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
call   1030 <my_fdputstr@plt>
lea    0xedf(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <my_fdputstr@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"bash: \00"
@.str.1 = [28 x i8] c": No such file or directory\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @error_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @my_fdputstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @my_fdputstr(i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @my_fdputstr(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %4
%13 = call i32 @my_fdputstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"bash: \00"
@.str.1 = [28 x i8] c": No such file or directory\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @error_open(i8* %0, i32 %1) {
%3 = tail call i32 @my_fdputstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @my_fdputstr(i8* %0, i32 %1)
%5 = tail call i32 @my_fdputstr(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%6 = tail call i32 @my_fdputstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_NDELAY;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int);
int open_trunc(const char *fn) {
  return open(fn, O_WRONLY | O_NDELAY | O_TRUNC | O_CREAT, 0644);
}


x86 assembly (clang, -O0):
<open_trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
mov    0x2eb7(%rip),%rax
or     (%rax),%esi
mov    0x2eb6(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_trunc>:
mov    0x2ea9(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ec7(%rip),%rax
or     (%rax),%esi
mov    0x2ec6(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_NDELAY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
define i32 @open_trunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_NDELAY
%6 = or i32 %4, %5
%7 = load i32, i32* @O_TRUNC
%8 = or i32 %6, %7
%9 = load i32, i32* @O_CREAT
%10 = or i32 %8, %9
%11 = call i32 @open(i8* %3, i32 %10, i32 420)
ret i32 %11
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_NDELAY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
define i32 @open_trunc(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_NDELAY
%4 = or i32 %3, %2
%5 = load i32, i32* @O_TRUNC
%6 = or i32 %4, %5
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = tail call i32 @open(i8* %0, i32 %8, i32 420)
ret i32 %9
}
long uz() { return 0x7fff0000L; }


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

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

LLVM IR (-O0):
define i64 @uz() {
ret i64 2147418112
}

LLVM IR (-O2):
define i64 @uz() {
ret i64 2147418112
}
/* Type definitions */
typedef int char16_t;

/* Variables and functions */
bool utf16_is_trailing_surrogate(char16_t c) {
  return (0xdc00 <= c && c <= 0xdfff);
}


x86 assembly (clang, -O0):
<utf16_is_trailing_surrogate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0xdc00,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1127 <utf16_is_trailing_surrogate+0x27>
cmpl   $0xdfff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf16_is_trailing_surrogate>:
and    $0xfffffc00,%edi
xor    %eax,%eax
cmp    $0xdc00,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @utf16_is_trailing_surrogate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 56320, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57343
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @utf16_is_trailing_surrogate(i32 %0) {
%2 = and i32 %0, -1024
%3 = icmp eq i32 %2, 56320
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main() {
  static int x[] = {1, 2, 3, 4, 5};
  foo(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rdi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@main.x = internal global [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = call i32 @foo(i32* getelementptr inbounds ([5 x i32], [5 x i32]* @main.x, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@main.x = internal global [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = tail call i32 @foo(i32* getelementptr inbounds ([5 x i32], [5 x i32]* @main.x, i64 0, i64 0))
ret i32 0
}
int sw_strlen(char *s) {
  int count;
  count = 0;
  while (*s != '\0') {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<sw_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <sw_strlen+0x2d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sw_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sw_strlen(i8* nocapture %0) {
ret i32 0
}
/* Variables and functions */
long rgd_get_double_grid_index(long const *, long const *);
long ksp_get_double_grid_index(const long address_double[3],
                               const long mesh[3]) {
  return rgd_get_double_grid_index(address_double, mesh);
}


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

x86 assembly (clang, -O2):
<ksp_get_double_grid_index>:
jmp    1030 <rgd_get_double_grid_index@plt>

LLVM IR (-O0):
define i64 @ksp_get_double_grid_index(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64*, i64** %4
%7 = call i64 @rgd_get_double_grid_index(i64* %5, i64* %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @ksp_get_double_grid_index(i64* %0, i64* %1) {
%3 = tail call i64 @rgd_get_double_grid_index(i64* %0, i64* %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void CaptureWrapper_Delete(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<CaptureWrapper_Delete>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @CaptureWrapper_Delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
int gsmBytes2String_pdu(const unsigned char *pSrc, unsigned char *pDst,
                        int nSrcLength) {
  memcpy(pDst, pSrc, nSrcLength);
  pDst[nSrcLength] = '\0';
  return nSrcLength;
}


x86 assembly (clang, -O0):
<gsmBytes2String_pdu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsmBytes2String_pdu>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %r14,%rdi
call   1030 <memcpy@plt>
movslq %ebx,%rax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @gsmBytes2String_pdu(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @gsmBytes2String_pdu(i8* %0, i8* %1, i32 returned %2) {
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
store i8 0, i8* %6
ret i32 %2
}
int caam_rng_init(struct device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @caam_rng_init(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @caam_rng_init(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M201_f(char *s) {
  debug("M201_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M201_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M201_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M201_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M201_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M201_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M201_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int is_directory(const char *filename) {
  struct stat st;
  if (stat(filename, &st) == 0)
    return S_ISDIR(st.st_mode);
  return 0;
}


x86 assembly (clang, -O0):
<is_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    1153 <is_directory+0x33>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
jmp    115a <is_directory+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_directory>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <is_directory+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_directory(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @S_ISDIR(i32 %10)
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_directory(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char const);
void print_hash(const unsigned char *hash, const int hash_len) {
  for (int i = 0; i < hash_len; i++) {
    printf("%02x", hash[i]);
  }
}


x86 assembly (clang, -O0):
<print_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <print_hash+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_hash+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hash>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <print_hash+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_hash+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02x\00"
define void @print_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print_hash(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int is_eot(char c) { return c && strchr(" \t\n\r#", c); }


x86 assembly (clang, -O0):
<is_eot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     114a <is_eot+0x3a>
lea    0xec9(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_eot>:
test   %dil,%dil
je     1136 <is_eot+0x26>
push   %rax
movsbl %dil,%esi
lea    0xedf(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [6 x i8] c" \09\0A\0D#\00"
define i32 @is_eot(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [6 x i8] c" \09\0A\0D#\00"
define i32 @is_eot(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
void *ft_memset(void *s, int c, size_t n) {
  char *s_cursor;
  s_cursor = (char *)s;
  while (n-- != 0) {
    *s_cursor = (char)c;
    s_cursor++;
  }
  return (s);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     114c <ft_memset+0x4c>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1117 <ft_memset+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void Eendif(void) { error("Inappropriate #endif"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Inappropriate #endif\00"
define void @Eendif() {
%1 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Inappropriate #endif\00"
define void @Eendif() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
void str_cpy(char des[], char src[]) {
  int i = 0, j = 0;
  while ((des[i++] = src[j++]))
    ;
}


x86 assembly (clang, -O0):
<str_cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %edx,%rdx
mov    %al,(%rcx,%rdx,1)
cmp    $0x0,%al
je     1151 <str_cpy+0x51>
jmp    111a <str_cpy+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <str_cpy+0x10>
ret

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

LLVM IR (-O2):
define void @str_cpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %5, %3 ], [ 0, %2 ]
%5 = add nuw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %1, i64 %4
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %7, i8* %8
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
unsigned long sub2(unsigned long i) { return (i >> 63) << 63; }


x86 assembly (clang, -O0):
<sub2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3f,%rax
shl    $0x3f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub2>:
movabs $0x8000000000000000,%rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @sub2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 63
%5 = shl i64 %4, 63
ret i64 %5
}

LLVM IR (-O2):
define i64 @sub2(i64 %0) {
%2 = and i64 %0, -9223372036854775808
ret i64 %2
}