xunge/DecIR huggingface dataset:
int xgetc(unsigned char **in, unsigned char *inl) {
  int ret;
  if (*in >= inl)
    return (-1);
  ret = **in;
  (*in)++;
  return (ret);
}


x86 assembly (clang, -O0):
<xgetc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jb     1129 <xgetc+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <xgetc+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgetc>:
mov    (%rdi),%rcx
mov    $0xffffffff,%eax
cmp    %rsi,%rcx
jae    1117 <xgetc+0x17>
movzbl (%rcx),%eax
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @xgetc(i8** nocapture %0, i8* readnone %1) {
%3 = load i8*, i8** %0
%4 = icmp ult i8* %3, %1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %8, i8** %0
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %7, %5 ], [ -1, %2 ]
ret i32 %10
}
int remove_package() {}


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

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

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

LLVM IR (-O2):
define i32 @remove_package() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ht1632_chipselect(unsigned char);
int /*<<< orphan*/ ht1632_writebits(unsigned char, int);
void ht1632_sendcmd(unsigned char chipNo, unsigned char command) {
  ht1632_chipselect(chipNo);
  ht1632_writebits(4, 1 << 2);
  ht1632_writebits(command, 1 << 7);
  ht1632_writebits(0, 1);
  ht1632_chipselect(0);
}


x86 assembly (clang, -O0):
<ht1632_sendcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <ht1632_chipselect@plt>
mov    $0x4,%esi
mov    %esi,%edi
call   1040 <ht1632_writebits@plt>
mov    $0x80,%esi
movzbl -0x2(%rbp),%edi
call   1040 <ht1632_writebits@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <ht1632_writebits@plt>
xor    %edi,%edi
call   1030 <ht1632_chipselect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht1632_sendcmd>:
push   %rbx
mov    %esi,%ebx
call   1030 <ht1632_chipselect@plt>
mov    $0x4,%edi
mov    $0x4,%esi
call   1040 <ht1632_writebits@plt>
mov    %ebx,%edi
mov    $0x80,%esi
call   1040 <ht1632_writebits@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <ht1632_writebits@plt>
xor    %edi,%edi
pop    %rbx
jmp    1030 <ht1632_chipselect@plt>

LLVM IR (-O0):
define void @ht1632_sendcmd(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @ht1632_chipselect(i8 zeroext %5)
%7 = call i32 @ht1632_writebits(i8 zeroext 4, i32 4)
%8 = load i8, i8* %4
%9 = call i32 @ht1632_writebits(i8 zeroext %8, i32 128)
%10 = call i32 @ht1632_writebits(i8 zeroext 0, i32 1)
%11 = call i32 @ht1632_chipselect(i8 zeroext 0)
ret void
}

LLVM IR (-O2):
define void @ht1632_sendcmd(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @ht1632_chipselect(i8 zeroext %0)
%4 = tail call i32 @ht1632_writebits(i8 zeroext 4, i32 4)
%5 = tail call i32 @ht1632_writebits(i8 zeroext %1, i32 128)
%6 = tail call i32 @ht1632_writebits(i8 zeroext 0, i32 1)
%7 = tail call i32 @ht1632_chipselect(i8 zeroext 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x, y;
  x = 2;
  y = 5;
  if (y > 8)
    y = y * 2;
  else
    x = x * 2;
  printf("%d", x = x + y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jle    1145 <main+0x35>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114e <main+0x3e>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
mov    %esi,-0x8(%rbp)
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
float inv_q16_to_float(long q16) { return (float)q16 / (1L << 16); }


x86 assembly (clang, -O0):
<inv_q16_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_q16_to_float>:
cvtsi2ss %rdi,%xmm0
mulss  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define float @inv_q16_to_float(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = fdiv float %4, 6.553600e+04
ret float %5
}

LLVM IR (-O2):
define float @inv_q16_to_float(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = fmul float %2, 0x3EF0000000000000
ret float %3
}
int patmatch(pattern, string)
char *pattern;
char *string;
{
  if (pattern[0] == '!' && pattern[1] == '!')
    return 1 - pmatch(pattern + 2, string);
  else
    return pmatch(pattern, string);
}


x86 assembly (clang, -O0):
<patmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
jne    1165 <patmatch+0x55>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x21,%eax
jne    1165 <patmatch+0x55>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <pmatch@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <patmatch+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <pmatch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<patmatch>:
push   %rax
cmpb   $0x21,(%rdi)
jne    1132 <patmatch+0x22>
cmpb   $0x21,0x1(%rdi)
jne    1132 <patmatch+0x22>
add    $0x2,%rdi
xor    %eax,%eax
call   1030 <pmatch@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <pmatch@plt>

LLVM IR (-O0):
define i32 @patmatch(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 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 33
br i1 %10, label %11, label %23
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 33
br i1 %16, label %17, label %23
17: ; preds = %11
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8*, i8** %5
%21 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pmatch to i32 (i8*, i8*, ...)*)(i8* %19, i8* %20)
%22 = sub nsw i32 1, %21
store i32 %22, i32* %3
br label %27
23: ; preds = %11, %2
%24 = load i8*, i8** %4
%25 = load i8*, i8** %5
%26 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pmatch to i32 (i8*, i8*, ...)*)(i8* %24, i8* %25)
store i32 %26, i32* %3
br label %27
27: ; preds = %23, %17
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @patmatch(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 33
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 33
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pmatch to i32 (i8*, i8*, ...)*)(i8* %10, i8* %1)
%12 = sub nsw i32 1, %11
br label %15
13: ; preds = %5, %2
%14 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pmatch to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
br label %15
15: ; preds = %13, %9
%16 = phi i32 [ %12, %9 ], [ %14, %13 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ make_length_code_tables(int, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("#ifndef _CODES_TABLE_H\n");
  printf("#define _CODES_TABLE_H\n\n");
  make_length_code_tables(28, 3);
  printf("#endif\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1c,%edi
mov    $0x3,%esi
call   1040 <make_length_code_tables@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1c,%edi
mov    $0x3,%esi
call   1040 <make_length_code_tables@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"#ifndef _CODES_TABLE_H\0A\00"
@.str.1 = [25 x i8] c"#define _CODES_TABLE_H\0A\0A\00"
@.str.2 = [8 x i8] c"#endif\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @make_length_code_tables(i32 28, i32 3)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"#ifndef _CODES_TABLE_H\00"
@str.3 = [24 x i8] c"#define _CODES_TABLE_H\0A\00"
@str.4 = [7 x i8] c"#endif\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @make_length_code_tables(i32 28, i32 3)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
int hexc(char c, struct Parser *p, int index) {
  int n = hex(c);
  if (n < 0)
    error(p, "bad hex constant", index);
  return n;
}


x86 assembly (clang, -O0):
<hexc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1040 <hex@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1162 <hexc+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1030 <error@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexc>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <hex@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    114b <hexc+0x2b>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <error@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.Parser = type opaque
@.str = [17 x i8] c"bad hex constant\00"
define i32 @hexc(i8 signext %0, %struct.Parser* %1, i32 %2) {
%4 = alloca i8
%5 = alloca %struct.Parser*
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %4
store %struct.Parser* %1, %struct.Parser** %5
store i32 %2, i32* %6
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @hex to i32 (i32, ...)*)(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load %struct.Parser*, %struct.Parser** %5
%15 = load i32, i32* %6
%16 = call i32 (%struct.Parser*, i8*, i32, ...) bitcast (i32 (...)* @error to i32 (%struct.Parser*, i8*, i32, ...)*)(%struct.Parser* %14, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
%struct.Parser = type opaque
@.str = [17 x i8] c"bad hex constant\00"
define i32 @hexc(i8 signext %0, %struct.Parser* %1, i32 %2) {
%4 = sext i8 %0 to i32
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @hex to i32 (i32, ...)*)(i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (%struct.Parser*, i8*, i32, ...) bitcast (i32 (...)* @error to i32 (%struct.Parser*, i8*, i32, ...)*)(%struct.Parser* %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %9
9: ; preds = %7, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ delay;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(int /*<<< orphan*/ *, void const *, int);
uint32_t inv_fifo_protocol_helper_decode_delay(const void *in, uint16_t len) {
  uint32_t delay;
  FifoProtocol_memcpy((&delay), (in), (sizeof(delay)));
  (void)len;
  return delay;
}


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

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_delay>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @inv_fifo_protocol_helper_decode_delay(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @FifoProtocol_memcpy(i32* %3, i8* %0, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ return_sense(int, int /*<<< orphan*/, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
void sam_hardware_error(uint16_t ascq, uint8_t *sam_stat) {
  return_sense(0x04, ascq, NULL, sam_stat);
}


x86 assembly (clang, -O0):
<sam_hardware_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <return_sense@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sam_hardware_error>:
mov    %rsi,%rcx
mov    %edi,%esi
mov    $0x4,%edi
xor    %edx,%edx
jmp    1030 <return_sense@plt>

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

LLVM IR (-O2):
define void @sam_hardware_error(i32 %0, i32* %1) {
%3 = tail call i32 @return_sense(i32 4, i32 %0, i32* null, i32* %1)
ret void
}
long long gll2(long long j, unsigned char *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<gll2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gll2>:
movzbl (%rsi,%rdx,1),%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @gll2(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @gll2(i64 %0, i8* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
__attribute__((no, noclone)) unsigned __int128 t173_3sub(signed __int128 y) {
  unsigned __int128 r;
  if (__builtin_sub_overflow((signed __int128)(-3), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t173_3sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rsi
mov    %rsi,%rax
sar    $0x3f,%rax
mov    $0xfffffffffffffffd,%rdx
sub    %rcx,%rdx
mov    $0xffffffffffffffff,%r9
mov    %r9,%rcx
sbb    %rsi,%rcx
mov    %r9,%r8
sbb    %rax,%r8
sbb    %rax,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1194 <t173_3sub+0x84>
jmp    119b <t173_3sub+0x8b>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t173_3sub>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffffffffffffd,%r14
sub    %rdi,%r14
mov    $0xffffffffffffffff,%rbx
sbb    %rsi,%rbx
cmp    $0xfffffffffffffffe,%rdi
sbb    $0xffffffffffffffff,%rsi
jl     1139 <t173_3sub+0x29>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t173_3sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 -3, i129 %12)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t173_3sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = sub nuw i129 -3, %7
%9 = icmp sgt i128 %6, -3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
unsigned long foo(int *a) { return (unsigned long)a; }


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

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

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

LLVM IR (-O2):
define i64 @foo(i32* %0) {
%2 = ptrtoint i32* %0 to i64
ret i64 %2
}
/* Variables and functions */
void ft_intzero(int *tab, size_t size) {
  size_t i;
  i = 0;
  if (!tab)
    return;
  while (i < size) {
    tab[i] = 0;
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_intzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1124 <ft_intzero+0x24>
jmp    1157 <ft_intzero+0x57>
jmp    1129 <ft_intzero+0x29>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1157 <ft_intzero+0x57>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1129 <ft_intzero+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_intzero>:
test   %rdi,%rdi
je     112d <ft_intzero+0x1d>
mov    %rsi,%rdx
test   %rsi,%rsi
je     112d <ft_intzero+0x1d>
push   %rax
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @ft_intzero(i32* writeonly %0, i64 %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = bitcast i32* %0 to i8*
%8 = shl nuw i64 %1, 2
br label %9
9: ; preds = %6, %2
ret void
}
__attribute__((always_)) void FinalizeSpinLock(struct spin_lock *lck) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.spin_lock = type opaque
define void @FinalizeSpinLock(%struct.spin_lock* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("-----HELLO WORLD-----\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"-----HELLO WORLD-----\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _log_error(char *);
int /*<<< orphan*/ _raise_exception();
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void _mem_range(int size, int line) {
  if (size <= 0 || size > 64 * 1024) {
    char buf[64];
    sprintf(buf, "catch a invalid malloc size:%d line:%d\n", size, line);
    _log_error(buf);
    _raise_exception();
  }
}


x86 assembly (clang, -O0):
<_mem_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1155 <_mem_range+0x25>
cmpl   $0x10000,-0x4(%rbp)
jle    117b <_mem_range+0x4b>
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe9a(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <_log_error@plt>
mov    $0x0,%al
call   1030 <_raise_exception@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mem_range>:
mov    %edi,%edx
lea    -0x10001(%rdx),%eax
cmp    $0xfffeffff,%eax
ja     116c <_mem_range+0x3c>
push   %rbx
sub    $0x40,%rsp
mov    %esi,%ecx
lea    0xeb3(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <_log_error@plt>
xor    %eax,%eax
call   1030 <_raise_exception@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"catch a invalid malloc size:%d line:%d\0A\00"
define void @_mem_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 65536
br i1 %10, label %11, label %19
11: ; preds = %8, %2
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%17 = call i32 @_log_error(i8* %16)
%18 = call i32 (...) @_raise_exception()
br label %19
19: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"catch a invalid malloc size:%d line:%d\0A\00"
define void @_mem_range(i32 %0, i32 %1) {
%3 = alloca [64 x i8]
%4 = add i32 %0, -65537
%5 = icmp ult i32 %4, -65536
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%9 = call i32 @_log_error(i8* %7)
%10 = call i32 (...) @_raise_exception()
br label %11
11: ; preds = %2, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g();
f() { g(); }


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

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = call i32 (...) @g()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 (...) @g()
ret i32 undef
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_02(uint64_t x) {
  __asm__("rolq $2, %0" : "=r"(x) : "0"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i8* @ROL64_02(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$2, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_02(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$2, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo(int);
int main(void) {
  if (foo(0xabcd0000L) != 0 || foo(0) != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xabcd0000,%edi
call   1040 <foo@plt>
cmp    $0x0,%eax
jne    1162 <main+0x32>
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1169 <main+0x39>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xabcd0000,%edi
call   1040 <foo@plt>
test   %eax,%eax
jne    1152 <main+0x22>
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1152 <main+0x22>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 -1412628480)
%3 = icmp ne i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i32 @foo(i32 0)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %4, %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %4
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 -1412628480)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @foo(i32 0)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
%9 = tail call i32 @exit(i32 0)
unreachable
}
char firstChar1(char *s) { return *s; }


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

x86 assembly (clang, -O2):
<firstChar1>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @firstChar1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @firstChar1(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
int someFunc(int i1, char c, int i2) {
  (void)i1;
  (void)c;
  (void)i2;
  return 0;
}


x86 assembly (clang, -O0):
<someFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @someFunc(i32 %0, i8 signext %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
store i32 %0, i32* %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @someFunc(i32 %0, i8 signext %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TriMessage(char *);
void precisionerror() {
  TriMessage("Try increasing the area criterion and/or reducing the minimum\n");
  TriMessage("  allowable angle so that tiny triangles are not created.\n");
}


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

x86 assembly (clang, -O2):
<precisionerror>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <TriMessage@plt>
lea    0xf1b(%rip),%rdi
pop    %rax
jmp    1030 <TriMessage@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"Try increasing the area criterion and/or reducing the minimum\0A\00"
@.str.1 = [59 x i8] c" allowable angle so that tiny triangles are not created.\0A\00"
define void @precisionerror() {
%1 = call i32 @TriMessage(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @TriMessage(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"Try increasing the area criterion and/or reducing the minimum\0A\00"
@.str.1 = [59 x i8] c" allowable angle so that tiny triangles are not created.\0A\00"
define void @precisionerror() {
%1 = tail call i32 @TriMessage(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @TriMessage(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long get_rm_size(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @get_rm_size() {
ret i64 0
}

LLVM IR (-O2):
define i64 @get_rm_size() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ non_existent(int);
void hip2(void (*g)()) {
  non_existent(2);
  g();
}


x86 assembly (clang, -O0):
<hip2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <non_existent@plt>
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hip2>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
call   1030 <non_existent@plt>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

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

LLVM IR (-O2):
define void @hip2(void (...)* nocapture %0) {
%2 = tail call i32 @non_existent(i32 2)
tail call void (...) %0()
ret void
}
unsigned long STREAM_TO_UINT32_f(char *p, unsigned short offset) {
  return (
      unsigned long)((unsigned long)((unsigned long)(*(p + offset + 3)) << 24) +
                     (unsigned long)((unsigned long)(*(p + offset + 2)) << 16) +
                     (unsigned long)((unsigned long)(*(p + offset + 1)) << 8) +
                     (unsigned long)(*(p + offset)));
}


x86 assembly (clang, -O0):
<STREAM_TO_UINT32_f>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzwl -0xa(%rbp),%ecx
movslq %ecx,%rcx
movsbq 0x3(%rax,%rcx,1),%rax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
movzwl -0xa(%rbp),%edx
movslq %edx,%rdx
movsbq 0x2(%rcx,%rdx,1),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movzwl -0xa(%rbp),%edx
movslq %edx,%rdx
movsbq 0x1(%rcx,%rdx,1),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movzwl -0xa(%rbp),%edx
movslq %edx,%rdx
movsbq (%rcx,%rdx,1),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<STREAM_TO_UINT32_f>:
mov    %esi,%eax
movsbq 0x3(%rdi,%rax,1),%rcx
shl    $0x18,%rcx
movsbq 0x2(%rdi,%rax,1),%rdx
shl    $0x10,%rdx
add    %rcx,%rdx
movsbq 0x1(%rdi,%rax,1),%rcx
shl    $0x8,%rcx
add    %rdx,%rcx
movsbq (%rdi,%rax,1),%rax
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @STREAM_TO_UINT32_f(i8* nocapture %0, i16 zeroext %1) {
%3 = zext i16 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i64
%8 = shl nsw i64 %7, 24
%9 = getelementptr inbounds i8, i8* %4, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i64
%12 = shl nsw i64 %11, 16
%13 = add nsw i64 %12, %8
%14 = getelementptr inbounds i8, i8* %4, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i64
%17 = shl nsw i64 %16, 8
%18 = add nsw i64 %13, %17
%19 = load i8, i8* %4
%20 = sext i8 %19 to i64
%21 = add nsw i64 %18, %20
ret i64 %21
}
int do4(int x) { return x + 4; }


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

x86 assembly (clang, -O2):
<do4>:
lea    0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @do4(i32 %0) {
%2 = add nsw i32 %0, 4
ret i32 %2
}
double radian_1(double d) { return d * 3.14159265358979323846 / 180.0; }


x86 assembly (clang, -O0):
<radian_1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radian_1>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @radian_1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @radian_1(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help() {
  printf("Usage: detox64 [-f type] <filename>\n");
  printf("-f type: input file format name, possible values are:\n");
  printf("     -f bas    C64 BASIC format\n");
  printf("     -f p00    Emulator file\n");
  return (1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
lea    0xf29(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: detox64 [-f type] <filename>\0A\00"
@.str.1 = [55 x i8] c"-f type: input file format name, possible values are:\0A\00"
@.str.2 = [33 x i8] c" -f bas C64 BASIC format\0A\00"
@.str.3 = [30 x i8] c" -f p00 Emulator file\0A\00"
define i32 @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [36 x i8] c"Usage: detox64 [-f type] <filename>\00"
@str.4 = [54 x i8] c"-f type: input file format name, possible values are:\00"
@str.5 = [32 x i8] c" -f bas C64 BASIC format\00"
@str.6 = [29 x i8] c" -f p00 Emulator file\00"
define i32 @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
scalar_t__ islower(char);
scalar_t__ isupper(char);
unsigned short isalpha(char c) { return isupper(c) || islower(c); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <isalpha+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%ax
test   %rcx,%rcx
je     1136 <isalpha+0x16>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @isalpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isupper(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @islower(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @isalpha(i8 signext %0) {
%2 = tail call i64 @isupper(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @islower(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i16
br label %8
8: ; preds = %4, %1
%9 = phi i16 [ 1, %1 ], [ %7, %4 ]
ret i16 %9
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_aliases(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_aliases>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_aliases(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_aliases(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
int checkNumbers(char *checkedString) {
  int checkCounter = 0;
  while (checkedString[checkCounter] != '\0') {
    if (!((checkedString[checkCounter] > ('1' - 1)) &&
          (checkedString[checkCounter] < ('9' + 1)))) {
      return 0;
    }
    checkCounter++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<checkNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1168 <checkNumbers+0x68>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jle    114e <checkNumbers+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jl     115a <checkNumbers+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    116f <checkNumbers+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <checkNumbers+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkNumbers>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <checkNumbers+0x23>
add    $0x1,%rdi
nop
add    $0xcf,%cl
cmp    $0x9,%cl
jae    1124 <checkNumbers+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <checkNumbers+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @checkNumbers(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -49
%12 = icmp ult i8 %11, 9
%13 = add nuw i64 %9, 1
br i1 %12, label %4, label %14
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}