xunge/DecIR huggingface dataset:
unsigned char to_hex(unsigned char c) {
  if (__builtin_expect(!!(c < 10), 1)) {
    return c + '0';
  }
  return c - 10 + 'a';
}


x86 assembly (clang, -O0):
<to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
setl   %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     1138 <to_hex+0x38>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1145 <to_hex+0x45>
movzbl -0x2(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex>:
mov    $0x30,%al
cmp    $0xa,%dil
jae    110c <to_hex+0xc>
add    %dil,%al
ret
mov    $0x57,%al
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @to_hex(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 10
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = sext i32 %9 to i64
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = add nsw i32 %14, 48
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %23
17: ; preds = %1
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = sub nsw i32 %19, 10
%21 = add nsw i32 %20, 97
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
br label %23
23: ; preds = %17, %12
%24 = load i8, i8* %2
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @to_hex(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = select i1 %2, i8 48, i8 87
%4 = add i8 %3, %0
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_WR_BITS_PER_WORD;
scalar_t__ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int SPI_setBitsPerWord(int spidev_fd, uint8_t bits_per_word) {
  if (ioctl(spidev_fd, SPI_IOC_WR_BITS_PER_WORD, &bits_per_word) < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<SPI_setBitsPerWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1149 <SPI_setBitsPerWord+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <SPI_setBitsPerWord+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_setBitsPerWord>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@SPI_IOC_WR_BITS_PER_WORD = global i32 0
define i32 @SPI_setBitsPerWord(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* @SPI_IOC_WR_BITS_PER_WORD
%8 = call i64 @ioctl(i32 %6, i32 %7, i32* %5)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@SPI_IOC_WR_BITS_PER_WORD = global i32 0
define i32 @SPI_setBitsPerWord(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SPI_IOC_WR_BITS_PER_WORD
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %3)
%6 = ashr i64 %5, 63
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ mfread();
void midifile() { mfread(); }


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

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

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

LLVM IR (-O2):
define void @midifile() {
%1 = tail call i32 (...) @mfread()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sighandler(int i) { exit(0); }


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

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
xor    %edi,%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 0)
unreachable
}

LLVM IR (-O2):
define void @sighandler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
void macosxCGP_unused(void) {}


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

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

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

LLVM IR (-O2):
define void @macosxCGP_unused() {
ret void
}
/* Variables and functions */
double scalarProduct(double *, double *);
double squaredDistance(double *a) { return scalarProduct(a, a); }


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

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

LLVM IR (-O0):
define double @squaredDistance(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double*, double** %2
%5 = call double @scalarProduct(double* %3, double* %4)
ret double %5
}

LLVM IR (-O2):
define double @squaredDistance(double* %0) {
%2 = tail call double @scalarProduct(double* %0, double* %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ Binary(int);
main() { Binary(5); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <Binary@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Binary(i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char **argv) {
  fprintf(stderr, "usage: %s c input_directory blob_dir output_manifest\n",
          argv[0]);
  fprintf(stderr, "usage: %s x input_manifest blob_dir output_directory\n",
          argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xee7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xef9(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"usage: %s c input_directory blob_dir output_manifest\0A\00"
@.str.1 = [54 x i8] c"usage: %s x input_manifest blob_dir output_directory\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = load i8**, i8*** %2
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"usage: %s c input_directory blob_dir output_manifest\0A\00"
@.str.1 = [54 x i8] c"usage: %s x input_manifest blob_dir output_directory\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %0
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}
void lookharder(string) char *string;
{
  register char *g;
  register char *s;
  for (s = string; *s != '\0'; s++) {
    if (*s == '*') {
      *g++ = '.';
    } else
      *g++ = *s;
  }
}


x86 assembly (clang, -O0):
<lookharder>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1174 <lookharder+0x74>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    1147 <lookharder+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2e,(%rax)
jmp    115e <lookharder+0x5e>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1163 <lookharder+0x63>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <lookharder+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookharder>:
xor    %eax,%eax
jmp    1116 <lookharder+0x16>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %dl,(%rax)
add    $0x1,%rax
movzbl (%rdi,%rax,1),%ecx
mov    $0x2e,%dl
cmp    $0x2a,%cl
je     1110 <lookharder+0x10>
test   %cl,%cl
je     1129 <lookharder+0x29>
mov    %ecx,%edx
jmp    1110 <lookharder+0x10>
ret

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

LLVM IR (-O2):
define void @lookharder(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ undef, %1 ], [ %9, %7 ]
%4 = phi i8* [ %0, %1 ], [ %10, %7 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %11
i8 42, label %7
]
6: ; preds = %2
br label %7
7: ; preds = %2, %6
%8 = phi i8 [ %5, %6 ], [ 46, %2 ]
%9 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %8, i8* %3
%10 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
11: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ lookup_uart_by_name(char const *, char *);
int /*<<< orphan*/ stderr;
int get_uart_device_tree_name(const char *name, char *dt) {
  if (!lookup_uart_by_name(name, dt)) {
    fprintf(stderr, "return 0 get_uart");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<get_uart_device_tree_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <lookup_uart_by_name@plt>
cmp    $0x0,%eax
jne    1167 <get_uart_device_tree_name+0x47>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116e <get_uart_device_tree_name+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uart_device_tree_name>:
push   %rax
call   1040 <lookup_uart_by_name@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1133 <get_uart_device_tree_name+0x13>
pop    %rcx
ret
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"return 0 get_uart\00"
define i32 @get_uart_device_tree_name(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i32 @lookup_uart_by_name(i8* %6, i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"return 0 get_uart\00"
define i32 @get_uart_device_tree_name(i8* %0, i8* %1) {
%3 = tail call i32 @lookup_uart_by_name(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %9
}
char *hmac1hex(bitstr, bitcnt, key, keylen)
unsigned char *bitstr;
unsigned long bitcnt;
unsigned char *key;
unsigned int keylen;
{ return ((char *)hmaccomp(1, 2, bitstr, bitcnt, key, keylen)); }


x86 assembly (clang, -O0):
<hmac1hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <hmaccomp@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac1hex>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <hmaccomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @hmac1hex(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 1, i32 2, i8* %9, i64 %10, i8* %11, i32 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @hmac1hex(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 1, i32 2, i8* %0, i64 %1, i8* %2, i32 %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
struct myiphdr *ip_hdr(unsigned char *pkt_data) {
  return (struct myiphdr *)pkt_data;
}


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

x86 assembly (clang, -O2):
<ip_hdr>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.myiphdr = type opaque
define %struct.myiphdr* @ip_hdr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.myiphdr*
ret %struct.myiphdr* %4
}

LLVM IR (-O2):
%struct.myiphdr = type opaque
define %struct.myiphdr* @ip_hdr(i8* readnone %0) {
%2 = bitcast i8* %0 to %struct.myiphdr*
ret %struct.myiphdr* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version(void) {
  printf("MNDP Broadcaster 1.0\n"
         "Copyright (C) 2015-2016 Brno University of Technology\n"
         "Copyright (C) 2015 Ladislav Tylich <tylichl _at_ gmail.com>\n"
         "Copyright (C) 2016 Frantisek Burian <bufran _at_ seznam.cz>\n"
         "GNU Lesser General Public License, "
         "http://www.gnu.org/licenses/lgpl.html.\n"
         "This is free software; you are free to change and redistribute it.\n"
         "There is NO WARRANTY, to the extent permitted by law.\n");
}


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

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

LLVM IR (-O0):
@.str = [391 x i8] c"MNDP Broadcaster 1.0\0ACopyright (C) 2015-2016 Brno University of Technology\0ACopyright (C) 2015 Ladislav Tylich <tylichl _at_ gmail.com>\0ACopyright (C) 2016 Frantisek Burian <bufran _at_ seznam.cz>\0AGNU Lesser General Public License, http://www.gnu.org/licenses/lgpl.html.\0AThis is free software; you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([391 x i8], [391 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [390 x i8] c"MNDP Broadcaster 1.0\0ACopyright (C) 2015-2016 Brno University of Technology\0ACopyright (C) 2015 Ladislav Tylich <tylichl _at_ gmail.com>\0ACopyright (C) 2016 Frantisek Burian <bufran _at_ seznam.cz>\0AGNU Lesser General Public License, http://www.gnu.org/licenses/lgpl.html.\0AThis is free software; you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([390 x i8], [390 x i8]* @str, i64 0, i64 0))
ret void
}
void d_storeub(unsigned char **ptr, unsigned char data) { *(*ptr)++ = data; }


x86 assembly (clang, -O0):
<d_storeub>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_storeub>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %sil,(%rax)
ret

LLVM IR (-O0):
define void @d_storeub(i8** %0, i8 zeroext %1) {
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %6
store i8 %5, i8* %7
ret void
}

LLVM IR (-O2):
define void @d_storeub(i8** nocapture %0, i8 zeroext %1) {
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %0
store i8 %1, i8* %3
ret void
}
/* Variables and functions */
size_t TF_TString_ToActualSizeT(size_t size) { return size >> 2; }


x86 assembly (clang, -O0):
<TF_TString_ToActualSizeT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TF_TString_ToActualSizeT>:
mov    %rdi,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @TF_TString_ToActualSizeT(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 2
ret i64 %4
}

LLVM IR (-O2):
define i64 @TF_TString_ToActualSizeT(i64 %0) {
%2 = lshr i64 %0, 2
ret i64 %2
}
void ff_hevc_put_hevc_bi_qpel_hv32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_hv32_10_avx2() {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int raptor_compare_strings(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

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

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

LLVM IR (-O2):
define i32 @raptor_compare_strings(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ switch_off_bits(unsigned char *, int);
int /*<<< orphan*/ switch_on_bits(unsigned char *, int);
void CTRL_REGSC_BITSET_BW2000(unsigned char *data) {
  switch_on_bits(data, (0x40 | 0x20));
  switch_off_bits(data, (0x80));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x60,%esi
call   1030 <switch_on_bits@plt>
mov    -0x8(%rbp),%rdi
mov    $0x80,%esi
call   1040 <switch_off_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
mov    $0x60,%esi
call   1030 <switch_on_bits@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
pop    %rbx
jmp    1040 <switch_off_bits@plt>

LLVM IR (-O0):
define void @CTRL_REGSC_BITSET_BW2000(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @switch_on_bits(i8* %3, i32 96)
%5 = load i8*, i8** %2
%6 = call i32 @switch_off_bits(i8* %5, i32 128)
ret void
}

LLVM IR (-O2):
define void @CTRL_REGSC_BITSET_BW2000(i8* %0) {
%2 = tail call i32 @switch_on_bits(i8* %0, i32 96)
%3 = tail call i32 @switch_off_bits(i8* %0, i32 128)
ret void
}
int _XTransGetHostname(buf, maxlen)
char *buf;
int maxlen;
{
  int len;
  buf[0] = '\0';
  (void)gethostname(buf, maxlen);
  buf[maxlen - 1] = '\0';
  len = strlen(buf);
  return len;
}


x86 assembly (clang, -O0):
<_XTransGetHostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <gethostname@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_XTransGetHostname>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movb   $0x0,(%rdi)
xor    %eax,%eax
call   1040 <gethostname@plt>
movslq %ebp,%rax
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @_XTransGetHostname(i8* %0, i32 %1) {
store i8 0, i8* %0
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @gethostname to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
%7 = tail call i64 @strlen(i8* %0)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
struct tm *localtime_r(const time_t *timep, struct tm *result) {
  *result = *localtime(timep);
  return result;
}


x86 assembly (clang, -O0):
<localtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca i32*
%4 = alloca %struct.tm*
store i32* %0, i32** %3
store %struct.tm* %1, %struct.tm** %4
%5 = load %struct.tm*, %struct.tm** %4
%6 = load i32*, i32** %3
%7 = call %struct.tm* @localtime(i32* %6)
%8 = bitcast %struct.tm* %5 to i8*
%9 = bitcast %struct.tm* %7 to i8*
%10 = load %struct.tm*, %struct.tm** %4
ret %struct.tm* %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* returned writeonly %1) {
%3 = tail call %struct.tm* @localtime(i32* %0)
%4 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%5 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%6 = load i32, i32* %4
store i32 %6, i32* %5
ret %struct.tm* %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ setenv(char *, char *, int);
int main() {
  char *a[3];
  char *p;
  int i = 0;
  setenv("MALLOC_TRACE", "output.out", 1);
  mtrace();
  p = (char *)malloc(3 * 20);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xea3(%rip),%rdi
lea    0xea9(%rip),%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    $0x0,%al
call   1060 <mtrace@plt>
mov    $0x3c,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0xebe(%rip),%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
xor    %eax,%eax
call   1060 <mtrace@plt>
mov    $0x3c,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"MALLOC_TRACE\00"
@.str.1 = [11 x i8] c"output.out\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8*]
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%5 = call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = call i32 (...) @mtrace()
%7 = call i64 @malloc(i32 60)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"MALLOC_TRACE\00"
@.str.1 = [11 x i8] c"output.out\00"
define i32 @main() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i32 (...) @mtrace()
%3 = tail call i64 @malloc(i32 60)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @free(i8* %4)
ret i32 0
}
int dotfile(fullname)
char *fullname;
{
  char *name;
  name = strrchr(fullname, '/') + 1;
  return (!(strcmp(name, ".") && strcmp(name, "..")));
}


x86 assembly (clang, -O0):
<dotfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     117b <dotfile+0x5b>
mov    -0x10(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotfile>:
push   %rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,%rbx
add    $0x1,%rbx
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     115f <dotfile+0x3f>
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define i32 @dotfile(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i32 47)
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %10, %1
%15 = phi i1 [ false, %1 ], [ %13, %10 ]
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define i32 @dotfile(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int sum(float, float, float, float, float);
float average(float a, float b, float c, float d, float e) {
  return sum(a, b, c, d, e) / 5;
}


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
call   1030 <sum@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
push   %rax
call   1030 <sum@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @average(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %6
%12 = load float, float* %7
%13 = load float, float* %8
%14 = load float, float* %9
%15 = load float, float* %10
%16 = call i32 @sum(float %11, float %12, float %13, float %14, float %15)
%17 = sdiv i32 %16, 5
%18 = sitofp i32 %17 to float
ret float %18
}

LLVM IR (-O2):
define float @average(float %0, float %1, float %2, float %3, float %4) {
%6 = tail call i32 @sum(float %0, float %1, float %2, float %3, float %4)
%7 = sdiv i32 %6, 5
%8 = sitofp i32 %7 to float
ret float %8
}
void swap(int A[], int i, int j) {
  int temp = A[i];
  A[i] = A[j];
  A[j] = temp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ solve_maze(int **);
void main() {
  int maze[4][4] = {{1, 0, 0, 0}, {1, 1, 0, 1}, {0, 1, 0, 0}, {1, 1, 1, 1}};
  solve_maze(maze);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <solve_maze@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <solve_maze@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.maze = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 0, i32 0, i32 0], [4 x i32] [i32 1, i32 1, i32 0, i32 1], [4 x i32] [i32 0, i32 1, i32 0, i32 0], [4 x i32] [i32 1, i32 1, i32 1, i32 1]]
define void @main() {
%1 = alloca [4 x [4 x i32]]
%2 = bitcast [4 x [4 x i32]]* %1 to i8*
%3 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0
%4 = bitcast [4 x i32]* %3 to i32**
%5 = call i32 @solve_maze(i32** %4)
ret void
}

LLVM IR (-O2):
@__const.main.maze = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 0, i32 0, i32 0], [4 x i32] [i32 1, i32 1, i32 0, i32 1], [4 x i32] [i32 0, i32 1, i32 0, i32 0], [4 x i32] [i32 1, i32 1, i32 1, i32 1]]
define void @main() {
%1 = alloca [4 x [4 x i32]]
%2 = bitcast [4 x [4 x i32]]* %1 to i8*
%3 = bitcast [4 x [4 x i32]]* %1 to i32**
%4 = call i32 @solve_maze(i32** %3)
ret void
}
/* Variables and functions */
int f(double);
int main(void) { return f(5.5); }


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

x86 assembly (clang, -O2):
<main>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(double 5.500000e+00)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(double 5.500000e+00)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ setMovement(int /*<<< orphan*/, int /*<<< orphan*/);
void halt() { setMovement(0, 0); }


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <setMovement@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<halt>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <setMovement@plt>

LLVM IR (-O0):
define void @halt() {
%1 = call i32 @setMovement(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @halt() {
%1 = tail call i32 @setMovement(i32 0, i32 0)
ret void
}
/* Variables and functions */
float orgBlenderNoise(float, float, float);
float orgBlenderNoiseS(float x, float y, float z) {
  return (2.0f * orgBlenderNoise(x, y, z) - 1.0f);
}


x86 assembly (clang, -O0):
<orgBlenderNoiseS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <orgBlenderNoise@plt>
addss  %xmm0,%xmm0
movss  0xeb9(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgBlenderNoiseS>:
push   %rax
call   1030 <orgBlenderNoise@plt>
addss  %xmm0,%xmm0
addss  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @orgBlenderNoiseS(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @orgBlenderNoise(float %7, float %8, float %9)
%11 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %10, float -1.000000e+00)
ret float %11
}

LLVM IR (-O2):
define float @orgBlenderNoiseS(float %0, float %1, float %2) {
%4 = tail call float @orgBlenderNoise(float %0, float %1, float %2)
%5 = tail call float @llvm.fmuladd.f32(float %4, float 2.000000e+00, float -1.000000e+00)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ __NR_memfd_create;
int syscall(int /*<<< orphan*/, char const *, unsigned int);
int sys_memfd_create(const char *name, unsigned int flags) {
  return syscall(__NR_memfd_create, name, flags);
}


x86 assembly (clang, -O0):
<sys_memfd_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_memfd_create>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@__NR_memfd_create = global i32 0
define i32 @sys_memfd_create(i8* %0, i32 %1) {
%3 = load i32, i32* @__NR_memfd_create
%4 = tail call i32 @syscall(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
unsigned int sn_readl_fast(void *addr) {
  return *(volatile unsigned int *)addr;
}


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

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

LLVM IR (-O0):
define i32 @sn_readl_fast(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @sn_readl_fast(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int memcmp(void const *, void const *, int);
int time_t_cmp(const void *elt1, const void *elt2) {
  return memcmp(elt1, elt2, sizeof(time_t));
}


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

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

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

LLVM IR (-O2):
define i32 @time_t_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 4)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putenv(char *);
char *realloc(int /*<<< orphan*/ *, size_t);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *, int);
int strlen(char const *);
void int_to_env(const char *name, int value) {
  size_t len = 13 + strlen(name);
  char *buf = realloc(NULL, len);
  snprintf(buf, len, "%s=%d", name, value);
  putenv(buf);
}


x86 assembly (clang, -O0):
<int_to_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0xd,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1060 <realloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
lea    0xe77(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <putenv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_env>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1030 <strlen@plt>
add    $0xd,%eax
movslq %eax,%rbp
xor    %edi,%edi
mov    %rbp,%rsi
call   1060 <realloc@plt>
mov    %rax,%rbx
lea    0xe94(%rip),%rdx
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r15,%rcx
mov    %r14d,%r8d
call   1040 <snprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <putenv@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s=%d\00"
define void @int_to_env(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 13, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = call i8* @realloc(i32* null, i64 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i64, i64* %5
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = call i32 @snprintf(i8* %13, i64 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16)
%18 = load i8*, i8** %6
%19 = call i32 @putenv(i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s=%d\00"
define void @int_to_env(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 13
%5 = sext i32 %4 to i64
%6 = tail call i8* @realloc(i32* null, i64 %5)
%7 = tail call i32 @snprintf(i8* %6, i64 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%8 = tail call i32 @putenv(i8* %6)
ret void
}
int xmlUCSIsGothic(int code) {
  return (((code >= 0x10330) && (code <= 0x1034F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsGothic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x10330,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsGothic+0x26>
cmpl   $0x1034f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsGothic>:
add    $0xfffefcd0,%edi
xor    %eax,%eax
cmp    $0x20,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsGothic(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 66352
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 66383
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsGothic(i32 %0) {
%2 = add i32 %0, -66352
%3 = icmp ult i32 %2, 32
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ fabs(double);
double fmod(double, double);
double modulo(double d1, double d2) {
  double r_t = fmod(d1, d2);
  if (r_t < 0)
    r_t += fabs(d2);
  return r_t;
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    116d <modulo+0x4d>
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <fmod@plt>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1159 <modulo+0x39>
movsd  (%rsp),%xmm0
movsd  %xmm1,(%rsp)
call   1040 <fabs@plt>
movsd  (%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @modulo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double @fmod(double %6, double %7)
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load double, double* %4
%13 = call i64 @fabs(double %12)
%14 = sitofp i64 %13 to double
%15 = load double, double* %5
%16 = fadd double %15, %14
store double %16, double* %5
br label %17
17: ; preds = %11, %2
%18 = load double, double* %5
ret double %18
}

LLVM IR (-O2):
define double @modulo(double %0, double %1) {
%3 = tail call double @fmod(double %0, double %1)
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @fabs(double %1)
%7 = sitofp i64 %6 to double
%8 = fadd double %3, %7
br label %9
9: ; preds = %5, %2
%10 = phi double [ %8, %5 ], [ %3, %2 ]
ret double %10
}
/* Variables and functions */
float logf(float);
float futrts_log32(float x) { return logf(x); }


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

x86 assembly (clang, -O2):
<futrts_log32>:
jmp    1030 <logf@plt>

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

LLVM IR (-O2):
define float @futrts_log32(float %0) {
%2 = tail call float @logf(float %0)
ret float %2
}
int muspcm_setvol(int dev, int slot, int lv) { return (-1); }


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

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

LLVM IR (-O0):
define i32 @muspcm_setvol(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @muspcm_setvol(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}