xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int readUntilZero(scalar_t__);
uint64_t skipGolombRice(uint64_t pos, int shift) {
  int q = readUntilZero(pos);
  return pos + q + 1 + shift;
}


x86 assembly (clang, -O0):
<skipGolombRice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <readUntilZero@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipGolombRice>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <readUntilZero@plt>
cltq
movslq %ebp,%rcx
add    %rbx,%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @skipGolombRice(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = call i32 @readUntilZero(i64 %6)
store i32 %7, i32* %5
%8 = load i64, i64* %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = add nsw i64 %8, %10
%12 = add nsw i64 %11, 1
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = add nsw i64 %12, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @skipGolombRice(i64 %0, i32 %1) {
%3 = tail call i32 @readUntilZero(i64 %0)
%4 = sext i32 %3 to i64
%5 = sext i32 %1 to i64
%6 = add i64 %0, 1
%7 = add i64 %6, %5
%8 = add i64 %7, %4
ret i64 %8
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void send_begin(struct ship *ship) { Write(37, ship, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<send_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x25,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_begin>:
mov    %rdi,%rsi
mov    $0x25,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_begin(%struct.ship* %0) {
%2 = alloca %struct.ship*
store %struct.ship* %0, %struct.ship** %2
%3 = load %struct.ship*, %struct.ship** %2
%4 = call i32 @Write(i32 37, %struct.ship* %3, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_begin(%struct.ship* %0) {
%2 = tail call i32 @Write(i32 37, %struct.ship* %0, i32 0, i32 0, i32 0, i32 0)
ret void
}
char *Q_stradd(char *dst, const char *src) {
  char c;
  while ((c = *src++) != '\0')
    *dst++ = c;
  *dst = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<Q_stradd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1145 <Q_stradd+0x45>
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <Q_stradd+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_stradd>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <Q_stradd+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <Q_stradd+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @Q_stradd(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
void boil(int primes[]) {
  int sum = 0;
  int i;
  for (i = 0; i < 6; i++) {
    sum += primes[i];
    primes[i] = sum;
  }
}


x86 assembly (clang, -O0):
<boil>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    114d <boil+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <boil+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<boil>:
mov    0x4(%rdi),%eax
add    (%rdi),%eax
mov    %eax,0x4(%rdi)
add    0x8(%rdi),%eax
mov    %eax,0x8(%rdi)
add    0xc(%rdi),%eax
mov    %eax,0xc(%rdi)
add    0x10(%rdi),%eax
mov    %eax,0x10(%rdi)
add    %eax,0x14(%rdi)
ret

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

LLVM IR (-O2):
define void @boil(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %2
store i32 %5, i32* %3
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = load i32, i32* %6
%8 = add nsw i32 %7, %5
store i32 %8, i32* %6
%9 = getelementptr inbounds i32, i32* %0, i64 3
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
store i32 %11, i32* %9
%12 = getelementptr inbounds i32, i32* %0, i64 4
%13 = load i32, i32* %12
%14 = add nsw i32 %13, %11
store i32 %14, i32* %12
%15 = getelementptr inbounds i32, i32* %0, i64 5
%16 = load i32, i32* %15
%17 = add nsw i32 %16, %14
store i32 %17, i32* %15
ret void
}
char *strrchr(const char *p, int c) {
  char *q = 0, c2;
  do {
    c2 = *p++;
    if (c == c2) {
      q = (char *)p;
    }
  } while (c2);
  return (q ? (q - 1) : 0);
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0xc(%rbp),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <strrchr+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1143 <strrchr+0x43>
cmpb   $0x0,-0x19(%rbp)
jne    1113 <strrchr+0x13>
cmpq   $0x0,-0x18(%rbp)
je     1169 <strrchr+0x69>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
jmp    1174 <strrchr+0x74>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1174 <strrchr+0x74>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
add    $0x1,%rdi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
movsbl -0x1(%rdi),%eax
cmp    %esi,%eax
cmove  %rdi,%rcx
add    $0x1,%rdi
test   %eax,%eax
jne    1110 <strrchr+0x10>
lea    -0x1(%rcx),%rax
test   %rcx,%rcx
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ null, %2 ], [ %10, %3 ]
%5 = phi i8* [ %0, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, %1
%10 = select i1 %9, i8* %6, i8* %4
%11 = icmp eq i8 %7, 0
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = icmp eq i8* %10, null
%14 = getelementptr inbounds i8, i8* %10, i64 -1
%15 = select i1 %13, i8* null, i8* %14
ret i8* %15
}
void test63_HelloWorld_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test63_HelloWorld_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int testTerm(void) {
  int fd;
  int ret;
  if ((fd = open("/dev/tty", O_RDWR)) < 0) {
    ret = 0;
  } else {
    ret = 1;
    close(fd);
  }
  return ret;
}


x86 assembly (clang, -O0):
<testTerm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1155 <testTerm+0x35>
movl   $0x0,-0x8(%rbp)
jmp    1164 <testTerm+0x44>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTerm>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
test   %eax,%eax
js     1148 <testTerm+0x28>
mov    %eax,%edi
call   1030 <close@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/tty\00"
@O_RDWR = global i32 0
define i32 @testTerm() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %2
br label %10
7: ; preds = %0
store i32 1, i32* %2
%8 = load i32, i32* %1
%9 = call i32 @close(i32 %8)
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/tty\00"
@O_RDWR = global i32 0
define i32 @testTerm() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ 1, %4 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int MYperror(char *where, int line, char *what) {
  fprintf(stderr, "%s,%d:", where, line);
  perror(what);
  fflush(stderr);
  fflush(stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<MYperror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <perror@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<MYperror>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2e8d(%rip),%r14
mov    (%r14),%edi
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    (%r14),%edi
call   1040 <fflush@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s,%d:\00"
@stdout = global i32 0
define i32 @MYperror(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
%11 = load i8*, i8** %6
%12 = call i32 @perror(i8* %11)
%13 = load i32, i32* @stderr
%14 = call i32 @fflush(i32 %13)
%15 = load i32, i32* @stdout
%16 = call i32 @fflush(i32 %15)
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s,%d:\00"
@stdout = global i32 0
define i32 @MYperror(i8* %0, i32 %1, i8* nocapture %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%6 = tail call i32 @perror(i8* %2)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double log(double);
double SDL_log(double x) { return log(x); }


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

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

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

LLVM IR (-O2):
define double @SDL_log(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("/usr/bin/g++ ./Main.cpp -lm -o Main 2>error.log");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"/usr/bin/g++ ./Main.cpp -lm -o Main 2>error.log\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @system(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"/usr/bin/g++ ./Main.cpp -lm -o Main 2>error.log\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float tanhf(float);
float intr_wrap_084(float p1) { return tanhf(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_084>:
jmp    1030 <tanhf@plt>

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

LLVM IR (-O2):
define float @intr_wrap_084(float %0) {
%2 = tail call float @tanhf(float %0)
ret float %2
}
VSetRedraw(f) int (*f)();
{}


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

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

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

LLVM IR (-O2):
define i32 @VSetRedraw(i32 (...)* nocapture readnone %0) {
ret i32 undef
}
int main() {
  char out = 0x55;
  __asm__("movl $0x42, %%eax; cmpl $0x24, %%eax; setc %%al" : "=a"(out));
  return out;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
mov    $0x42,%eax
cmp    $0x24,%eax
setb   %al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x42,%eax
cmp    $0x24,%eax
setb   %al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
%3 = call i8 asm "movl $$0x42, %eax; cmpl $$0x24, %eax; setc %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "movl $$0x42, %eax; cmpl $$0x24, %eax; setc %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = sext i8 %1 to i32
ret i32 %2
}
int xen_smp_intr_init_pv(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xen_smp_intr_init_pv(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ udd_attach();
void udc_attach(void) { udd_attach(); }


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

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

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

LLVM IR (-O2):
define void @udc_attach() {
%1 = tail call i32 (...) @udd_attach()
ret void
}
short find_sign(float number) {
  if (number < 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<find_sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1121 <find_sign+0x21>
movw   $0x1,-0x2(%rbp)
jmp    1127 <find_sign+0x27>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_sign>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define signext i16 @find_sign(float %0) {
%2 = alloca i16
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i16 1, i16* %2
br label %8
7: ; preds = %1
store i16 0, i16* %2
br label %8
8: ; preds = %7, %6
%9 = load i16, i16* %2
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @find_sign(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = zext i1 %2 to i16
ret i16 %3
}
int veccmp(int r, int v1[r], int v2[r]) {
  int flag;
  int j;
  for (j = 0; j < r; j++) {
    if (v1[j] > v2[j]) {
      flag = 0;
      break;
    } else {
      flag = 1;
    }
  }
  return flag;
}


x86 assembly (clang, -O0):
<veccmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1164 <veccmp+0x64>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    114a <veccmp+0x4a>
movl   $0x0,-0x1c(%rbp)
jmp    1164 <veccmp+0x64>
movl   $0x1,-0x1c(%rbp)
jmp    1156 <veccmp+0x56>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <veccmp+0x16>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<veccmp>:
mov    $0x1,%eax
test   %edi,%edi
jle    1121 <veccmp+0x21>
mov    %edi,%r8d
xor    %edi,%edi
xchg   %ax,%ax
mov    (%rsi,%rdi,4),%ecx
cmp    (%rdx,%rdi,4),%ecx
jg     1122 <veccmp+0x22>
add    $0x1,%rdi
cmp    %rdi,%r8
jne    1110 <veccmp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @veccmp(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %2, i64 %10
%14 = load i32, i32* %13
%15 = icmp sgt i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %17, label %7
17: ; preds = %7, %9, %3
%18 = phi i32 [ 1, %3 ], [ 0, %9 ], [ 1, %7 ]
ret i32 %18
}
int Rotate(unsigned int rotatee, int amount) {
  unsigned int mask, low, high;
  mask = (1 << amount) - 1;
  low = rotatee & mask;
  high = rotatee >> amount;
  rotatee = (low << (32 - amount)) | high;
  return rotatee;
}


x86 assembly (clang, -O0):
<Rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rotate>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @Rotate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 1, %8
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = and i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = lshr i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = sub nsw i32 32, %18
%20 = shl i32 %17, %19
%21 = load i32, i32* %7
%22 = or i32 %20, %21
store i32 %22, i32* %3
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @Rotate(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ has_il();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_int(int /*<<< orphan*/);
void cmd_has_il(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_int(has_il());
}


x86 assembly (clang, -O0):
<cmd_has_il>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_has_il+0x27>
jmp    117f <cmd_has_il+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1030 <has_il@plt>
mov    %eax,%edi
call   1060 <report_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_has_il>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_has_il+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1030 <has_il@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <report_int@plt>

LLVM IR (-O0):
define void @cmd_has_il(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @has_il()
%12 = call i32 @report_int(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_has_il(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @has_il()
%8 = tail call i32 @report_int(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pmu_set_sleep_clk(int, int, int, int);
void pmu_set_sleep_low() { pmu_set_sleep_clk(0x3, 0x1, 0x1, 0x2); }


x86 assembly (clang, -O0):
<pmu_set_sleep_low>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    %edx,%esi
call   1030 <pmu_set_sleep_clk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_sleep_low>:
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
jmp    1030 <pmu_set_sleep_clk@plt>

LLVM IR (-O0):
define void @pmu_set_sleep_low() {
%1 = call i32 @pmu_set_sleep_clk(i32 3, i32 1, i32 1, i32 2)
ret void
}

LLVM IR (-O2):
define void @pmu_set_sleep_low() {
%1 = tail call i32 @pmu_set_sleep_clk(i32 3, i32 1, i32 1, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ file32_to_cpu(int /*<<< orphan*/);
uint32_t struct_val_u32(char *ptr, unsigned int offset) {
  return (file32_to_cpu(*(uint32_t *)(ptr + offset)));
}


x86 assembly (clang, -O0):
<struct_val_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,1),%edi
call   1030 <file32_to_cpu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<struct_val_u32>:
mov    %esi,%eax
mov    (%rdi,%rax,1),%edi
jmp    1030 <file32_to_cpu@plt>

LLVM IR (-O0):
define i32 @struct_val_u32(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 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = call i32 @file32_to_cpu(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @struct_val_u32(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @file32_to_cpu(i32 %6)
ret i32 %7
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *xcalloc(size_t nmemb, size_t size) {
  void *ret = calloc(nmemb, size);
  if (ret == NULL)
    while (1)
      ;
  return ret;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <xcalloc+0x36>
jmp    1141 <xcalloc+0x31>
jmp    1141 <xcalloc+0x31>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     1120 <xcalloc+0x10>
pop    %rcx
ret
nopl   (%rax)
jmp    1120 <xcalloc+0x10>

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

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %2, %5
br label %5
6: ; preds = %2
ret i8* %3
}
void foo729(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo729(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t etna_cfloat_to_uint8(float f) {
  if (f <= 0.0f)
    return 0;
  if (f >= (1.0f - 1.0f / 256.0f))
    return 255;
  return f * 256.0f;
}


x86 assembly (clang, -O0):
<etna_cfloat_to_uint8>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1122 <etna_cfloat_to_uint8+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1158 <etna_cfloat_to_uint8+0x58>
movss  -0x8(%rbp),%xmm0
movss  0xed1(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1144 <etna_cfloat_to_uint8+0x44>
movl   $0xff,-0x4(%rbp)
jmp    1158 <etna_cfloat_to_uint8+0x58>
movss  0xeb8(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<etna_cfloat_to_uint8>:
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    1124 <etna_cfloat_to_uint8+0x24>
mov    $0xff,%eax
ucomiss 0xeea(%rip),%xmm0
jae    1124 <etna_cfloat_to_uint8+0x24>
mulss  0xee4(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @etna_cfloat_to_uint8(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %15
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp oge float %8, 0x3FEFE00000000000
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 255, i32* %2
br label %15
11: ; preds = %7
%12 = load float, float* %3
%13 = fmul float %12, 2.560000e+02
%14 = fptosi float %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @etna_cfloat_to_uint8(float %0) {
%2 = fcmp ugt float %0, 0.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fcmp ult float %0, 0x3FEFE00000000000
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = fmul float %0, 2.560000e+02
%7 = fptosi float %6 to i32
br label %8
8: ; preds = %3, %1, %5
%9 = phi i32 [ %7, %5 ], [ 0, %1 ], [ 255, %3 ]
ret i32 %9
}
void SSL_CTX_free(void) {}


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

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

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

LLVM IR (-O2):
define void @SSL_CTX_free() {
ret void
}
int hash(int key) { return (key % 10); }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = srem i32 %0, 10
ret i32 %2
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int sync() { return syscall(60, 0, 0); }


x86 assembly (clang, -O0):
<sync>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync>:
mov    $0x3c,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @sync() {
%1 = call i32 @syscall(i32 60, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @sync() {
%1 = tail call i32 @syscall(i32 60, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int strlen(char *);
char *corta_string(char *apuntador) {
  int i;
  i = strlen(apuntador);
  if (i > 0) {
    apuntador = apuntador + 1;
  } else {
    apuntador = "Error en cadena";
  }
  return apuntador;
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1143 <corta_string+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114e <corta_string+0x3e>
lea    0xeb6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    $0x1,%rbx
test   %eax,%eax
lea    0xeda(%rip),%rax
cmovg  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Error en cadena\00"
define i8* @corta_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = select i1 %3, i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpacklo_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_unpacklo_epi8(__m128i A, __m128i B) {
  return _mm_unpacklo_epi8(A, B);
}


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

x86 assembly (clang, -O2):
<test_mm_unpacklo_epi8>:
jmp    1030 <_mm_unpacklo_epi8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_unpacklo_epi8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpacklo_epi8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bios_init();
int /*<<< orphan*/ boot();
int /*<<< orphan*/ card();
int /*<<< orphan*/ draw_logo();
int /*<<< orphan*/ isr_init();
int /*<<< orphan*/ kbd_init();
int /*<<< orphan*/ pic_init();
int /*<<< orphan*/ post();
int /*<<< orphan*/ rom_init();
int /*<<< orphan*/ sdcard_init();
int /*<<< orphan*/ vga_init();
int main() {
  pic_init();
  isr_init();
  vga_init();
  kbd_init();
  rom_init();
  sdcard_init();
  bios_init();
  draw_logo();
  card();
  post();
  boot();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pic_init@plt>
mov    $0x0,%al
call   10c0 <isr_init@plt>
mov    $0x0,%al
call   1040 <vga_init@plt>
mov    $0x0,%al
call   1050 <kbd_init@plt>
mov    $0x0,%al
call   10b0 <rom_init@plt>
mov    $0x0,%al
call   10d0 <sdcard_init@plt>
mov    $0x0,%al
call   1090 <bios_init@plt>
mov    $0x0,%al
call   1070 <draw_logo@plt>
mov    $0x0,%al
call   10a0 <card@plt>
mov    $0x0,%al
call   1080 <post@plt>
mov    $0x0,%al
call   1060 <boot@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <pic_init@plt>
xor    %eax,%eax
call   10c0 <isr_init@plt>
xor    %eax,%eax
call   1040 <vga_init@plt>
xor    %eax,%eax
call   1050 <kbd_init@plt>
xor    %eax,%eax
call   10b0 <rom_init@plt>
xor    %eax,%eax
call   10d0 <sdcard_init@plt>
xor    %eax,%eax
call   1090 <bios_init@plt>
xor    %eax,%eax
call   1070 <draw_logo@plt>
xor    %eax,%eax
call   10a0 <card@plt>
xor    %eax,%eax
call   1080 <post@plt>
xor    %eax,%eax
call   1060 <boot@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @pic_init()
%3 = call i32 (...) @isr_init()
%4 = call i32 (...) @vga_init()
%5 = call i32 (...) @kbd_init()
%6 = call i32 (...) @rom_init()
%7 = call i32 (...) @sdcard_init()
%8 = call i32 (...) @bios_init()
%9 = call i32 (...) @draw_logo()
%10 = call i32 (...) @card()
%11 = call i32 (...) @post()
%12 = call i32 (...) @boot()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pic_init()
%2 = tail call i32 (...) @isr_init()
%3 = tail call i32 (...) @vga_init()
%4 = tail call i32 (...) @kbd_init()
%5 = tail call i32 (...) @rom_init()
%6 = tail call i32 (...) @sdcard_init()
%7 = tail call i32 (...) @bios_init()
%8 = tail call i32 (...) @draw_logo()
%9 = tail call i32 (...) @card()
%10 = tail call i32 (...) @post()
%11 = tail call i32 (...) @boot()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ command_EXECUTE(int, char *);
int /*<<< orphan*/ sleep(int /*<<< orphan*/);
void othello_SLEEP(char *t) {
  command_EXECUTE(2, "disconnect");
  sleep(atoi(t));
  command_EXECUTE(2, "connect");
}


x86 assembly (clang, -O0):
<othello_SLEEP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
lea    0xeb8(%rip),%rsi
call   1030 <command_EXECUTE@plt>
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <sleep@plt>
mov    $0x2,%edi
lea    0xe9a(%rip),%rsi
call   1030 <command_EXECUTE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<othello_SLEEP>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    $0x2,%edi
call   1030 <command_EXECUTE@plt>
mov    %rbx,%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <sleep@plt>
lea    0xea8(%rip),%rsi
mov    $0x2,%edi
pop    %rbx
jmp    1030 <command_EXECUTE@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"disconnect\00"
@.str.1 = [8 x i8] c"connect\00"
define void @othello_SLEEP(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @command_EXECUTE(i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @atoi(i8* %4)
%6 = call i32 @sleep(i32 %5)
%7 = call i32 @command_EXECUTE(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"disconnect\00"
@.str.1 = [8 x i8] c"connect\00"
define void @othello_SLEEP(i8* nocapture %0) {
%2 = tail call i32 @command_EXECUTE(i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @atoi(i8* %0)
%4 = tail call i32 @sleep(i32 %3)
%5 = tail call i32 @command_EXECUTE(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int f2(void) { puts("World!"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"World!\00"
define i32 @f2() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"World!\00"
define i32 @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ beginTrans(int /*<<< orphan*/);
int /*<<< orphan*/ commitTrans();
int doRemoveAlert(int);
int /*<<< orphan*/ rollbackTrans();
int removeAlert(int id) {
  beginTrans(0);
  int status = doRemoveAlert(id);
  if (status == 1) {
    commitTrans();
  } else {
    rollbackTrans();
  }
  return status;
}


x86 assembly (clang, -O0):
<removeAlert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1060 <beginTrans@plt>
mov    -0x4(%rbp),%edi
call   1030 <doRemoveAlert@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1173 <removeAlert+0x33>
mov    $0x0,%al
call   1040 <commitTrans@plt>
jmp    117a <removeAlert+0x3a>
mov    $0x0,%al
call   1050 <rollbackTrans@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeAlert>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1060 <beginTrans@plt>
mov    %ebx,%edi
call   1030 <doRemoveAlert@plt>
mov    %eax,%ebx
cmp    $0x1,%eax
jne    1161 <removeAlert+0x21>
xor    %eax,%eax
call   1040 <commitTrans@plt>
jmp    1168 <removeAlert+0x28>
xor    %eax,%eax
call   1050 <rollbackTrans@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @removeAlert(i32 %0) {
%2 = tail call i32 @beginTrans(i32 0)
%3 = tail call i32 @doRemoveAlert(i32 %0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @commitTrans()
br label %9
7: ; preds = %1
%8 = tail call i32 (...) @rollbackTrans()
br label %9
9: ; preds = %7, %5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void drawHash(int n) {
  int hash_num = (2 * n) - 1;
  int i;
  for (i = 0; i < hash_num; i++) {
    printf("#");
  }
}


x86 assembly (clang, -O0):
<drawHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1154 <drawHash+0x44>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <drawHash+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawHash>:
push   %rbx
test   %edi,%edi
jle    113f <drawHash+0x2f>
lea    (%rdi,%rdi,1),%eax
add    $0xffffffff,%eax
cmp    $0x2,%eax
mov    $0x1,%ebx
cmovge %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <drawHash+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @drawHash(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = shl nuw nsw i32 %0, 1
%5 = add i32 %4, -1
%6 = call i32 @llvm.smax.i32(i32 %5, i32 1)
br label %7
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ 0, %3 ]
%9 = tail call i32 @putchar(i32 35)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %6
br i1 %11, label %12, label %7
12: ; preds = %7, %1
ret void
}
char get_rank_chr(int rank_int) {
  if (rank_int >= 0 && rank_int <= 7)
    return (char)('1' + (7 - rank_int));
  return '\0';
}


x86 assembly (clang, -O0):
<get_rank_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112e <get_rank_chr+0x2e>
cmpl   $0x7,-0x8(%rbp)
jg     112e <get_rank_chr+0x2e>
mov    $0x7,%eax
sub    -0x8(%rbp),%eax
add    $0x31,%eax
mov    %al,-0x1(%rbp)
jmp    1132 <get_rank_chr+0x32>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rank_chr>:
mov    $0x38,%al
sub    %dil,%al
xor    %ecx,%ecx
cmp    $0x8,%edi
movzbl %al,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @get_rank_chr(i32 %0) {
%2 = icmp ult i32 %0, 8
%3 = trunc i32 %0 to i8
%4 = sub i8 56, %3
%5 = select i1 %2, i8 %4, i8 0
ret i8 %5
}