xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(long *);
long *obd_get_bytes(int, int);
int /*<<< orphan*/ write(int, char *, int);
int get_speed(int fd) {
  long int *data;
  int speed = 0;
  write(fd, "010D 1\r", 7);
  data = obd_get_bytes(fd, 1);
  if (data == NULL) {
    speed = -1;
  } else {
    speed = (int)data[2];
    free(data);
  }
  return speed;
}


x86 assembly (clang, -O0):
<get_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    0xeb4(%rip),%rsi
mov    $0x7,%edx
call   1040 <write@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <obd_get_bytes@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117e <get_speed+0x4e>
movl   $0xffffffff,-0x14(%rbp)
jmp    1192 <get_speed+0x62>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_speed>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rsi
mov    $0x7,%edx
call   1040 <write@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1050 <obd_get_bytes@plt>
test   %rax,%rax
je     1162 <get_speed+0x32>
mov    0x10(%rax),%ebx
mov    %rax,%rdi
call   1030 <free@plt>
jmp    1167 <get_speed+0x37>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"010D 1\0D\00"
define i32 @get_speed(i32 %0) {
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @write(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%7 = load i32, i32* %2
%8 = call i64* @obd_get_bytes(i32 %7, i32 1)
store i64* %8, i64** %3
%9 = load i64*, i64** %3
%10 = icmp eq i64* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %4
br label %19
12: ; preds = %1
%13 = load i64*, i64** %3
%14 = getelementptr inbounds i64, i64* %13, i64 2
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
store i32 %16, i32* %4
%17 = load i64*, i64** %3
%18 = call i32 @free(i64* %17)
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [8 x i8] c"010D 1\0D\00"
define i32 @get_speed(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = tail call i64* @obd_get_bytes(i32 %0, i32 1)
%4 = icmp eq i64* %3, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds i64, i64* %3, i64 2
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = tail call i32 @free(i64* %3)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %8, %5 ], [ -1, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int fio_read_32(int /*<<< orphan*/ *, int);
scalar_t__ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int fio_abs_read_32(FILE *f, long offset, int is_big_endian) {
  if (fseek(f, offset, SEEK_SET) != 0)
    return -1;
  return (fio_read_32(f, is_big_endian));
}


x86 assembly (clang, -O0):
<fio_abs_read_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
cmp    $0x0,%rax
je     115f <fio_abs_read_32+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <fio_abs_read_32+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <fio_read_32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fio_abs_read_32>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
test   %rax,%rax
je     1147 <fio_abs_read_32+0x27>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fio_read_32@plt>

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

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @fio_abs_read_32(i32* %0, i64 %1, i32 %2) {
%4 = load i32, i32* @SEEK_SET
%5 = tail call i64 @fseek(i32* %0, i64 %1, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @fio_read_32(i32* %0, i32 %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ -1, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ strcspn(char *, char *);
void slashmap(char *p) {
  p += strcspn(p, "/");
  while (*p) {
    *p = '\\';
    p += strcspn(p, "/");
  }
}


x86 assembly (clang, -O0):
<slashmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcspn@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <slashmap+0x65>
mov    -0x8(%rbp),%rax
movb   $0x5c,(%rax)
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1030 <strcspn@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    113c <slashmap+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slashmap>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
call   1030 <strcspn@plt>
cltq
cmpb   $0x0,(%rbx,%rax,1)
je     115a <slashmap+0x4a>
add    %rax,%rbx
lea    0xecb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
movb   $0x5c,(%rbx)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcspn@plt>
cltq
cmpb   $0x0,(%rbx,%rax,1)
lea    (%rbx,%rax,1),%rbx
jne    1140 <slashmap+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @slashmap(i8* nocapture %0) {
%2 = tail call i32 @strcspn(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %7
%8 = phi i8* [ %11, %7 ], [ %4, %1 ]
store i8 92, i8* %8
%9 = tail call i32 @strcspn(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ gaia_running();
int main(void) {
  gaia_running();
  exit(0);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gaia_running()
%2 = tail call i32 @exit(i32 0)
unreachable
}
char *gettoken(char **t, char delim, char *rcv) {
  char *ptr_rcv = rcv;
  while (*ptr_rcv) {
    if (*ptr_rcv == delim) {
      *ptr_rcv++ = '\0';
      break;
    }
    ptr_rcv++;
  }
  *t = rcv;
  return ptr_rcv;
}


x86 assembly (clang, -O0):
<gettoken>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <gettoken+0x62>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1151 <gettoken+0x51>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,(%rax)
jmp    1162 <gettoken+0x62>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111a <gettoken+0x1a>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettoken>:
mov    (%rdx),%cl
mov    %rdx,%rax
test   %cl,%cl
je     1123 <gettoken+0x23>
lea    0x1(%rdx),%r8
nopl   (%rax)
mov    %r8,%rax
cmp    %sil,%cl
je     1127 <gettoken+0x27>
movzbl (%rax),%ecx
lea    0x1(%rax),%r8
test   %cl,%cl
jne    1110 <gettoken+0x10>
mov    %rdx,(%rdi)
ret
movb   $0x0,-0x1(%rax)
mov    %rdx,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @gettoken(i8** nocapture writeonly %0, i8 signext %1, i8* %2) {
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %12
%7 = phi i8 [ %13, %12 ], [ %4, %3 ]
%8 = phi i8* [ %10, %12 ], [ %2, %3 ]
%9 = icmp eq i8 %7, %1
%10 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %9, label %11, label %12
11: ; preds = %6
store i8 0, i8* %8
br label %15
12: ; preds = %6
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %12, %3, %11
%16 = phi i8* [ %10, %11 ], [ %2, %3 ], [ %10, %12 ]
store i8* %2, i8** %0
ret i8* %16
}
void del_led(struct led *led) {}


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

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

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

LLVM IR (-O2):
%struct.led = type opaque
define void @del_led(%struct.led* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_pack_prim_8_be(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ **, double const *, int);
void ivory_serialize_pack_double_be(uint8_t *dst, uint32_t offs,
                                    const double *src) {
  uint8_t tmp[8] = {0};
  memcpy(&tmp, src, sizeof(tmp));
  ivory_serialize_pack_prim_8_be(dst + offs, tmp);
}


x86 assembly (clang, -O0):
<ivory_serialize_pack_double_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x20,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x40(%rbp),%rsi
call   1040 <ivory_serialize_pack_prim_8_be@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_pack_double_be>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rdi
mov    %r15,%rsi
call   1030 <ivory_serialize_pack_prim_8_be@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ivory_serialize_pack_double_be(i32* %0, i32 %1, double* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
%7 = alloca [8 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store double* %2, double** %6
%8 = bitcast [8 x i32]* %7 to i8*
%9 = bitcast [8 x i32]* %7 to i32**
%10 = load double*, double** %6
%11 = call i32 @memcpy(i32** %9, double* %10, i32 32)
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds [8 x i32], [8 x i32]* %7, i64 0, i64 0
%17 = call i32 @ivory_serialize_pack_prim_8_be(i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_pack_double_be(i32* %0, i32 %1, double* %2) {
%4 = alloca [8 x i32]
%5 = bitcast [8 x i32]* %4 to i8*
%6 = bitcast [8 x i32]* %4 to i32**
%7 = call i32 @memcpy(i32** %6, double* %2, i32 32)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%11 = call i32 @ivory_serialize_pack_prim_8_be(i32* %9, i32* %10)
ret void
}
int cmp_great_fp128(const void *p, const void *q) {
  const long double a = *(const long double *)p;
  const long double b = *(const long double *)q;
  if (b > a)
    return +1;
  if (a > b)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_great_fp128>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fstpt  -0x30(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fstpt  -0x40(%rbp)
fldt   -0x40(%rbp)
fldt   -0x30(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1141 <cmp_great_fp128+0x41>
jmp    1135 <cmp_great_fp128+0x35>
movl   $0x1,-0x4(%rbp)
jmp    116b <cmp_great_fp128+0x6b>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1164 <cmp_great_fp128+0x64>
jmp    1158 <cmp_great_fp128+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <cmp_great_fp128+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_great_fp128>:
fldt   (%rdi)
fldt   (%rsi)
xor    %ecx,%ecx
fxch   %st(1)
fucomi %st(1),%st
seta   %cl
neg    %ecx
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_great_fp128(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca x86_fp80
%7 = alloca x86_fp80
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to x86_fp80*
%10 = load x86_fp80, x86_fp80* %9
store x86_fp80 %10, x86_fp80* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to x86_fp80*
%13 = load x86_fp80, x86_fp80* %12
store x86_fp80 %13, x86_fp80* %7
%14 = load x86_fp80, x86_fp80* %7
%15 = load x86_fp80, x86_fp80* %6
%16 = fcmp ogt x86_fp80 %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 x86_fp80, x86_fp80* %6
%20 = load x86_fp80, x86_fp80* %7
%21 = fcmp ogt x86_fp80 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_great_fp128(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to x86_fp80*
%4 = load x86_fp80, x86_fp80* %3
%5 = bitcast i8* %1 to x86_fp80*
%6 = load x86_fp80, x86_fp80* %5
%7 = fcmp ogt x86_fp80 %6, %4
%8 = fcmp ogt x86_fp80 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
double fd2jd(string)
char *string;
{
  double date, time;
  fd2dt(string, &date, &time);
  return (dt2jd(date, time));
}


x86 assembly (clang, -O0):
<fd2jd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <fd2dt@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    $0x2,%al
call   1030 <dt2jd@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd2jd>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1040 <fd2dt@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1030 <dt2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fd2jd(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca double
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, double*, double*, ...) bitcast (i32 (...)* @fd2dt to i32 (i8*, double*, double*, ...)*)(i8* %5, double* %3, double* %4)
%7 = load double, double* %3
%8 = load double, double* %4
%9 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %7, double %8)
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @fd2jd(i8* %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = call i32 (i8*, double*, double*, ...) bitcast (i32 (...)* @fd2dt to i32 (i8*, double*, double*, ...)*)(i8* %0, double* %2, double* %3)
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %7, double %8)
%10 = sitofp i32 %9 to double
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ clxns_free(void *, int /*<<< orphan*/);
void free_iter(void *iter_state) { clxns_free(iter_state, 0); }


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

x86 assembly (clang, -O2):
<free_iter>:
xor    %esi,%esi
jmp    1030 <clxns_free@plt>

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

LLVM IR (-O2):
define void @free_iter(i8* %0) {
%2 = tail call i32 @clxns_free(i8* %0, i32 0)
ret void
}
int list_comp(const void *a, const void *b) {
  return (*((int *)a) - *((int *)b));
}


x86 assembly (clang, -O0):
<list_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_comp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @list_comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @list_comp(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 = sub nsw i32 %4, %6
ret i32 %7
}
void vdbell() {}


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

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

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

LLVM IR (-O2):
define void @vdbell() {
ret void
}
char *ft_whitespaces(char *str) {
  while (*str && (*str == ' ' || *str == '\n' || *str == '\t' || *str < 33)) {
    str++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<ft_whitespaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1172 <ft_whitespaces+0x72>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     116c <ft_whitespaces+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0xa(%rbp)
je     116c <ft_whitespaces+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0xa(%rbp)
je     116c <ft_whitespaces+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
setl   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1182 <ft_whitespaces+0x82>
jmp    1193 <ft_whitespaces+0x93>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ft_whitespaces+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_whitespaces>:
mov    %rdi,%rax
jmp    1114 <ft_whitespaces+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
lea    -0x9(%rcx),%edx
cmp    $0x2,%dl
jb     1110 <ft_whitespaces+0x10>
cmp    $0x20,%cl
je     1110 <ft_whitespaces+0x10>
test   %cl,%cl
je     112d <ft_whitespaces+0x2d>
cmp    $0x20,%cl
jle    1110 <ft_whitespaces+0x10>
ret

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

LLVM IR (-O2):
define i8* @ft_whitespaces(i8* %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %8, %7 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %9
i8 32, label %7
i8 10, label %7
i8 9, label %7
]
5: ; preds = %2
%6 = icmp slt i8 %4, 33
br i1 %6, label %7, label %9
7: ; preds = %2, %2, %2, %5
%8 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
9: ; preds = %2, %5
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _vram_write_run(int /*<<< orphan*/, int);
int /*<<< orphan*/ vdp_waddr(int);
void vdp_clear_screen(void) {
  vdp_waddr(0x0000);
  _vram_write_run(0, 40 * 24);
}


x86 assembly (clang, -O0):
<vdp_clear_screen>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <vdp_waddr@plt>
xor    %edi,%edi
mov    $0x3c0,%esi
call   1030 <_vram_write_run@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdp_clear_screen>:
push   %rax
xor    %edi,%edi
call   1040 <vdp_waddr@plt>
xor    %edi,%edi
mov    $0x3c0,%esi
pop    %rax
jmp    1030 <_vram_write_run@plt>

LLVM IR (-O0):
define void @vdp_clear_screen() {
%1 = call i32 @vdp_waddr(i32 0)
%2 = call i32 @_vram_write_run(i32 0, i32 960)
ret void
}

LLVM IR (-O2):
define void @vdp_clear_screen() {
%1 = tail call i32 @vdp_waddr(i32 0)
%2 = tail call i32 @_vram_write_run(i32 0, i32 960)
ret void
}
void WpaEAPOLASFAlertAction(struct rt_rtmp_adapter *pAd,
                            struct rt_mlme_queue_elem *Elem) {}


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

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

LLVM IR (-O0):
%struct.rt_rtmp_adapter = type opaque
%struct.rt_mlme_queue_elem = type opaque
define void @WpaEAPOLASFAlertAction(%struct.rt_rtmp_adapter* %0, %struct.rt_mlme_queue_elem* %1) {
%3 = alloca %struct.rt_rtmp_adapter*
%4 = alloca %struct.rt_mlme_queue_elem*
store %struct.rt_rtmp_adapter* %0, %struct.rt_rtmp_adapter** %3
store %struct.rt_mlme_queue_elem* %1, %struct.rt_mlme_queue_elem** %4
ret void
}

LLVM IR (-O2):
%struct.rt_rtmp_adapter = type opaque
%struct.rt_mlme_queue_elem = type opaque
define void @WpaEAPOLASFAlertAction(%struct.rt_rtmp_adapter* nocapture %0, %struct.rt_mlme_queue_elem* nocapture %1) {
ret void
}
/* Variables and functions */
void radeon_set_indexed(int, int, unsigned long, char const *, unsigned int);
void radeon_set_mc(unsigned long offset, const char *name, unsigned int value) {
  return radeon_set_indexed(0x0070, 0x0074, offset | 0x00ff0000, name, value);
}


x86 assembly (clang, -O0):
<radeon_set_mc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdx
or     $0xff0000,%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x70,%edi
mov    $0x74,%esi
call   1030 <radeon_set_indexed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radeon_set_mc>:
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
or     $0xff0000,%rdx
mov    $0x70,%edi
mov    $0x74,%esi
jmp    1030 <radeon_set_indexed@plt>

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

LLVM IR (-O2):
define void @radeon_set_mc(i64 %0, i8* %1, i32 %2) {
%4 = or i64 %0, 16711680
tail call void @radeon_set_indexed(i32 112, i32 116, i64 %4, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
openpl() { putchar(035); }


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

x86 assembly (clang, -O2):
<openpl>:
mov    $0x1d,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @openpl() {
%1 = alloca i32
%2 = call i32 @putchar(i32 29)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @openpl() {
%1 = tail call i32 @putchar(i32 29)
ret i32 undef
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cintern(char *);
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/, struct obj *);
void init_regex_version(void) {
  setvar(cintern("*regex-version*"),
         cintern("$Id: regex.c,v 1.6 1997/12/01 18:17:51 gjc Exp $"),
         ((struct obj *)0));
}


x86 assembly (clang, -O0):
<init_regex_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,-0x4(%rbp)
lea    0xed2(%rip),%rdi
call   1040 <cintern@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_regex_version>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,%ebx
lea    0xeda(%rip),%rdi
call   1040 <cintern@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <setvar@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [16 x i8] c"*regex-version*\00"
@.str.1 = [49 x i8] c"$Id: regex.c,v 1.6 1997/12/01 18:17:51 gjc Exp $\00"
define void @init_regex_version() {
%1 = call i32 @cintern(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cintern(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [16 x i8] c"*regex-version*\00"
@.str.1 = [49 x i8] c"$Id: regex.c,v 1.6 1997/12/01 18:17:51 gjc Exp $\00"
define void @init_regex_version() {
%1 = tail call i32 @cintern(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cintern(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}
int do_869() { return 869; }


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

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

LLVM IR (-O0):
define i32 @do_869() {
ret i32 869
}

LLVM IR (-O2):
define i32 @do_869() {
ret i32 869
}
void INT_Excep_SCIFA9_RXIF9(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCIFA9_RXIF9() {
ret void
}
int bar(const char *str) {
  if (str) {
    return 0;
  } else {
    return 42;
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     111f <bar+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1126 <bar+0x26>
movl   $0x2a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %ecx,%ecx
test   %rdi,%rdi
mov    $0x2a,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i32 42, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int some_function(void) {
  sleep(1);
  return 1;
}


x86 assembly (clang, -O0):
<some_function>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<some_function>:
push   %rax
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @some_function() {
%1 = call i32 @sleep(i32 1)
ret i32 1
}

LLVM IR (-O2):
define i32 @some_function() {
%1 = tail call i32 @sleep(i32 1)
ret i32 1
}
int isreach_lance(int dx, int dy) { return dx == 0 && dy > 0; }


x86 assembly (clang, -O0):
<isreach_lance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <isreach_lance+0x23>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreach_lance>:
test   %edi,%edi
sete   %al
test   %esi,%esi
setg   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isreach_lance(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isreach_lance(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void swap(int *array, int index1, int index2) {
  int t = array[index1];
  array[index1] = array[index2];
  array[index2] = t;
  return;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
void print_input() {
  int c;
  c = getchar();
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<print_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
je     115b <print_input+0x3b>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    1132 <print_input+0x12>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EOF = global i32 0
define void @print_input() {
%1 = tail call i32 (...) @getchar()
%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 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret void
}
int do_950() { return 950; }


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

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

LLVM IR (-O0):
define i32 @do_950() {
ret i32 950
}

LLVM IR (-O2):
define i32 @do_950() {
ret i32 950
}
unsigned long foo(unsigned long a) { return (a << 4) & 0xffff; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x4,%rax
and    $0xffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
shl    $0x4,%edi
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = shl i64 %0, 4
%3 = and i64 %2, 65520
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testMod() { printf("%d %% %d = %d\n", 11, 4, 11 % 4); }


x86 assembly (clang, -O0):
<testMod>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xb,%esi
mov    $0x4,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testMod>:
lea    0xee9(%rip),%rdi
mov    $0xb,%esi
mov    $0x4,%edx
mov    $0x3,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%d %% %d = %d\0A\00"
define void @testMod() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 11, i32 4, i32 3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d %% %d = %d\0A\00"
define void @testMod() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 11, i32 4, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stack_test_1();
int stack_test_2() {
  stack_test_1();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @stack_test_2() {
%1 = call i32 (...) @stack_test_1()
ret i32 0
}

LLVM IR (-O2):
define i32 @stack_test_2() {
%1 = tail call i32 (...) @stack_test_1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int write(int, void *, size_t);
int envia(int socket, void *dados, size_t tam) {
  int ret;
  if ((ret = write(socket, dados, tam)) < 0) {
    perror("Erro no Write!");
  }
  return ret;
}


x86 assembly (clang, -O0):
<envia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    115b <envia+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<envia>:
push   %rbx
call   1030 <write@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1130 <envia+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1040 <perror@plt>
jmp    112c <envia+0xc>

LLVM IR (-O0):
@.str = [15 x i8] c"Erro no Write!\00"
define i32 @envia(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @write(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@.str = [15 x i8] c"Erro no Write!\00"
define i32 @envia(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
int sub(int x, int y) {
  int i = 0, j = 1;
  return x - y - i - j;
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
not    %esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @sub(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 1, i32* %6
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = add i32 %3, %0
ret i32 %4
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
unsigned long lookup(unsigned char *, int, int /*<<< orphan*/);
unsigned long int ippool_hash4(struct in_addr *addr) {
  return lookup((unsigned char *)&addr->s_addr, sizeof(addr->s_addr), 0);
}


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

x86 assembly (clang, -O2):
<ippool_hash4>:
mov    $0x4,%esi
xor    %edx,%edx
jmp    1030 <lookup@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i64 @ippool_hash4(%struct.in_addr* %0) {
%2 = alloca %struct.in_addr*
store %struct.in_addr* %0, %struct.in_addr** %2
%3 = load %struct.in_addr*, %struct.in_addr** %2
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%5 = bitcast i32* %4 to i8*
%6 = call i64 @lookup(i8* %5, i32 4, i32 0)
ret i64 %6
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i64 @ippool_hash4(%struct.in_addr* %0) {
%2 = bitcast %struct.in_addr* %0 to i8*
%3 = tail call i64 @lookup(i8* %2, i32 4, i32 0)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signaled(int signo) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @signaled(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void uchar_put(unsigned char number, FILE *stream) {
  if (number > (unsigned char)9) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
    uchar_put(number / (unsigned char)10, stream);
#pragma GCC diagnostic pop
  }
  fputc('0' + (char)(number % (unsigned char)10), stream);
}


x86 assembly (clang, -O0):
<uchar_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jle    1157 <uchar_put+0x37>
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <uchar_put@plt>
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uchar_put>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
movzbl %dil,%ebp
cmp    $0xa,%dil
jb     1141 <uchar_put+0x21>
imul   $0xcd,%ebp,%edi
shr    $0xb,%edi
mov    %rbx,%rsi
call   1030 <uchar_put@plt>
imul   $0xcd,%ebp,%eax
shr    $0xa,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
or     $0x30,%bpl
movzbl %bpl,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fputc@plt>

LLVM IR (-O0):
define void @uchar_put(i8 zeroext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp sgt i32 %6, 9
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = sdiv i32 %10, 10
%12 = trunc i32 %11 to i8
%13 = load i32*, i32** %4
br label %14
14: ; preds = %8, %2
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = srem i32 %16, 10
%18 = trunc i32 %17 to i8
%19 = sext i8 %18 to i32
%20 = add nsw i32 48, %19
%21 = trunc i32 %20 to i8
%22 = load i32*, i32** %4
%23 = call i32 @fputc(i8 signext %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @uchar_put(i8 zeroext %0, i32* nocapture %1) {
%3 = icmp ugt i8 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i8 %0, 10
tail call void @uchar_put(i8 zeroext %5, i32* %1)
br label %6
6: ; preds = %4, %2
%7 = urem i8 %0, 10
%8 = or i8 %7, 48
%9 = tail call i32 @fputc(i8 signext %8, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void wait_for_input_then_exit(void) {
  printf("\nPress any key to exit. ");
  getchar();
  exit(1);
}


x86 assembly (clang, -O0):
<wait_for_input_then_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<wait_for_input_then_exit>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0APress any key to exit. \00"
define void @wait_for_input_then_exit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0APress any key to exit. \00"
define void @wait_for_input_then_exit() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int pandigital(long);
bool pandigital9(long n) {
  if (n < 100000000 || n > 999999999) {
    return false;
  }
  return pandigital(n);
}


x86 assembly (clang, -O0):
<pandigital9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x5f5e100,-0x10(%rbp)
05
jl     1138 <pandigital9+0x28>
cmpq   $0x3b9ac9ff,-0x10(%rbp)
3b
jle    1144 <pandigital9+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1150 <pandigital9+0x40>
mov    -0x10(%rbp),%rdi
call   1030 <pandigital@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pandigital9>:
lea    -0x3b9aca00(%rdi),%rax
cmp    $0xffffffffca5b1700,%rax
jae    1122 <pandigital9+0x12>
xor    %eax,%eax
ret
jmp    1030 <pandigital@plt>

LLVM IR (-O0):
define i32 @pandigital9(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 100000000
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i64, i64* %3
%8 = icmp sgt i64 %7, 999999999
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 0, i32* %2
br label %13
10: ; preds = %6
%11 = load i64, i64* %3
%12 = call i32 @pandigital(i64 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @pandigital9(i64 %0) {
%2 = add i64 %0, -1000000000
%3 = icmp ult i64 %2, -900000000
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @pandigital(i64 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}