xunge/DecIR huggingface dataset:
/* Variables and functions */
int lpr(int, int *);
int /*<<< orphan*/ printf(char *, int, int);
void t32(int value) {
  int n, cc;
  cc = lpr(value, &n);
  printf("new: %d cc: %d\n", n, cc);
}


x86 assembly (clang, -O0):
<t32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <lpr@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t32>:
push   %rax
lea    0x4(%rsp),%rsi
call   1040 <lpr@plt>
mov    0x4(%rsp),%esi
lea    0xeca(%rip),%rdi
mov    %eax,%edx
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"new: %d cc: %d\0A\00"
define void @t32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @lpr(i32 %5, i32* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"new: %d cc: %d\0A\00"
define void @t32(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @lpr(i32 %0, i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %4)
ret void
}
void zomb_flush(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @zomb_flush(i8* nocapture %0) {
ret void
}
int is_multiple_of(int a, int factor) { return (a % factor == 0); }


x86 assembly (clang, -O0):
<is_multiple_of>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_multiple_of>:
mov    %edi,%eax
cltd
idiv   %esi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_multiple_of(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_multiple_of(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ clear_bit(int, void *);
void clear_bit_le(int nr, void *addr) { clear_bit(nr ^ 0, addr); }


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

x86 assembly (clang, -O2):
<clear_bit_le>:
jmp    1030 <clear_bit@plt>

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

LLVM IR (-O2):
define void @clear_bit_le(i32 %0, i8* %1) {
%3 = tail call i32 @clear_bit(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showHelp() {
  printf("Usage: mqtt-bridge [OPTIONS] \n"
         "Options:\n"
         "    -b, --baud     set serial baud\n"
         "    -d, --device   set serial device\n"
         "    -t, --topic    set mqtt sudiribe topic\n"
         "    -v, --version  print version\n"
         "    -h, --help     print this help text\n\n");
}


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

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

LLVM IR (-O0):
@.str = [229 x i8] c"Usage: mqtt-bridge [OPTIONS] \0AOptions:\0A -b, --baud set serial baud\0A -d, --device set serial device\0A -t, --topic set mqtt sudiribe topic\0A -v, --version print version\0A -h, --help print this help text\0A\0A\00"
define void @showHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [228 x i8] c"Usage: mqtt-bridge [OPTIONS] \0AOptions:\0A -b, --baud set serial baud\0A -d, --device set serial device\0A -t, --topic set mqtt sudiribe topic\0A -v, --version print version\0A -h, --help print this help text\0A\00"
define void @showHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([228 x i8], [228 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int stricmp(const char *str1, const char *str2) {
  return strcasecmp(str1, str2);
}


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

x86 assembly (clang, -O2):
<stricmp>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @stricmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void pack16_int(uint8_t *buf, uint16_t x) {
  *buf++ = x >> 8;
  *buf++ = x;
}


x86 assembly (clang, -O0):
<pack16_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack16_int>:
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,(%rdi)
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @pack16_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %3
store i32 %6, i32* %7
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %3
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @pack16_int(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %0
store i32 %1, i32* %4
ret void
}
void bfqg_stats_update_io_merged(struct bfq_group *bfqg, unsigned int op) {}


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

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

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

LLVM IR (-O2):
%struct.bfq_group = type opaque
define void @bfqg_stats_update_io_merged(%struct.bfq_group* nocapture %0, i32 %1) {
ret void
}
void XtDisplay() {}


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

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

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

LLVM IR (-O2):
define void @XtDisplay() {
ret void
}
/* Type definitions */
typedef scalar_t__ off_t;
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ftell(int /*<<< orphan*/ *);
int fgetpos(FILE *fp, fpos_t *pos) {
  off_t off = ftell(fp);
  if (off < 0)
    return -1;
  *(off_t *)pos = off;
  return 0;
}


x86 assembly (clang, -O0):
<fgetpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1144 <fgetpos+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <fgetpos+0x46>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetpos>:
push   %rbx
mov    %rsi,%rbx
call   1030 <ftell@plt>
test   %rax,%rax
js     1125 <fgetpos+0x15>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fgetpos(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %4
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = load i64, i64* %6
%14 = load i32*, i32** %5
%15 = bitcast i32* %14 to i64*
store i64 %13, i64* %15
store i32 0, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @fgetpos(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = tail call i64 @ftell(i32* %0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = bitcast i32* %1 to i64*
store i64 %3, i64* %6
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Type definitions */
struct argparse_option {
  int dummy;
};
struct argparse {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int show_version_cb(struct argparse *this,
                    const struct argparse_option *option) {
  printf("snake version %s\n", "0.1");
  exit(0);
}


x86 assembly (clang, -O0):
<show_version_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_version_cb>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.argparse = type { i32 }
%struct.argparse_option = type { i32 }
@.str = [18 x i8] c"snake version %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define i32 @show_version_cb(%struct.argparse* %0, %struct.argparse_option* %1) {
%3 = alloca %struct.argparse*
%4 = alloca %struct.argparse_option*
store %struct.argparse* %0, %struct.argparse** %3
store %struct.argparse_option* %1, %struct.argparse_option** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.argparse = type { i32 }
%struct.argparse_option = type { i32 }
@.str = [18 x i8] c"snake version %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define i32 @show_version_cb(%struct.argparse* nocapture readnone %0, %struct.argparse_option* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
unsigned brp_map_hash(const char *str, void *storage) {
  unsigned hash = 5381;
  while (*str) {
    hash = ((hash << 5) + hash) ^ *str++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<brp_map_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <brp_map_hash+0x45>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <brp_map_hash+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brp_map_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <brp_map_hash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <brp_map_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @brp_map_hash(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 5381, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = mul i32 %7, 33
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %6 to i32
%12 = xor i32 %9, %11
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 5381, %2 ], [ %12, %5 ]
ret i32 %16
}
void l4x_debug_stats_pagefault_hit(void) {}


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

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

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

LLVM IR (-O2):
define void @l4x_debug_stats_pagefault_hit() {
ret void
}
unsigned char _ucTelDisconnect(void) { return (0); }


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

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

LLVM IR (-O0):
define zeroext i8 @_ucTelDisconnect() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @_ucTelDisconnect() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void _out_char(char character, void *buffer, size_t idx, size_t maxlen) {
  (void)buffer;
  (void)idx;
  (void)maxlen;
  if (character) {
    putchar(character);
  }
}


x86 assembly (clang, -O0):
<_out_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     113d <_out_char+0x2d>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_out_char>:
test   %dil,%dil
je     111e <_out_char+0xe>
movsbl %dil,%edi
jmp    1030 <putchar@plt>
ret

LLVM IR (-O0):
define void @_out_char(i8 signext %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8 %0, i8* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %6
%10 = load i64, i64* %7
%11 = load i64, i64* %8
%12 = load i8, i8* %5
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %4
%15 = load i8, i8* %5
%16 = call i32 @putchar(i8 signext %15)
br label %17
17: ; preds = %14, %4
ret void
}

LLVM IR (-O2):
define void @_out_char(i8 signext %0, i8* nocapture readnone %1, i64 %2, i64 %3) {
%5 = icmp eq i8 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @putchar(i8 signext %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int runCmd(char const **);
int doWebStart(FILE *file, int argc, char **argv) {
  const char *args[] = {"/etc/init.d/bitmeterweb", "start", 0};
  return runCmd(args);
}


x86 assembly (clang, -O0):
<doWebStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2cd6(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cd3(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cd0(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <runCmd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doWebStart>:
sub    $0x18,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <runCmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"/etc/init.d/bitmeterweb\00"
@.str.1 = [6 x i8] c"start\00"
@__const.doWebStart.args = [3 x i8*] [i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @doWebStart(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca [3 x i8*]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = bitcast [3 x i8*]* %7 to i8*
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %7, i64 0, i64 0
%10 = call i32 @runCmd(i8** %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [24 x i8] c"/etc/init.d/bitmeterweb\00"
@.str.1 = [6 x i8] c"start\00"
@__const.doWebStart.args = [3 x i8*] [i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @doWebStart(i32* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = alloca [3 x i8*]
%5 = bitcast [3 x i8*]* %4 to i8*
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%7 = call i32 @runCmd(i8** %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ out(int, int);
void vga_crt_out(int index, int data) {
  out(0x03D4, index);
  out(0x03D5, data);
}


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

x86 assembly (clang, -O2):
<vga_crt_out>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x3d4,%edi
call   1030 <out@plt>
mov    $0x3d5,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <out@plt>

LLVM IR (-O0):
define void @vga_crt_out(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 = call i32 @out(i32 980, i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @out(i32 981, i32 %7)
ret void
}

LLVM IR (-O2):
define void @vga_crt_out(i32 %0, i32 %1) {
%3 = tail call i32 @out(i32 980, i32 %0)
%4 = tail call i32 @out(i32 981, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_fpga_cleanup();
int /*<<< orphan*/ display_gpio_cleanup();
void display_cleanup(void) {
  display_gpio_cleanup();
  display_fpga_cleanup();
}


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

x86 assembly (clang, -O2):
<display_cleanup>:
push   %rax
xor    %eax,%eax
call   1030 <display_gpio_cleanup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <display_fpga_cleanup@plt>

LLVM IR (-O0):
define void @display_cleanup() {
%1 = call i32 (...) @display_gpio_cleanup()
%2 = call i32 (...) @display_fpga_cleanup()
ret void
}

LLVM IR (-O2):
define void @display_cleanup() {
%1 = tail call i32 (...) @display_gpio_cleanup()
%2 = tail call i32 (...) @display_fpga_cleanup()
ret void
}
int f(int i __attribute__((__unused__))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FS_maybeUnix();
scalar_t__ file_isreg(int);
int /*<<< orphan*/ file_isselectable(int);
int readyAlways(int fd) {
  if (file_isreg(fd))
    return 1;
  if (!FS_maybeUnix() && !file_isselectable(fd))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<readyAlways>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <file_isreg@plt>
cmp    $0x0,%rax
je     1159 <readyAlways+0x29>
movl   $0x1,-0x4(%rbp)
jmp    118d <readyAlways+0x5d>
mov    $0x0,%al
call   1040 <FS_maybeUnix@plt>
cmp    $0x0,%eax
jne    1186 <readyAlways+0x56>
mov    -0x8(%rbp),%edi
call   1030 <file_isselectable@plt>
cmp    $0x0,%eax
jne    1186 <readyAlways+0x56>
movl   $0x1,-0x4(%rbp)
jmp    118d <readyAlways+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readyAlways>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <file_isreg@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115c <readyAlways+0x2c>
xor    %eax,%eax
call   1040 <FS_maybeUnix@plt>
test   %eax,%eax
jne    115a <readyAlways+0x2a>
mov    %ebp,%edi
call   1030 <file_isselectable@plt>
test   %eax,%eax
je     115c <readyAlways+0x2c>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @readyAlways(i32 %0) {
%2 = tail call i64 @file_isreg(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i32 (...) @FS_maybeUnix()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @file_isselectable(i32 %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %4
br label %11
11: ; preds = %7, %1, %10
%12 = phi i32 [ 0, %10 ], [ 1, %1 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int const);
void couleur(const unsigned int typeCouleur) {
  printf("\033[%dm", typeCouleur);
}


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

x86 assembly (clang, -O2):
<couleur>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dm\00"
define void @couleur(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void func_2e(int const **const i) {
  printf("func_2e : %d >> ", **i);
  {
    int const *bkup = *i;
    int x = 20;
    int const *y = &x;
    *i = y;
    printf("%d\n", **i);
    *i = bkup;
  }
}


x86 assembly (clang, -O0):
<func_2e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_2e>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%esi
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%r14
movl   $0x14,0x4(%rsp)
lea    0x4(%rsp),%rax
mov    %rax,(%rbx)
lea    0xecf(%rip),%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"func_2e : %d >> \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @func_2e(i32** nocapture %0) {
%2 = alloca i32
%3 = load i32*, i32** %0
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %0
%7 = bitcast i32* %2 to i8*
store i32 20, i32* %2
store i32* %2, i32** %0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 20)
store i32* %6, i32** %0
ret void
}
int test_imm_89int16_mem(short *val) {
  return ((*val) & (0x89 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_89int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x89,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_89int16_mem>:
testb  $0x89,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_89int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 137
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int pr70085(int x, int y) {
  if (x > y)
    return x - y;
  if (x == y)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1124 <pr70085+0x24>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <pr70085+0x43>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    113c <pr70085+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1143 <pr70085+0x43>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
neg    %eax
sub    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @pr70085(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* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %3
br label %19
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 0, i32* %3
br label %19
18: ; preds = %13
store i32 -1, i32* %3
br label %19
19: ; preds = %18, %17, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @pr70085(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sub nsw i32 %0, %1
%5 = icmp ne i32 %0, %1
%6 = sext i1 %5 to i32
%7 = select i1 %3, i32 %4, i32 %6
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool nth_position(uint32_t num, int position) {
  return ((num >> position) & 1);
}


x86 assembly (clang, -O0):
<nth_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_position>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nth_position(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = and i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @nth_position(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int close(int);
int i2c_close(int i2cfd) { return close(i2cfd); }


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

x86 assembly (clang, -O2):
<i2c_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @i2c_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ CompileWord(int, long);
void DoToBody(void) {
  CompileWord(95, 1);
  CompileWord(11, 0L);
}


x86 assembly (clang, -O0):
<DoToBody>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5f,%edi
mov    $0x1,%esi
call   1030 <CompileWord@plt>
mov    $0xb,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <CompileWord@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoToBody>:
push   %rax
mov    $0x1,%esi
mov    $0x5f,%edi
call   1030 <CompileWord@plt>
mov    $0xb,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <CompileWord@plt>

LLVM IR (-O0):
define void @DoToBody() {
%1 = call i32 @CompileWord(i32 95, i64 1)
%2 = call i32 @CompileWord(i32 11, i64 0)
ret void
}

LLVM IR (-O2):
define void @DoToBody() {
%1 = tail call i32 @CompileWord(i32 95, i64 1)
%2 = tail call i32 @CompileWord(i32 11, i64 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interactive();
main() { interactive(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @interactive()
ret i32 0
}
int find7(int array[], int start) { return -1; }


x86 assembly (clang, -O0):
<find7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @find7(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @find7(i32* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ copy(char const *, char const *);
int /*<<< orphan*/ printf(char *);
int test_copy(const char *from, const char *to) {
  printf("Testing copy()\n");
  copy(from, to);
  printf("Done!\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <copy@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <copy@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Testing copy()\0A\00"
@.str.1 = [8 x i8] c"Done!\0A\0A\00"
define i32 @test_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @copy(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Testing copy()\00"
@str.2 = [7 x i8] c"Done!\0A\00"
define i32 @test_copy(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @copy(i8* %0, i8* %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand0();
int main(void) {
  int count;
  for (count = 0; count < 5; count++) {
    printf("%d\n", rand0());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1163 <main+0x43>
mov    $0x0,%al
call   1040 <rand0@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rand0@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <rand0@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <rand0@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <rand0@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <rand0@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @rand0()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @rand0()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @rand0()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @rand0()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @rand0()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int BNCDigitUp() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(42);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCDigitUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0x2a,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCDigitUp>:
push   %rax
mov    $0x2a,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNCDigitUp() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 42)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNCDigitUp() {
%1 = tail call i32 @BNCIO(i32 42)
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ abort_game(char *, char const *, unsigned long);
void *malloc(size_t);
void *malloc_safe(size_t size, char const *file, unsigned long line) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL) {
    abort_game("malloc call failed", file, line);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<malloc_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1160 <malloc_safe+0x40>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xea5(%rip),%rdi
call   1040 <abort_game@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_safe>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <malloc_safe+0x2a>
lea    0xec1(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <abort_game@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"malloc call failed\00"
define noalias i8* @malloc_safe(i64 %0, i8* %1, i64 %2) {
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @abort_game(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %2)
br label %8
8: ; preds = %6, %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ register_indp_function_list();
void indp_init() { register_indp_function_list(); }


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

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

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

LLVM IR (-O2):
define void @indp_init() {
%1 = tail call i32 (...) @register_indp_function_list()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ allocExitError(char *, size_t, size_t, char const *);
void *calloc(size_t, size_t);
void *callocOrExit3(size_t count, size_t size, const char *name) {
  void *p = calloc(count, size);
  if (p == 0 && count > 0)
    allocExitError("calloc", count, size, name);
  return p;
}


x86 assembly (clang, -O0):
<callocOrExit3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <callocOrExit3+0x53>
cmpq   $0x0,-0x8(%rbp)
jbe    1173 <callocOrExit3+0x53>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe92(%rip),%rdi
call   1030 <allocExitError@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callocOrExit3>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <calloc@plt>
mov    %rax,%r12
test   %rbx,%rbx
je     1158 <callocOrExit3+0x38>
test   %r12,%r12
jne    1158 <callocOrExit3+0x38>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <allocExitError@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"calloc\00"
define noalias i8* @callocOrExit3(i64 %0, i64 %1, i8* %2) {
%4 = tail call i8* @calloc(i64 %0, i64 %1)
%5 = icmp eq i8* %4, null
%6 = icmp ne i64 %0, 0
%7 = and i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @allocExitError(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i8* %2)
br label %10
10: ; preds = %8, %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ tcoord_init_lut();
int /*<<< orphan*/ tmem_init_lut();
void tex_init_lut(void) {
  tmem_init_lut();
  tcoord_init_lut();
}


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

x86 assembly (clang, -O2):
<tex_init_lut>:
push   %rax
xor    %eax,%eax
call   1040 <tmem_init_lut@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tcoord_init_lut@plt>

LLVM IR (-O0):
define void @tex_init_lut() {
%1 = call i32 (...) @tmem_init_lut()
%2 = call i32 (...) @tcoord_init_lut()
ret void
}

LLVM IR (-O2):
define void @tex_init_lut() {
%1 = tail call i32 (...) @tmem_init_lut()
%2 = tail call i32 (...) @tcoord_init_lut()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *ether_aton(char const *);
int check_mac_format(const char possiblemac[]) {
  return ether_aton(possiblemac) != NULL;
}


x86 assembly (clang, -O0):
<check_mac_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ether_aton@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_mac_format>:
push   %rax
call   1030 <ether_aton@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_mac_format(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @ether_aton(i8* %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @check_mac_format(i8* %0) {
%2 = tail call i32* @ether_aton(i8* %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void test_invalid_clause() {
  int i;
#pragma omp target teams distribute simd foo bar
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_invalid_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_invalid_clause+0x28>
jmp    111a <test_invalid_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_invalid_clause+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_invalid_clause() {
%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, 16
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 @test_invalid_clause() {
ret void
}
int func_complete(double input) {
  (void)input;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @func_complete(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret i32 1
}

LLVM IR (-O2):
define i32 @func_complete(double %0) {
ret i32 1
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int, unsigned int, char const *,
                       void const *, int);
int shim_fsconfig(int fd, unsigned int cmd, const char *key, const void *value,
                  int aux) {
  return (int)shim_enosys(0, fd, cmd, key, value, aux);
}


x86 assembly (clang, -O0):
<shim_fsconfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_fsconfig>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_fsconfig(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i64 @shim_enosys(i32 0, i32 %11, i32 %12, i8* %13, i8* %14, i32 %15)
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @shim_fsconfig(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i64 @shim_enosys(i32 0, i32 %0, i32 %1, i8* %2, i8* %3, i32 %4)
%7 = trunc i64 %6 to i32
ret i32 %7
}