xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ turn_off_buzzer();
int /*<<< orphan*/ turn_on_buzzer();
void key_5_handler(void) {
  if (((*(volatile unsigned int *)(0x7F0080A4)) >> 15) & 1) {
    turn_off_buzzer();
  } else {
    turn_on_buzzer();
  }
  return;
}


x86 assembly (clang, -O0):
<key_5_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f0080a4,%eax
mov    (%rax),%eax
shr    $0xf,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1146 <key_5_handler+0x26>
mov    $0x0,%al
call   1030 <turn_off_buzzer@plt>
jmp    114d <key_5_handler+0x2d>
mov    $0x0,%al
call   1040 <turn_on_buzzer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_5_handler>:
testl  $0x8000,0x7f0080a4
jne    1134 <key_5_handler+0x14>
xor    %eax,%eax
jmp    1040 <turn_on_buzzer@plt>
xor    %eax,%eax
jmp    1030 <turn_off_buzzer@plt>

LLVM IR (-O0):
define void @key_5_handler() {
%1 = load volatile i32, i32* inttoptr (i64 2130739364 to i32*)
%2 = lshr i32 %1, 15
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @turn_off_buzzer()
br label %9
7: ; preds = %0
%8 = call i32 (...) @turn_on_buzzer()
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @key_5_handler() {
%1 = load volatile i32, i32* inttoptr (i64 2130739364 to i32*)
%2 = and i32 %1, 32768
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @turn_off_buzzer()
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @turn_on_buzzer()
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isFMUL(const char *comm) { return strcmp(comm, "fmul") == 0; }


x86 assembly (clang, -O0):
<isFMUL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFMUL>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fmul\00"
define i32 @isFMUL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"fmul\00"
define i32 @isFMUL(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int id3v1_del_tag(int const);
int id3v2_del_tag(int const, int /*<<< orphan*/ *);
int mp_del_tags_by_ver_from_fd(const int fd, const int version) {
  if (version == 1)
    return id3v1_del_tag(fd);
  else if (version == 2)
    return id3v2_del_tag(fd, NULL);
  else
    return 6;
}


x86 assembly (clang, -O0):
<mp_del_tags_by_ver_from_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1148 <mp_del_tags_by_ver_from_fd+0x28>
mov    -0x8(%rbp),%edi
call   1040 <id3v1_del_tag@plt>
mov    %eax,-0x4(%rbp)
jmp    116d <mp_del_tags_by_ver_from_fd+0x4d>
cmpl   $0x2,-0xc(%rbp)
jne    1166 <mp_del_tags_by_ver_from_fd+0x46>
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <id3v2_del_tag@plt>
mov    %eax,-0x4(%rbp)
jmp    116d <mp_del_tags_by_ver_from_fd+0x4d>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_del_tags_by_ver_from_fd>:
cmp    $0x2,%esi
je     112f <mp_del_tags_by_ver_from_fd+0xf>
cmp    $0x1,%esi
jne    1136 <mp_del_tags_by_ver_from_fd+0x16>
jmp    1040 <id3v1_del_tag@plt>
xor    %esi,%esi
jmp    1030 <id3v2_del_tag@plt>
mov    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @mp_del_tags_by_ver_from_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @id3v1_del_tag(i32 %9)
store i32 %10, i32* %3
br label %18
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %4
%16 = call i32 @id3v2_del_tag(i32 %15, i32* null)
store i32 %16, i32* %3
br label %18
17: ; preds = %11
store i32 6, i32* %3
br label %18
18: ; preds = %17, %14, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @mp_del_tags_by_ver_from_fd(i32 %0, i32 %1) {
switch i32 %1, label %7 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = tail call i32 @id3v1_del_tag(i32 %0)
br label %7
5: ; preds = %2
%6 = tail call i32 @id3v2_del_tag(i32 %0, i32* null)
br label %7
7: ; preds = %2, %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ], [ 6, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void thisIsASecret() { system("/bin/sh"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define void @thisIsASecret() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int DRV_GET_CODEC_FUNC_STATUS(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @DRV_GET_CODEC_FUNC_STATUS() {
ret i32 1
}

LLVM IR (-O2):
define i32 @DRV_GET_CODEC_FUNC_STATUS() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int link(void) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ecc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @link() {
%1 = load i32, i32* @ENOENT
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @link() {
%1 = load i32, i32* @ENOENT
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ triml(char *);
char *trimr(int /*<<< orphan*/);
char *trim(char *s) { return trimr(triml(s)); }


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <triml@plt>
mov    %eax,%edi
call   1040 <trimr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rax
call   1030 <triml@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <trimr@plt>

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @triml(i8* %3)
%5 = call i8* @trimr(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @trim(i8* %0) {
%2 = tail call i32 @triml(i8* %0)
%3 = tail call i8* @trimr(i32 %2)
ret i8* %3
}
void fa161(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    a:
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    p02C:
      goto p02C;
      goto a;
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa161>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa161+0x4>

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

LLVM IR (-O0):
define void @fa161() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %17
br label %19
19: ; preds = %19, %18
br label %19
20: ; preds = %20
br label %20
21: ; No predecessors!
br label %22
22: ; preds = %22, %21
br label %22
23: ; preds = %23
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa161() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sighandler(int signum) { exit(-1); }


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

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @sighandler(i32 %0) {
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mcfioC_Init();
int /*<<< orphan*/ printf(char *, int, int);
int read_events();
int write_events();
int main(void) {
  int nout, nin;
  mcfioC_Init();
  nout = write_events();
  nin = read_events();
  printf(" %d events written and %d events read back\n", nout, nin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <mcfioC_Init@plt>
mov    $0x0,%al
call   1050 <write_events@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <read_events@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <mcfioC_Init@plt>
xor    %eax,%eax
call   1050 <write_events@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <read_events@plt>
lea    0xea1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c" %d events written and %d events read back\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @mcfioC_Init()
%5 = call i32 (...) @write_events()
store i32 %5, i32* %2
%6 = call i32 (...) @read_events()
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c" %d events written and %d events read back\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @mcfioC_Init()
%2 = tail call i32 (...) @write_events()
%3 = tail call i32 (...) @read_events()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int crypto_generichash_blake2b__blake2b(int /*<<< orphan*/ *, void const *,
                                        void const *, int /*<<< orphan*/ const,
                                        int /*<<< orphan*/ const,
                                        int /*<<< orphan*/);
int blake2(uint8_t *out, const void *in, const void *key, const uint8_t outlen,
           const uint64_t inlen, uint8_t keylen) {
  return crypto_generichash_blake2b__blake2b(out, in, key, outlen, inlen,
                                             keylen);
}


x86 assembly (clang, -O0):
<blake2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <crypto_generichash_blake2b__blake2b@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blake2>:
jmp    1030 <crypto_generichash_blake2b__blake2b@plt>

LLVM IR (-O0):
define i32 @blake2(i32* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @crypto_generichash_blake2b__blake2b(i32* %13, i8* %14, i8* %15, i32 %16, i32 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @blake2(i32* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @crypto_generichash_blake2b__blake2b(i32* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5)
ret i32 %7
}
int get_index(char letter) {
  int index = letter >= 'A' && letter <= 'Z' ? (letter - 'A') : -1;
  index = letter >= 'a' && letter <= 'z' ? (letter - 'a') : index;
  return index;
}


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <get_index+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <get_index+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <get_index+0x40>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <get_index+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     116f <get_index+0x6f>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     116f <get_index+0x6f>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x10(%rbp)
jmp    1175 <get_index+0x75>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
lea    -0x41(%rdi),%eax
lea    -0x41(%rdi),%ecx
cmp    $0x1a,%al
mov    $0xffffffff,%edx
cmovb  %ecx,%edx
lea    -0x61(%rdi),%ecx
lea    -0x61(%rdi),%eax
cmp    $0x1a,%cl
cmovae %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_index(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
br label %16
15: ; preds = %7, %1
br label %16
16: ; preds = %15, %11
%17 = phi i32 [ %14, %11 ], [ -1, %15 ]
store i32 %17, i32* %3
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 97
br i1 %20, label %21, label %29
21: ; preds = %16
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 122
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = sub nsw i32 %27, 97
br label %31
29: ; preds = %21, %16
%30 = load i32, i32* %3
br label %31
31: ; preds = %29, %25
%32 = phi i32 [ %28, %25 ], [ %30, %29 ]
store i32 %32, i32* %3
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @get_index(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
%5 = add nsw i32 %2, -65
%6 = select i1 %4, i32 %5, i32 -1
%7 = add i8 %0, -97
%8 = icmp ult i8 %7, 26
%9 = add nsw i32 %2, -97
%10 = select i1 %8, i32 %9, i32 %6
ret i32 %10
}
int y(z) {
  for (; z >= 0; z--) {
    0;
  }
}


x86 assembly (clang, -O0):
<y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1124 <y+0x24>
jmp    1116 <y+0x16>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1107 <y+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @y(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("test\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"test\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int stmt() {}


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

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

LLVM IR (-O0):
define i32 @stmt() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @stmt() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long double);
void sizeof_overload_longdouble(long double ld) {
  printf("Got long double %Lf\n", ld);
}


x86 assembly (clang, -O0):
<sizeof_overload_longdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"Got long double %Lf\0A\00"
define void @sizeof_overload_longdouble(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), x86_fp80 %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Got long double %Lf\0A\00"
define void @sizeof_overload_longdouble(x86_fp80 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), x86_fp80 %0)
ret void
}
void check_spread(struct cfs_rq *cfs_rq, struct sched_entity *se) {}


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

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

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

LLVM IR (-O2):
%struct.cfs_rq = type opaque
%struct.sched_entity = type opaque
define void @check_spread(%struct.cfs_rq* nocapture %0, %struct.sched_entity* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void argument_error(char *message, char *argument) {
  fputs("sttyl: ", stderr);
  fprintf(stderr, message, argument);
  fputs("\n", stderr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<argument_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xeb0(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
lea    0xe8d(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<argument_error>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e9e(%rip),%r15
mov    (%r15),%esi
lea    0xeb4(%rip),%rdi
call   1030 <fputs@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    (%r15),%esi
lea    0xe9f(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"sttyl: \00"
@stderr = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
@EXIT_FAILURE = global i32 0
define void @argument_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32 %7, i8* %8, i8* %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"sttyl: \00"
@stderr = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
@EXIT_FAILURE = global i32 0
define void @argument_error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* %0, i8* %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dir_close();
void input_end_pass(void) { dir_close(); }


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

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

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

LLVM IR (-O2):
define void @input_end_pass() {
%1 = tail call i32 (...) @dir_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fb_ConsoleGetXY(int *, int /*<<< orphan*/);
int fb_ConsoleGetX(void) {
  int x;
  fb_ConsoleGetXY(&x, 0);
  return x;
}


x86 assembly (clang, -O0):
<fb_ConsoleGetX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
call   1030 <fb_ConsoleGetXY@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_ConsoleGetX>:
push   %rax
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1030 <fb_ConsoleGetXY@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fb_ConsoleGetX() {
%1 = alloca i32
%2 = call i32 @fb_ConsoleGetXY(i32* %1, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @fb_ConsoleGetX() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @fb_ConsoleGetXY(i32* %1, i32 0)
%4 = load i32, i32* %1
ret i32 %4
}
void RSA_generate_key(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_generate_key() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void label_printPointer(void *e) { printf("%p", e); }


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

x86 assembly (clang, -O2):
<label_printPointer>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define void @label_printPointer(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_binops();
int /*<<< orphan*/ test_func_args(int, int);
int main(int argc, char *argv[]) {
  test_func_args(1, 2);
  test_binops();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <test_func_args@plt>
mov    $0x0,%al
call   1040 <test_binops@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <test_func_args@plt>
xor    %eax,%eax
call   1040 <test_binops@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @test_func_args(i32 1, i32 2)
%7 = call i32 (...) @test_binops()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_func_args(i32 1, i32 2)
%4 = tail call i32 (...) @test_binops()
ret i32 0
}
unsigned xrop3_54_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk1 = S ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_54_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_54_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
lea    (%rdx,%rsi,1),%eax
or     %ecx,%eax
or     $0xff,%edx
not    %eax
and    %edx,%eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_54_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %7
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_54_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = or i32 %6, 255
%9 = or i32 %7, %4
%10 = xor i32 %9, -1
%11 = and i32 %8, %10
%12 = or i8 %1, %0
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
ret i32 %14
}
int plugin_call(const struct plugin_list *pl, const int type, const char *args,
                struct env_set *es) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.plugin_list = type opaque
%struct.env_set = type opaque
define i32 @plugin_call(%struct.plugin_list* %0, i32 %1, i8* %2, %struct.env_set* %3) {
%5 = alloca %struct.plugin_list*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.env_set*
store %struct.plugin_list* %0, %struct.plugin_list** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store %struct.env_set* %3, %struct.env_set** %8
ret i32 0
}

LLVM IR (-O2):
%struct.plugin_list = type opaque
%struct.env_set = type opaque
define i32 @plugin_call(%struct.plugin_list* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, %struct.env_set* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_check_user_token();
int /*<<< orphan*/ test_filter_printf();
int /*<<< orphan*/ test_get_user_cfgfile_path();
int /*<<< orphan*/ test_rfc4515_replace();
int main(void) {
  test_filter_printf();
  test_rfc4515_replace();
  test_get_user_cfgfile_path();
  test_check_user_token();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_filter_printf@plt>
mov    $0x0,%al
call   1030 <test_rfc4515_replace@plt>
mov    $0x0,%al
call   1060 <test_get_user_cfgfile_path@plt>
mov    $0x0,%al
call   1050 <test_check_user_token@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_filter_printf@plt>
xor    %eax,%eax
call   1030 <test_rfc4515_replace@plt>
xor    %eax,%eax
call   1060 <test_get_user_cfgfile_path@plt>
xor    %eax,%eax
call   1050 <test_check_user_token@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_filter_printf()
%3 = call i32 (...) @test_rfc4515_replace()
%4 = call i32 (...) @test_get_user_cfgfile_path()
%5 = call i32 (...) @test_check_user_token()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_filter_printf()
%2 = tail call i32 (...) @test_rfc4515_replace()
%3 = tail call i32 (...) @test_get_user_cfgfile_path()
%4 = tail call i32 (...) @test_check_user_token()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_write(char);
void serial_putc(char a) {
  if (a == '\n')
    serial_write('\r');
  serial_write(a);
}


x86 assembly (clang, -O0):
<serial_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1135 <serial_putc+0x25>
mov    $0xd,%edi
call   1030 <serial_write@plt>
movsbl -0x1(%rbp),%edi
call   1030 <serial_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_putc>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1122 <serial_putc+0x12>
mov    $0xd,%edi
call   1030 <serial_write@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <serial_write@plt>

LLVM IR (-O0):
define void @serial_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @serial_write(i8 signext 13)
br label %8
8: ; preds = %6, %1
%9 = load i8, i8* %2
%10 = call i32 @serial_write(i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @serial_putc(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @serial_write(i8 signext 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @serial_write(i8 signext %0)
ret void
}
/* Variables and functions */
void stub1(long long);
void testClosureLLrV(void (*closure)(long long), long long a1) {
  if (closure != NULL)
    (*closure)(a1);
}


x86 assembly (clang, -O0):
<testClosureLLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1125 <testClosureLLrV+0x25>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLrV>:
test   %rdi,%rdi
je     110d <testClosureLLrV+0xd>
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureLLrV(void (i64)* %0, i64 %1) {
%3 = icmp eq void (i64)* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
tail call void %0(i64 %1)
br label %5
5: ; preds = %4, %2
ret void
}
/* Variables and functions */
int pass2b();
int main() { return pass2b(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pass2b@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pass2b()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ BRTransactionFree(void *);
void _setApplyFreeTx(void *info, void *tx) { BRTransactionFree(tx); }


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

x86 assembly (clang, -O2):
<_setApplyFreeTx>:
mov    %rsi,%rdi
jmp    1030 <BRTransactionFree@plt>

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

LLVM IR (-O2):
define void @_setApplyFreeTx(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @BRTransactionFree(i8* %1)
ret void
}
void clkDelay(void) {
  int x;
  for (x = 0; x < 1; x++)
    asm volatile("nop");
}


x86 assembly (clang, -O0):
<clkDelay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1124 <clkDelay+0x24>
nop
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <clkDelay+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @clkDelay() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int calculateCellCount(float i) {
  float x = i / 100;
  return (37 - 2) * (37 - 2) * x;
}


x86 assembly (clang, -O0):
<calculateCellCount>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeee(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed9(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateCellCount>:
divss  0xef8(%rip),%xmm0
mulss  0xef4(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @calculateCellCount(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fdiv float %4, 1.000000e+02
store float %5, float* %3
%6 = load float, float* %3
%7 = fmul float 1.225000e+03, %6
%8 = fptosi float %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @calculateCellCount(float %0) {
%2 = fdiv float %0, 1.000000e+02
%3 = fmul float %2, 1.225000e+03
%4 = fptosi float %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
void make_blocks(void) {
  int i;
  for (i = 0; i < 1024 * 16; ++i) {
    void *p = malloc(1);
    if (i % 16) {
      free(p);
    }
  }
}


x86 assembly (clang, -O0):
<make_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4000,-0x4(%rbp)
jge    117a <make_blocks+0x5a>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1167 <make_blocks+0x47>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    116c <make_blocks+0x4c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <make_blocks+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_blocks>:
push   %rbx
xor    %ebx,%ebx
jmp    113b <make_blocks+0x1b>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x4000,%ebx
je     1154 <make_blocks+0x34>
mov    $0x1,%edi
call   1040 <malloc@plt>
test   $0xf,%bl
je     1130 <make_blocks+0x10>
mov    %rax,%rdi
call   1030 <free@plt>
jmp    1130 <make_blocks+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @make_blocks() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 16384
br i1 %5, label %6, label %18
6: ; preds = %3
%7 = call i8* @malloc(i32 1)
store i8* %7, i8** %2
%8 = load i32, i32* %1
%9 = srem i32 %8, 16
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %11, %6
br label %15
15: ; preds = %14
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @make_blocks() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %9, %8 ]
%3 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%4 = and i32 %2, 15
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @free(i8* %3)
br label %8
8: ; preds = %6, %1
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 16384
br i1 %10, label %11, label %1
11: ; preds = %8
ret void
}
int ft_isspace(int c) {
  if (c == ' ' || (c >= 9 && c <= 13))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     1125 <ft_isspace+0x25>
cmpl   $0x9,-0x8(%rbp)
jl     1131 <ft_isspace+0x31>
cmpl   $0xd,-0x8(%rbp)
jg     1131 <ft_isspace+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <ft_isspace+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isspace>:
cmp    $0x20,%edi
sete   %al
add    $0xfffffff7,%edi
cmp    $0x5,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ft_isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 32
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 9
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 13
br i1 %11, label %12, label %13
12: ; preds = %9, %1
store i32 1, i32* %2
br label %14
13: ; preds = %9, %6
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ft_isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
char *MapName() { return *(void **)(0x70F0C) + 0x20; }


x86 assembly (clang, -O0):
<MapName>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70f0c,%eax
mov    (%rax),%rax
add    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MapName>:
mov    0x70f0c,%rax
add    $0x20,%rax
ret

LLVM IR (-O0):
define i8* @MapName() {
%1 = load i8*, i8** inttoptr (i64 462604 to i8**)
%2 = getelementptr i8, i8* %1, i64 32
ret i8* %2
}

LLVM IR (-O2):
define i8* @MapName() {
%1 = load i8*, i8** inttoptr (i64 462604 to i8**)
%2 = getelementptr i8, i8* %1, i64 32
ret i8* %2
}
/* Variables and functions */
int INT_MIN;
int test5(int x) {
  int y = INT_MIN;
  return x + y;
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
add    (%rcx),%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @test5(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @INT_MIN
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test5(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ hidpp_set_unaligned_be_u16(int /*<<< orphan*/ *,
                                              int /*<<< orphan*/);
uint16_t hidpp_cpu_to_be_u16(uint16_t data) {
  uint16_t result;
  hidpp_set_unaligned_be_u16((uint8_t *)&result, data);
  return result;
}


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

x86 assembly (clang, -O2):
<hidpp_cpu_to_be_u16>:
push   %rax
mov    %edi,%esi
lea    0x4(%rsp),%rdi
call   1030 <hidpp_set_unaligned_be_u16@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @hidpp_cpu_to_be_u16(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @hidpp_set_unaligned_be_u16(i32* %2, i32 %0)
%5 = load i32, i32* %2
ret i32 %5
}
void u5500_cg2900_init(void) { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @u5500_cg2900_init() {
ret void
}
int dect_is_multiframe_number(unsigned char *packet) {
  if ((packet[5] & 0xe0) == 0x80) {
    if ((packet[6] & 0xf0) == 0x60) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<dect_is_multiframe_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0xe0,%eax
cmp    $0x80,%eax
jne    1147 <dect_is_multiframe_number+0x47>
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%eax
and    $0xf0,%eax
cmp    $0x60,%eax
jne    1142 <dect_is_multiframe_number+0x42>
movl   $0x1,-0x4(%rbp)
jmp    114e <dect_is_multiframe_number+0x4e>
jmp    1147 <dect_is_multiframe_number+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dect_is_multiframe_number>:
mov    0x5(%rdi),%al
and    $0xe0,%al
cmp    $0x80,%al
jne    1119 <dect_is_multiframe_number+0x19>
mov    0x6(%rdi),%cl
and    $0xf0,%cl
mov    $0x1,%eax
cmp    $0x60,%cl
je     111b <dect_is_multiframe_number+0x1b>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @dect_is_multiframe_number(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 5
%3 = load i8, i8* %2
%4 = and i8 %3, -32
%5 = icmp eq i8 %4, -128
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 6
%8 = load i8, i8* %7
%9 = and i8 %8, -16
%10 = icmp eq i8 %9, 96
br i1 %10, label %12, label %11
11: ; preds = %6, %1
br label %12
12: ; preds = %6, %11
%13 = phi i32 [ 0, %11 ], [ 1, %6 ]
ret i32 %13
}