xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ issafediv(int, int);
int safediv(int x, int y) {
  if (!issafediv(x, y)) {
    error("safediv");
  }
  return x / y;
}


x86 assembly (clang, -O0):
<safediv>:
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 <issafediv@plt>
cmp    $0x0,%eax
jne    114e <safediv+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <error@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safediv>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <issafediv@plt>
test   %eax,%eax
jne    113c <safediv+0x1c>
lea    0xec9(%rip),%rdi
call   1040 <error@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"safediv\00"
define i32 @safediv(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 @issafediv(i32 %5, i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sdiv i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@.str = [8 x i8] c"safediv\00"
define i32 @safediv(i32 %0, i32 %1) {
%3 = tail call i32 @issafediv(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = sdiv i32 %0, %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a = 4;
  switch (a) {
  case 1:
  case 2:
  case 3:
    switch (a) {
    case 4:
      printf("inner switch 4\n");
    default:
      break;
    }
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x2,%eax
ja     1161 <main+0x51>
jmp    113a <main+0x2a>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
jne    1157 <main+0x47>
jmp    114b <main+0x3b>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    115c <main+0x4c>
jmp    1166 <main+0x56>
jmp    1166 <main+0x56>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int yyerror(char const *message) {
  fputs(message, stderr);
  fputc('\n', stderr);
  return 0;
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
define i32 @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputc(i8 signext 10, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputc(i8 signext 10, i32 %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncat(char *, char const *, scalar_t__);
void al_string_cat(char *dst, const char *str, const int maxlen) {
  strncat(dst, str, maxlen - strlen(dst));
  dst[maxlen - 1] = '\0';
}


x86 assembly (clang, -O0):
<al_string_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0x14(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
sub    %rax,%rdx
call   1040 <strncat@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<al_string_cat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movslq %edx,%r15
call   1030 <strlen@plt>
mov    %r15,%rdx
sub    %rax,%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strncat@plt>
movb   $0x0,-0x1(%r15,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @al_string_cat(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = load i8*, i8** %4
%12 = call i64 @strlen(i8* %11)
%13 = sub nsw i64 %10, %12
%14 = call i32 @strncat(i8* %7, i8* %8, i64 %13)
%15 = load i8*, i8** %4
%16 = load i32, i32* %6
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
ret void
}

LLVM IR (-O2):
define void @al_string_cat(i8* %0, i8* %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = sub nsw i64 %4, %5
%7 = tail call i32 @strncat(i8* %0, i8* %1, i64 %6)
%8 = add nsw i32 %2, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int ad_get_token(int, int, int /*<<< orphan*/, int);
int cmd_get_tocken(int dev, uint16_t addr) {
  return ad_get_token(1, dev, addr, 1);
}


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

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

LLVM IR (-O0):
define i32 @cmd_get_tocken(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 @ad_get_token(i32 1, i32 %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cmd_get_tocken(i32 %0, i32 %1) {
%3 = tail call i32 @ad_get_token(i32 1, i32 %0, i32 %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_deinterleave() {
  printf("NOT IMPLEMENTED:"
         "pa_deinterleave"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_deinterleave\0A\00"
define i32 @pa_deinterleave() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_deinterleave\00"
define i32 @pa_deinterleave() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned char inb(unsigned int);
int /*<<< orphan*/ outb(unsigned char, unsigned int);
int smbus_wait(unsigned int);
int smbus_send_command(unsigned smbus_io_base, unsigned char command) {
  unsigned char val;
  outb(command, smbus_io_base + 0x00);
  val = inb(smbus_io_base + 0x01);
  if (((val & (0x01 << 5)) != 0) || ((val & (0x01 << 4)) != 0))
    return -1;
  return smbus_wait(smbus_io_base);
}


x86 assembly (clang, -O0):
<smbus_send_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%esi
add    $0x0,%esi
movzbl %al,%edi
call   1030 <outb@plt>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1050 <inb@plt>
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1180 <smbus_send_command+0x50>
movzbl -0xa(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     118c <smbus_send_command+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1197 <smbus_send_command+0x67>
mov    -0x8(%rbp),%edi
call   1040 <smbus_wait@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_send_command>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
lea    0x1(%rbx),%edi
call   1050 <inb@plt>
test   $0x30,%al
je     114f <smbus_send_command+0x1f>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1040 <smbus_wait@plt>

LLVM IR (-O0):
define i32 @smbus_send_command(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%7 = load i8, i8* %5
%8 = load i32, i32* %4
%9 = add i32 %8, 0
%10 = call i32 @outb(i8 zeroext %7, i32 %9)
%11 = load i32, i32* %4
%12 = add i32 %11, 1
%13 = call zeroext i8 @inb(i32 %12)
store i8 %13, i8* %6
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = and i32 %15, 32
%17 = icmp ne i32 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %2
%19 = load i8, i8* %6
%20 = zext i8 %19 to i32
%21 = and i32 %20, 16
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %18, %2
store i32 -1, i32* %3
br label %27
24: ; preds = %18
%25 = load i32, i32* %4
%26 = call i32 @smbus_wait(i32 %25)
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %23
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @smbus_send_command(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @outb(i8 zeroext %1, i32 %0)
%4 = add i32 %0, 1
%5 = tail call zeroext i8 @inb(i32 %4)
%6 = and i8 %5, 48
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @smbus_wait(i32 %0)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %9, %8 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
long long osfreq();
long long pqcpucycles_impl_persecond(void) { return osfreq(); }


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

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

LLVM IR (-O0):
define i64 @pqcpucycles_impl_persecond() {
%1 = call i64 (...) @osfreq()
ret i64 %1
}

LLVM IR (-O2):
define i64 @pqcpucycles_impl_persecond() {
%1 = tail call i64 (...) @osfreq()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int, int, int, int, int, int, int);
int main() {
  foo(1, 1, 1, 1, 1, 1, 1, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x1,(%rsp)
movl   $0x1,0x8(%rsp)
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
push   $0x1
push   $0x1
call   1030 <foo@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Meu primeiro programa"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Meu primeiro programa\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Meu primeiro programa\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int h1_char(const void *key) { return *(const char *)key % 11; }


x86 assembly (clang, -O0):
<h1_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h1_char>:
movsbl (%rdi),%eax
imul   $0xffffffbb,%eax,%ecx
shr    $0x8,%ecx
add    %al,%cl
mov    %ecx,%edx
shr    $0x7,%dl
sar    $0x3,%cl
add    %dl,%cl
movzbl %cl,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,2),%ecx
sub    %cl,%al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @h1_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = srem i32 %5, 11
ret i32 %6
}

LLVM IR (-O2):
define i32 @h1_char(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = srem i8 %2, 11
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int x = 76;
  printf("align for %d is %d\n", x, (((int)(x) + ((4) - 1)) & ~((4) - 1)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4c,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
add    $0x3,%edx
and    $0xfffffffc,%edx
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x4c,%esi
mov    $0x4c,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"align for %d is %d\0A\00"
define void @main() {
%1 = alloca i32
store i32 76, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 3
%5 = and i32 %4, -4
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"align for %d is %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 76, i32 76)
ret void
}
int compare(const void *pa, const void *pb) {
  int a, b;
  a = *((int *)pa);
  b = *((int *)pb);
  if (a > b)
    return 1;
  else if (a == b)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1136 <compare+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <compare+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <compare+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <compare+0x55>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ILibLinkedList_AddTail(void *, void *);
void ILibQueue_EnQueue(void *q, void *data) { ILibLinkedList_AddTail(q, data); }


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

x86 assembly (clang, -O2):
<ILibQueue_EnQueue>:
jmp    1030 <ILibLinkedList_AddTail@plt>

LLVM IR (-O0):
define void @ILibQueue_EnQueue(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 @ILibLinkedList_AddTail(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @ILibQueue_EnQueue(i8* %0, i8* %1) {
%3 = tail call i32 @ILibLinkedList_AddTail(i8* %0, i8* %1)
ret void
}
void gdk_gc_set_stipple() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_set_stipple() {
ret void
}
int test_imm_B1int8_reg(signed char val) {
  return ((val) & (0xB1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B1int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xb1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_B1int8_reg(i8 signext %0) {
%2 = and i8 %0, -79
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double fabs(double);
int dblcmp(double v1, double v2) {
  if (fabs(v1 - v2) <= 0.00001) {
    return 0;
  } else if (v1 > v2) {
    return 1;
  } else if (v1 < v2) {
    return -1;
  }
  return -2;
}


x86 assembly (clang, -O0):
<dblcmp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xef1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1141 <dblcmp+0x41>
movl   $0x0,-0x4(%rbp)
jmp    118e <dblcmp+0x8e>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    115d <dblcmp+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    118e <dblcmp+0x8e>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    117d <dblcmp+0x7d>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <dblcmp+0x8e>
jmp    1182 <dblcmp+0x82>
jmp    1187 <dblcmp+0x87>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblcmp>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
andpd  0xef0(%rip),%xmm2
xor    %eax,%eax
movsd  0xef6(%rip),%xmm3
ucomisd %xmm2,%xmm3
jae    1137 <dblcmp+0x37>
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     1137 <dblcmp+0x37>
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
or     $0xfffffffe,%eax
ret

LLVM IR (-O0):
define i32 @dblcmp(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = call double @llvm.fabs.f64(double %8)
%10 = fcmp ole double %9, 1.000000e-05
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %25
12: ; preds = %2
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fcmp ogt double %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %3
br label %25
17: ; preds = %12
%18 = load double, double* %4
%19 = load double, double* %5
%20 = fcmp olt double %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 -1, i32* %3
br label %25
22: ; preds = %17
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23
store i32 -2, i32* %3
br label %25
25: ; preds = %24, %21, %16, %11
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @dblcmp(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp ugt double %4, 1.000000e-05
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = fcmp ogt double %0, %1
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = fcmp olt double %0, %1
%10 = select i1 %9, i32 -1, i32 -2
br label %11
11: ; preds = %8, %6, %2
%12 = phi i32 [ 0, %2 ], [ 1, %6 ], [ %10, %8 ]
ret i32 %12
}
void clear_array(char *array, int length) {
  int i;
  for (i = 0; i < length; i++)
    array[i] = 0;
}


x86 assembly (clang, -O0):
<clear_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <clear_array+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clear_array+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_array>:
test   %esi,%esi
jle    1122 <clear_array+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear_array(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
struct utmp {
  int /*<<< orphan*/ ut_line;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ login(struct utmp *);
int /*<<< orphan*/ logout(int /*<<< orphan*/);
void foo(void) {
  struct utmp ut = {0};
  login(&ut);
  logout(ut.ut_line);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x8(%rbp),%rdi
call   1050 <login@plt>
mov    -0x8(%rbp),%edi
call   1030 <logout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1040 <login@plt>
mov    (%rsp),%edi
call   1030 <logout@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.utmp = type { i32, i32 }
define void @foo() {
%1 = alloca %struct.utmp
%2 = bitcast %struct.utmp* %1 to i8*
%3 = call i32 @login(%struct.utmp* %1)
%4 = getelementptr inbounds %struct.utmp, %struct.utmp* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @logout(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.utmp = type { i32, i32 }
define void @foo() {
%1 = alloca i64
%2 = bitcast i64* %1 to %struct.utmp*
%3 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%4 = call i32 @login(%struct.utmp* %2)
%5 = bitcast i64* %1 to i32*
%6 = load i32, i32* %5
%7 = call i32 @logout(i32 %6)
ret void
}
/* Variables and functions */
int EOF;
int getch();
int /*<<< orphan*/ putchar(int);
int main(void) {
  int c;
  while ((c = getch()) != EOF)
    putchar(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getch@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getch@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getch()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getch()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getch()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
unsigned int bytes2uint(char *);
unsigned int seqNumber(char *packet) { return bytes2uint(&packet[2]); }


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

x86 assembly (clang, -O2):
<seqNumber>:
add    $0x2,%rdi
jmp    1030 <bytes2uint@plt>

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

LLVM IR (-O2):
define i32 @seqNumber(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = tail call i32 @bytes2uint(i8* %2)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ loff_t;

/* Variables and functions */
scalar_t__ llseek(int, scalar_t__, int /*<<< orphan*/);
int read(int, void *, int);
int fs_read(int fd, loff_t pos, int size, void *data) {
  if (llseek(fd, pos, 0) == pos) {
    if (read(fd, data, size) == size) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<fs_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <llseek@plt>
cmp    -0x10(%rbp),%rax
jne    1177 <fs_read+0x57>
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
cmp    -0x14(%rbp),%eax
jne    1172 <fs_read+0x52>
movl   $0x1,-0x4(%rbp)
jmp    117e <fs_read+0x5e>
jmp    1177 <fs_read+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_read>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edx,%edx
call   1040 <llseek@plt>
cmp    %rbx,%rax
jne    1157 <fs_read+0x37>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <read@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %r15d,%ecx
je     1159 <fs_read+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fs_read(i32 %0, i64 %1, i32 %2, i8* nocapture %3) {
%5 = tail call i64 @llseek(i32 %0, i64 %1, i32 0)
%6 = icmp eq i64 %5, %1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @read(i32 %0, i8* %3, i32 %2)
%9 = icmp eq i32 %8, %2
br i1 %9, label %11, label %10
10: ; preds = %7, %4
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ 0, %10 ], [ 1, %7 ]
ret i32 %12
}
void i810_create_i2c_busses(struct i810fb_par *par) {}


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

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

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

LLVM IR (-O2):
%struct.i810fb_par = type opaque
define void @i810_create_i2c_busses(%struct.i810fb_par* nocapture %0) {
ret void
}
void XESetFreeGC() {}


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

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

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

LLVM IR (-O2):
define void @XESetFreeGC() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ motor(int, int);
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ off(int);
void backward(int dist) {
  motor(1, -120);
  motor(3, -160);
  msleep(dist);
  off(1);
  off(3);
}


x86 assembly (clang, -O0):
<backward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
mov    $0xffffff88,%esi
call   1030 <motor@plt>
mov    $0x3,%edi
mov    $0xffffff60,%esi
call   1030 <motor@plt>
mov    -0x4(%rbp),%edi
call   1050 <msleep@plt>
mov    $0x1,%edi
call   1040 <off@plt>
mov    $0x3,%edi
call   1040 <off@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backward>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0xffffff88,%esi
call   1030 <motor@plt>
mov    $0x3,%edi
mov    $0xffffff60,%esi
call   1030 <motor@plt>
mov    %ebx,%edi
call   1050 <msleep@plt>
mov    $0x1,%edi
call   1040 <off@plt>
mov    $0x3,%edi
pop    %rbx
jmp    1040 <off@plt>

LLVM IR (-O0):
define void @backward(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @motor(i32 1, i32 -120)
%4 = call i32 @motor(i32 3, i32 -160)
%5 = load i32, i32* %2
%6 = call i32 @msleep(i32 %5)
%7 = call i32 @off(i32 1)
%8 = call i32 @off(i32 3)
ret void
}

LLVM IR (-O2):
define void @backward(i32 %0) {
%2 = tail call i32 @motor(i32 1, i32 -120)
%3 = tail call i32 @motor(i32 3, i32 -160)
%4 = tail call i32 @msleep(i32 %0)
%5 = tail call i32 @off(i32 1)
%6 = tail call i32 @off(i32 3)
ret void
}
int ft_return_negative(int number, int is_negative) {
  if (is_negative == 1)
    number = (-number);
  return (number);
}


x86 assembly (clang, -O0):
<ft_return_negative>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111c <ft_return_negative+0x1c>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_return_negative>:
mov    %edi,%eax
neg    %eax
cmp    $0x1,%esi
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_return_negative(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = sub nsw i32 0, %0
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void default_print_fn(char *s) { fputs(s, stdout); }


x86 assembly (clang, -O0):
<default_print_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_print_fn>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @default_print_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @default_print_fn(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int compare_str(const void *k1, const void *k2) {
  return strcmp((char *)k1, (char *)k2);
}


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

x86 assembly (clang, -O2):
<compare_str>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare_str(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @compare_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR97_get(void) { return U_WMRCORENONE_get("U_WMR97"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR97\00"
define i32 @U_WMR97_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR97\00"
define i32 @U_WMR97_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_stream_restore_read() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_stream_restore_read"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"NOT IMPLEMENTED:pa_ext_stream_restore_read\0A\00"
define i32 @pa_ext_stream_restore_read() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_ext_stream_restore_read\00"
define i32 @pa_ext_stream_restore_read() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int precentile_index(double *, int, double);
double precentile(double *array, int size, double target_percentile) {
  int index;
  index = precentile_index(array, size, target_percentile);
  return array[index];
}


x86 assembly (clang, -O0):
<precentile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
call   1030 <precentile_index@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<precentile>:
push   %rbx
mov    %rdi,%rbx
call   1030 <precentile_index@plt>
cltq
movsd  (%rbx,%rax,8),%xmm0
pop    %rbx
ret

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

LLVM IR (-O2):
define double @precentile(double* %0, i32 %1, double %2) {
%4 = tail call i32 @precentile_index(double* %0, i32 %1, double %2)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = load double, double* %6
ret double %7
}
char *strcat(char *dest, const char *src) {
  char *tmp = dest;
  while (*dest) {
    dest++;
  }
  while ((*dest++ = *src++) != '\0') {
    ;
  }
  return tmp;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
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)
movsbl %al,%eax
cmp    $0x0,%eax
je     116a <strcat+0x6a>
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Type definitions */
struct ish_shell_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getcwd(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void ish_builtin_pwd(struct ish_shell_t *shell __attribute__((unused)),
                     char **args __attribute__((unused))) {
  char *pwd = getcwd(NULL, 0);
  printf("%s\n", pwd);
  free(pwd);
}


x86 assembly (clang, -O0):
<ish_builtin_pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1050 <getcwd@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ish_builtin_pwd>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1050 <getcwd@plt>
mov    %rax,%rbx
lea    0xebc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ish_shell_t = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define void @ish_builtin_pwd(%struct.ish_shell_t* %0, i8** %1) {
%3 = alloca %struct.ish_shell_t*
%4 = alloca i8**
%5 = alloca i8*
store %struct.ish_shell_t* %0, %struct.ish_shell_t** %3
store i8** %1, i8*** %4
%6 = call i8* @getcwd(i32* null, i32 0)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %5
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
%struct.ish_shell_t = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define void @ish_builtin_pwd(%struct.ish_shell_t* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i8* @getcwd(i32* null, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Clear_Display();
int /*<<< orphan*/ Init_Maps();
int /*<<< orphan*/ R_LCD_Set_Voltage_On();
int /*<<< orphan*/ R_LCD_Start();
void Init_Display_Panel(void) {
  Init_Maps();
  Clear_Display();
  R_LCD_Start();
  R_LCD_Set_Voltage_On();
}


x86 assembly (clang, -O0):
<Init_Display_Panel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Init_Maps@plt>
mov    $0x0,%al
call   1040 <Clear_Display@plt>
mov    $0x0,%al
call   1050 <R_LCD_Start@plt>
mov    $0x0,%al
call   1060 <R_LCD_Set_Voltage_On@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init_Display_Panel>:
push   %rax
xor    %eax,%eax
call   1030 <Init_Maps@plt>
xor    %eax,%eax
call   1040 <Clear_Display@plt>
xor    %eax,%eax
call   1050 <R_LCD_Start@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <R_LCD_Set_Voltage_On@plt>

LLVM IR (-O0):
define void @Init_Display_Panel() {
%1 = call i32 (...) @Init_Maps()
%2 = call i32 (...) @Clear_Display()
%3 = call i32 (...) @R_LCD_Start()
%4 = call i32 (...) @R_LCD_Set_Voltage_On()
ret void
}

LLVM IR (-O2):
define void @Init_Display_Panel() {
%1 = tail call i32 (...) @Init_Maps()
%2 = tail call i32 (...) @Clear_Display()
%3 = tail call i32 (...) @R_LCD_Start()
%4 = tail call i32 (...) @R_LCD_Set_Voltage_On()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 2;
  int j = i;
  for (; i < 500000000; ++i)
    j += i;
  printf("%d\n", j - 1711656321);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1dcd6500,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <main+0x1c>
mov    -0xc(%rbp),%esi
sub    $0x6605cd81,%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
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_poly1305_carry(uintptr_t, uintptr_t);
void fiat_poly1305_carry(uint32_t out1[5], const uint32_t arg1[5]) {
  internal_fiat_poly1305_carry((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_poly1305_carry>:
jmp    1030 <internal_fiat_poly1305_carry@plt>

LLVM IR (-O0):
define void @fiat_poly1305_carry(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_poly1305_carry(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_poly1305_carry(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_poly1305_carry(i64 %3, i64 %4)
ret void
}
void _assert(char const *s1, int l, char const *s2) {
  (void)(s1);
  (void)(l);
  (void)(s2);
}


x86 assembly (clang, -O0):
<_assert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_assert(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}