xunge/DecIR huggingface dataset:
int tstat_next_pckt(struct timeval *pckt_time, void *ip_hdr, void *last_ip_byte,
                    int tlen, int ip_direction) {
  return 0;
}


x86 assembly (clang, -O0):
<tstat_next_pckt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type opaque
define i32 @tstat_next_pckt(%struct.timeval* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca %struct.timeval*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store %struct.timeval* %0, %struct.timeval** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type opaque
define i32 @tstat_next_pckt(%struct.timeval* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mustWriteFd(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void sendFtpCommandOnly(int sd, char *cmd) {
  mustWriteFd(sd, cmd, strlen(cmd));
}


x86 assembly (clang, -O0):
<sendFtpCommandOnly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <mustWriteFd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendFtpCommandOnly>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <mustWriteFd@plt>

LLVM IR (-O0):
define void @sendFtpCommandOnly(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 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @mustWriteFd(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @sendFtpCommandOnly(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @mustWriteFd(i32 %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ rechist();
void phup(int sig) {
  rechist();
  exit(1);
}


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

x86 assembly (clang, -O2):
<phup>:
push   %rax
xor    %eax,%eax
call   1040 <rechist@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @phup(i32 %0) {
%2 = tail call i32 (...) @rechist()
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void eabort(int i) { exit(i); }


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

x86 assembly (clang, -O2):
<eabort>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @eabort(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: toperf pebs-ip-file elffile...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: toperf pebs-ip-file elffile...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: toperf pebs-ip-file elffile...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ x54x_inw(int, void *);
uint16_t x54x_readw(uint32_t port, void *priv) {
  return (x54x_inw(port & 3, priv));
}


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

x86 assembly (clang, -O2):
<x54x_readw>:
and    $0x3,%edi
jmp    1030 <x54x_inw@plt>

LLVM IR (-O0):
define i32 @x54x_readw(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 = and i32 %5, 3
%7 = load i8*, i8** %4
%8 = call i32 @x54x_inw(i32 %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @x54x_readw(i32 %0, i8* %1) {
%3 = and i32 %0, 3
%4 = tail call i32 @x54x_inw(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c;
  scanf("%d", &a);
  b = a * a;
  c = a * a * a;
  printf("\n%d\n", b);
  printf("\n%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xebb(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int main() {
  __attribute__((__vector_size__(16))) float v;
  v;
  v[0];
  -v;
  v + v;
  return 0;
}


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
%2 = alloca <4 x float>
store i32 0, i32* %1
%3 = load <4 x float>, <4 x float>* %2
%4 = load <4 x float>, <4 x float>* %2
%5 = extractelement <4 x float> %4, i32 0
%6 = load <4 x float>, <4 x float>* %2
%7 = fneg <4 x float> %6
%8 = load <4 x float>, <4 x float>* %2
%9 = load <4 x float>, <4 x float>* %2
%10 = fadd <4 x float> %8, %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void copy(char to[], char from[]) {
  while (*to++ = *from++)
    ;
}


x86 assembly (clang, -O0):
<copy>:
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    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <copy+0x3b>
jmp    110c <copy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
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 <copy+0x10>
ret

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

LLVM IR (-O2):
define void @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
void e_outfloat(width, where) int width;
char *where;
{
  register char *c;
  for (c = where; c < where + width; c++)
    *c = '*';
}


x86 assembly (clang, -O0):
<e_outfloat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x4(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1143 <e_outfloat+0x43>
mov    -0x18(%rbp),%rax
movb   $0x2a,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <e_outfloat+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_outfloat>:
test   %edi,%edi
jle    1139 <e_outfloat+0x29>
push   %rax
mov    %edi,%edx
add    %rsi,%rdx
lea    0x1(%rsi),%rax
cmp    %rax,%rdx
cmovbe %rax,%rdx
sub    %rsi,%rdx
mov    %rsi,%rdi
mov    $0x2a,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @e_outfloat(i32 %0, i8* writeonly %1) {
%3 = ptrtoint i8* %1 to i64
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = zext i32 %0 to i64
%7 = add i64 %3, %6
%8 = add i64 %3, 1
%9 = call i64 @llvm.umax.i64(i64 %7, i64 %8)
%10 = sub i64 %9, %3
br label %11
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
int getchar();
scalar_t__ kbhit();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  if (kbhit()) {
    printf("You pressed '%c'!\n", getchar());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <kbhit@plt>
cmp    $0x0,%rax
je     1165 <main+0x35>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <kbhit@plt>
test   %rax,%rax
je     1152 <main+0x22>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"You pressed '%c'!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @kbhit()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 (...) @getchar()
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"You pressed '%c'!\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @kbhit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_DisplayScore(void) { WriteInstruction("call dscore"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"call dscore\00"
define void @CR_DisplayScore() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"call dscore\00"
define void @CR_DisplayScore() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count(int, int);
void main() {
  int b = 1, c = 2;
  {
    int a = 3, c = 4;
    count(a, c);
  }
  count(b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <count@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <count@plt>
mov    $0x1,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <count@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 4, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @count(i32 %5, i32 %6)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @count(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @count(i32 3, i32 4)
%2 = tail call i32 @count(i32 1, i32 2)
ret void
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int opng_sigs_cmp(const void *sig1, const void *sig2) {
  return memcmp(sig1, sig2, 4);
}


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

x86 assembly (clang, -O2):
<opng_sigs_cmp>:
mov    $0x4,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @opng_sigs_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 4)
ret i32 %3
}
int main() {
  if (1) {
  }
  while (2) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void dealloc_uivector(unsigned int *v, unsigned int nh) { free((char *)v); }


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

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

LLVM IR (-O0):
define void @dealloc_uivector(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 = bitcast i32* %5 to i8*
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @dealloc_uivector(i32* nocapture %0, i32 %1) {
%3 = bitcast i32* %0 to i8*
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ free_board();
int /*<<< orphan*/ init_board(int);
bool sgf_size(char *value) {
  int board_size;
  board_size = atoi(value);
  if (board_size < 2 || board_size > 21) {
    return false;
  }
  free_board();
  init_board(board_size);
  return true;
}


x86 assembly (clang, -O0):
<sgf_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jl     115c <sgf_size+0x2c>
cmpl   $0x15,-0x14(%rbp)
jle    1168 <sgf_size+0x38>
movl   $0x0,-0x4(%rbp)
jmp    117e <sgf_size+0x4e>
mov    $0x0,%al
call   1040 <free_board@plt>
mov    -0x14(%rbp),%edi
call   1030 <init_board@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgf_size>:
push   %rbx
call   1050 <atoi@plt>
mov    %eax,%ebx
lea    -0x16(%rbx),%ecx
xor    %eax,%eax
cmp    $0xffffffec,%ecx
jb     1155 <sgf_size+0x25>
xor    %eax,%eax
call   1040 <free_board@plt>
mov    %ebx,%edi
call   1030 <init_board@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sgf_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @atoi(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 21
br i1 %11, label %12, label %13
12: ; preds = %9, %1
store i32 0, i32* %2
br label %17
13: ; preds = %9
%14 = call i32 (...) @free_board()
%15 = load i32, i32* %4
%16 = call i32 @init_board(i32 %15)
store i32 1, i32* %2
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @sgf_size(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = add i32 %2, -22
%4 = icmp ult i32 %3, -20
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 (...) @free_board()
%7 = tail call i32 @init_board(i32 %2)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memory_bailout();
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *xstrndup(char *str, size_t len) {
  char *newstr;
  if ((newstr = malloc(len + 1)) == NULL)
    memory_bailout();
  (void)strncpy(newstr, str, len);
  newstr[len] = '\0';
  return (newstr);
}


x86 assembly (clang, -O0):
<xstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1162 <xstrndup+0x32>
mov    $0x0,%al
call   1030 <memory_bailout@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <xstrndup+0x23>
xor    %eax,%eax
call   1030 <memory_bailout@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @memory_bailout()
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %1)
%10 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %10
ret i8* %4
}
double DegToRad(double deg) {
  return deg * (3.14159265358979323846264338327950288 / 180.0);
}


x86 assembly (clang, -O0):
<DegToRad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DegToRad>:
mulsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @DegToRad(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529D39
ret double %2
}
/* Variables and functions */
double atan(double);
double r2a_rect(double R, double K) { return atan(R); }


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

x86 assembly (clang, -O2):
<r2a_rect>:
jmp    1030 <atan@plt>

LLVM IR (-O0):
define double @r2a_rect(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @atan(double %5)
ret double %6
}

LLVM IR (-O2):
define double @r2a_rect(double %0, double %1) {
%3 = tail call double @atan(double %0)
ret double %3
}
int debug_time() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @debug_time() {
ret i32 0
}
/* Variables and functions */
size_t BarReadlinePrevUtf8(char *ptr) {
  size_t i = 0;
  do {
    ++i;
    --ptr;
  } while ((*ptr & (1 << 7)) && !(*ptr & (1 << 6)));
  return i;
}


x86 assembly (clang, -O0):
<BarReadlinePrevUtf8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1158 <BarReadlinePrevUtf8+0x58>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1110 <BarReadlinePrevUtf8+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BarReadlinePrevUtf8>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl -0x1(%rdi,%rax,1),%ecx
and    $0xc0,%cl
add    $0xffffffffffffffff,%rax
cmp    $0x80,%cl
je     1110 <BarReadlinePrevUtf8+0x10>
neg    %rax
ret

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

LLVM IR (-O2):
define i64 @BarReadlinePrevUtf8(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = phi i64 [ 0, %1 ], [ %5, %2 ]
%5 = add i64 %4, 1
%6 = getelementptr inbounds i8, i8* %3, i64 -1
%7 = load i8, i8* %6
%8 = and i8 %7, -64
%9 = icmp eq i8 %8, -128
br i1 %9, label %2, label %10
10: ; preds = %2
ret i64 %5
}
/* Variables and functions */
int is_category_Zs(unsigned int);
bool is_property_space(unsigned int ch) { return is_category_Zs(ch); }


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

x86 assembly (clang, -O2):
<is_property_space>:
jmp    1030 <is_category_Zs@plt>

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

LLVM IR (-O2):
define i32 @is_property_space(i32 %0) {
%2 = tail call i32 @is_category_Zs(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ indigoFree(int);
int indigoLoadReactionSmarts(int);
int indigoReadFile(char const *);
__attribute__((visibility("default"))) int
indigoLoadReactionSmartsFromFile(const char *filename) {
  int source = indigoReadFile(filename);
  int result;
  if (source <= 0)
    return -1;
  result = indigoLoadReactionSmarts(source);
  indigoFree(source);
  return result;
}


x86 assembly (clang, -O0):
<indigoLoadReactionSmartsFromFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <indigoReadFile@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     115e <indigoLoadReactionSmartsFromFile+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <indigoLoadReactionSmartsFromFile+0x47>
mov    -0x14(%rbp),%edi
call   1050 <indigoLoadReactionSmarts@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <indigoFree@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indigoLoadReactionSmartsFromFile>:
push   %rbp
push   %rbx
push   %rax
call   1030 <indigoReadFile@plt>
test   %eax,%eax
jle    1152 <indigoLoadReactionSmartsFromFile+0x22>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <indigoLoadReactionSmarts@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <indigoFree@plt>
mov    %ebp,%eax
jmp    1157 <indigoLoadReactionSmartsFromFile+0x27>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @indigoLoadReactionSmartsFromFile(i8* %0) {
%2 = tail call i32 @indigoReadFile(i8* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @indigoLoadReactionSmarts(i32 %2)
%6 = tail call i32 @indigoFree(i32 %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ matNf_getColumn(float *, float const *, int const, int);
void mat4f_getColumn(float result[4], const float m[16], const int col) {
  matNf_getColumn(result, m, col, 4);
}


x86 assembly (clang, -O0):
<mat4f_getColumn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x4,%ecx
call   1030 <matNf_getColumn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4f_getColumn>:
mov    $0x4,%ecx
jmp    1030 <matNf_getColumn@plt>

LLVM IR (-O0):
define void @mat4f_getColumn(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load float*, float** %5
%9 = load i32, i32* %6
%10 = call i32 @matNf_getColumn(float* %7, float* %8, i32 %9, i32 4)
ret void
}

LLVM IR (-O2):
define void @mat4f_getColumn(float* %0, float* %1, i32 %2) {
%4 = tail call i32 @matNf_getColumn(float* %0, float* %1, i32 %2, i32 4)
ret void
}
double add_double(double arg1, double arg2) { return arg1 + arg2; }


x86 assembly (clang, -O0):
<add_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_double>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @add_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @add_double(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
char *which_path(char const *, int /*<<< orphan*/);
char *which(const char *name) { return which_path(name, getenv("PATH")); }


x86 assembly (clang, -O0):
<which>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <which_path@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<which>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <which_path@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"PATH\00"
define i8* @which(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i8* @which_path(i8* %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [5 x i8] c"PATH\00"
define i8* @which(i8* %0) {
%2 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @which_path(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
void noop_free(void *el) {
  if (el != NULL)
    el = NULL;
}


x86 assembly (clang, -O0):
<noop_free>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111b <noop_free+0x1b>
movq   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @noop_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8* null, i8** %2
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @noop_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_plend();
int /*<<< orphan*/ c_plfont(int);
int /*<<< orphan*/ c_plinit();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ plot1(int);
int /*<<< orphan*/ plparseopts(int *, char **, int);
int main(int argc, char *argv[]) {
  (void)plparseopts(&argc, argv, 0x0001);
  c_plinit();
  c_plfont(2);
  plot1(0);
  plot1(1);
  c_plend();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
mov    $0x1,%edx
call   1050 <plparseopts@plt>
mov    $0x0,%al
call   1060 <c_plinit@plt>
mov    $0x2,%edi
call   1030 <c_plfont@plt>
xor    %edi,%edi
call   1040 <plot1@plt>
mov    $0x1,%edi
call   1040 <plot1@plt>
mov    $0x0,%al
call   1080 <c_plend@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%edx
call   1050 <plparseopts@plt>
xor    %eax,%eax
call   1060 <c_plinit@plt>
mov    $0x2,%edi
call   1030 <c_plfont@plt>
xor    %edi,%edi
call   1040 <plot1@plt>
mov    $0x1,%edi
call   1040 <plot1@plt>
xor    %eax,%eax
call   1080 <c_plend@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = call i32 @plparseopts(i32* %4, i8** %6, i32 1)
%8 = call i32 (...) @c_plinit()
%9 = call i32 @c_plfont(i32 2)
%10 = call i32 @plot1(i32 0)
%11 = call i32 @plot1(i32 1)
%12 = call i32 (...) @c_plend()
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @plparseopts(i32* %3, i8** %1, i32 1)
%5 = call i32 (...) @c_plinit()
%6 = call i32 @c_plfont(i32 2)
%7 = call i32 @plot1(i32 0)
%8 = call i32 @plot1(i32 1)
%9 = call i32 (...) @c_plend()
%10 = call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int cd_os_timespec_set_zero(struct timespec *t) {
  t->tv_sec = 0;
  t->tv_nsec = 0;
  return 0;
}


x86 assembly (clang, -O0):
<cd_os_timespec_set_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_os_timespec_set_zero>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @cd_os_timespec_set_zero(%struct.timespec* nocapture writeonly %0) {
%2 = bitcast %struct.timespec* %0 to i8*
ret i32 0
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int ioctl(int, int, void *);
int xioctl(int fd, int request, void *arg) {
  int r = 0;
  do {
    r = ioctl(fd, request, arg);
  } while (-1 == r && EINTR == errno);
  return r;
}


x86 assembly (clang, -O0):
<xioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    -0x14(%rbp),%ecx
mov    %al,-0x15(%rbp)
jne    1168 <xioctl+0x58>
mov    0x2e83(%rip),%rax
mov    (%rax),%rax
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1129 <xioctl+0x19>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xioctl>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eb2(%rip),%r15
mov    0x2eb3(%rip),%r12
nopl   (%rax)
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    114a <xioctl+0x3a>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <xioctl+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EINTR = global i64 0
@errno = global i64 0
define i32 @xioctl(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @ioctl(i32 %9, i32 %10, i8* %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp eq i32 -1, %14
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @EINTR
%18 = load i64, i64* @errno
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@EINTR = global i64 0
@errno = global i64 0
define i32 @xioctl(i32 %0, i32 %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @ioctl(i32 %0, i32 %1, i8* %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @EINTR
%8 = load i64, i64* @errno
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
void remove_space_after_prefix(char *str) {
  int i;
  if (str[2] == ' ') {
    for (i = 2; str[i] != '\0'; i++)
      str[i] = str[i + 1];
  }
}


x86 assembly (clang, -O0):
<remove_space_after_prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x20,%eax
jne    1163 <remove_space_after_prefix+0x63>
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115e <remove_space_after_prefix+0x5e>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1120 <remove_space_after_prefix+0x20>
jmp    1163 <remove_space_after_prefix+0x63>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_space_after_prefix>:
cmpb   $0x20,0x2(%rdi)
jne    111e <remove_space_after_prefix+0x1e>
add    $0x3,%rdi
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
mov    %al,-0x1(%rdi)
add    $0x1,%rdi
test   %al,%al
jne    1110 <remove_space_after_prefix+0x10>
ret

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

LLVM IR (-O2):
define void @remove_space_after_prefix(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 32
br i1 %4, label %5, label %13
5: ; preds = %1, %5
%6 = phi i64 [ %8, %5 ], [ 2, %1 ]
%7 = phi i8* [ %9, %5 ], [ %2, %1 ]
%8 = add nuw nsw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
store i8 %10, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
ret void
}
/* Variables and functions */
char *mod_gzip_strcpy(char *, char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char *x;
  char *y;
  y = mod_gzip_strcpy(x, "/tmp/");
  puts(y);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1040 <mod_gzip_strcpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <mod_gzip_strcpy@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"/tmp/\00"
define i32 @main() {
%1 = tail call i8* @mod_gzip_strcpy(i8* undef, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) %1)
ret i32 1
}
/* Variables and functions */
int setenv(char const *, char *, int /*<<< orphan*/);
int unsetenv(const char *name) { return setenv(name, "", 0); }


x86 assembly (clang, -O0):
<unsetenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
xor    %edx,%edx
call   1030 <setenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsetenv>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
jmp    1030 <setenv@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @unsetenv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @setenv(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %4
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @unsetenv(i8* %0) {
%2 = tail call i32 @setenv(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %2
}
void do_invalid_opcode(void *x) {
  do {
    kprintf("Unsupport Now...[%s]\n", __FUNCTION__);
    while (1)
      ;
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<do_invalid_opcode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1030 <kprintf@plt>
jmp    1131 <do_invalid_opcode+0x21>

x86 assembly (clang, -O2):
<do_invalid_opcode>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef7(%rip),%rsi
xor    %eax,%eax
call   1030 <kprintf@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1130 <do_invalid_opcode+0x20>

LLVM IR (-O0):
@.str = [22 x i8] c"Unsupport Now...[%s]\0A\00"
@__FUNCTION__.do_invalid_opcode = [18 x i8] c"do_invalid_opcode\00"
define void @do_invalid_opcode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.do_invalid_opcode, i64 0, i64 0))
br label %5
5: ; preds = %3, %5
br label %5
6: ; No predecessors!
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Unsupport Now...[%s]\0A\00"
@__FUNCTION__.do_invalid_opcode = [18 x i8] c"do_invalid_opcode\00"
define void @do_invalid_opcode(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.do_invalid_opcode, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
int exynos_dpi_probe(struct device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @exynos_dpi_probe(%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 @exynos_dpi_probe(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *sat_malloc(size_t);
int /*<<< orphan*/ sat_oom(size_t, size_t);
void *sat_malloc2(size_t num, size_t len) {
  if (len && (num * len) / len != num)
    sat_oom(num, len);
  return sat_malloc(num * len);
}


x86 assembly (clang, -O0):
<sat_malloc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1163 <sat_malloc2+0x43>
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    -0x8(%rbp),%rax
je     1163 <sat_malloc2+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <sat_oom@plt>
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <sat_malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_malloc2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     1142 <sat_malloc2+0x22>
mov    %rbx,%rax
mul    %r14
jno    1142 <sat_malloc2+0x22>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <sat_oom@plt>
imul   %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sat_malloc@plt>

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

LLVM IR (-O2):
define i8* @sat_malloc2(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%6 = extractvalue { i64, i1 } %5, 1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @sat_oom(i64 %0, i64 %1)
br label %9
9: ; preds = %7, %4, %2
%10 = mul i64 %1, %0
%11 = tail call i8* @sat_malloc(i64 %10)
ret i8* %11
}