xunge/DecIR huggingface dataset:
void strcat2(char s[], char t[]) {
  while (*s)
    s++;
  while (*s++ = *t++)
    ;
}


x86 assembly (clang, -O0):
<strcat2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <strcat2+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcat2+0xc>
jmp    112f <strcat2+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115e <strcat2+0x5e>
jmp    112f <strcat2+0x2f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat2>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat2>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcat2+0x10>
ret

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

LLVM IR (-O2):
define void @strcat2(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
int ti_sinh_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_sinh_start(double* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PRINTF(void *, char *, unsigned short);
int /*<<< orphan*/ bbm_word_read(void *, int, unsigned short *);
int fc8150_probe(void *hDevice) {
  unsigned short ver;
  bbm_word_read(hDevice, 0x0026, &ver);
  PRINTF(hDevice, "[FC8150] fc8150_probe chipid : 0x%x\n", ver);
  return (ver == 0x8150) ? 0 : 1;
}


x86 assembly (clang, -O0):
<fc8150_probe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x26,%esi
lea    -0xa(%rbp),%rdx
call   1040 <bbm_word_read@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb7(%rip),%rsi
movzwl -0xa(%rbp),%edx
call   1030 <PRINTF@plt>
movzwl -0xa(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x8150,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8150_probe>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xe(%rsp),%rdx
mov    $0x26,%esi
call   1040 <bbm_word_read@plt>
movzwl 0xe(%rsp),%edx
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <PRINTF@plt>
movzwl 0xe(%rsp),%ecx
xor    %eax,%eax
cmp    $0x8150,%ecx
setne  %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"[FC8150] fc8150_probe chipid : 0x%x\0A\00"
define i32 @fc8150_probe(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @bbm_word_read(i8* %4, i32 38, i16* %3)
%6 = load i8*, i8** %2
%7 = load i16, i16* %3
%8 = call i32 @PRINTF(i8* %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i16 zeroext %7)
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = icmp eq i32 %10, 33104
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
ret i32 %13
}

LLVM IR (-O2):
@.str = [37 x i8] c"[FC8150] fc8150_probe chipid : 0x%x\0A\00"
define i32 @fc8150_probe(i8* %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = call i32 @bbm_word_read(i8* %0, i32 38, i16* %2)
%5 = load i16, i16* %2
%6 = call i32 @PRINTF(i8* %0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i16 zeroext %5)
%7 = load i16, i16* %2
%8 = icmp ne i16 %7, -32432
%9 = zext i1 %8 to i32
ret i32 %9
}
unsigned Square(unsigned n) { return n * n; }


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

x86 assembly (clang, -O2):
<Square>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Square(i32 %0) {
%2 = mul i32 %0, %0
ret i32 %2
}
/* Variables and functions */
scalar_t__ isdigit(char);
char tolower(char);
char from_hex(char ch) {
  return isdigit(ch) ? ch - '0' : tolower(ch) - 'A' + 10;
}


x86 assembly (clang, -O0):
<from_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1150 <from_hex+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <from_hex+0x45>
movsbl -0x1(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_hex>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1132 <from_hex+0x12>
lea    -0x30(%rbx),%eax
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <tolower@plt>
add    $0xc9,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @from_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %10, %6
%17 = phi i32 [ %9, %6 ], [ %15, %10 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @from_hex(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add i8 %0, -48
br label %9
6: ; preds = %1
%7 = tail call signext i8 @tolower(i8 signext %0)
%8 = add i8 %7, -55
br label %9
9: ; preds = %6, %4
%10 = phi i8 [ %5, %4 ], [ %8, %6 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_X(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/);
void track_load_list(int edx) {
  RCT2_CALLPROC_X(0x006CED50, 0, 0, 0, edx, 0, 0, 0);
}


x86 assembly (clang, -O0):
<track_load_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%r8d
mov    $0x6ced50,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <RCT2_CALLPROC_X@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<track_load_list>:
push   %rax
mov    %edi,%r8d
mov    $0x6ced50,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <RCT2_CALLPROC_X@plt>
add    $0x10,%rsp
pop    %rax
ret

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

LLVM IR (-O2):
define void @track_load_list(i32 %0) {
%2 = tail call i32 @RCT2_CALLPROC_X(i32 7138640, i32 0, i32 0, i32 0, i32 %0, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ be64toh(int /*<<< orphan*/);
uint64_t unaligned_read_be64(const void *_u) {
  const struct __attribute__((packed, may_alias)) { uint64_t x; } *u = _u;
  return be64toh(u->x);
}


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

x86 assembly (clang, -O2):
<unaligned_read_be64>:
mov    (%rdi),%edi
jmp    1030 <be64toh@plt>

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @unaligned_read_be64(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @be64toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @unaligned_read_be64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @be64toh(i32 %3)
ret i32 %4
}
int dmp_cm_finalize(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @dmp_cm_finalize() {
ret i32 0
}

LLVM IR (-O2):
define i32 @dmp_cm_finalize() {
ret i32 0
}
/* Variables and functions */
size_t mapred_backward_token_len(char const *, size_t);
scalar_t__ mapred_ischar_delim(char const);
size_t mapred_adjust_area_size(const char *data, size_t size) {
  if (mapred_ischar_delim(data[size - 1]))
    return size;
  return size - mapred_backward_token_len(data, size);
}


x86 assembly (clang, -O0):
<mapred_adjust_area_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <mapred_ischar_delim@plt>
cmp    $0x0,%rax
je     115c <mapred_adjust_area_size+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <mapred_adjust_area_size+0x5f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <mapred_backward_token_len@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapred_adjust_area_size>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movsbl -0x1(%rsi,%rdi,1),%edi
call   1040 <mapred_ischar_delim@plt>
test   %rax,%rax
jne    1147 <mapred_adjust_area_size+0x27>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <mapred_backward_token_len@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @mapred_adjust_area_size(i8* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i8*, i8** %4
%7 = load i64, i64* %5
%8 = sub i64 %7, 1
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = call i64 @mapred_ischar_delim(i8 signext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i64, i64* %5
store i64 %14, i64* %3
br label %21
15: ; preds = %2
%16 = load i64, i64* %5
%17 = load i8*, i8** %4
%18 = load i64, i64* %5
%19 = call i64 @mapred_backward_token_len(i8* %17, i64 %18)
%20 = sub i64 %16, %19
store i64 %20, i64* %3
br label %21
21: ; preds = %15, %13
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @mapred_adjust_area_size(i8* %0, i64 %1) {
%3 = add i64 %1, -1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i64 @mapred_ischar_delim(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i64 @mapred_backward_token_len(i8* %0, i64 %1)
%10 = sub i64 %1, %9
br label %11
11: ; preds = %2, %8
%12 = phi i64 [ %10, %8 ], [ %1, %2 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x29() {
  Assert_real((islower(41) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              210, ("islower should be 0 for )"));
}


x86 assembly (clang, -O0):
<t_islower_0x29>:
push   %rbp
mov    %rsp,%rbp
mov    $0x29,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xd2,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x29>:
push   %rax
mov    $0x29,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xd2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for )\00"
define void @t_islower_0x29() {
%1 = call i64 @islower(i32 41)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for )\00"
define void @t_islower_0x29() {
%1 = tail call i64 @islower(i32 41)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void clr(char s[]) { s[0] = '\0'; }


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

x86 assembly (clang, -O2):
<clr>:
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @clr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 0, i8* %4
ret void
}

LLVM IR (-O2):
define void @clr(i8* nocapture writeonly %0) {
store i8 0, i8* %0
ret void
}
double f4_sum_pre_int_int_double(int v0, int v1, double v) {
  return (double)v0 + (double)v1 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_int_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_int_double>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm2
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_int_double(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = fadd double %8, %10
%12 = load double, double* %6
%13 = fadd double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @f4_sum_pre_int_int_double(i32 %0, i32 %1, double %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fadd double %4, %5
%7 = fadd double %6, %2
ret double %7
}
int inc_hexchar(char *c) {
  if (*c == '9') {
    *c = 'a';
    return 0;
  }
  if (*c == 'f') {
    *c = '0';
    return 1;
  }
  (*c)++;
  return 0;
}


x86 assembly (clang, -O0):
<inc_hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jne    112b <inc_hexchar+0x2b>
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1160 <inc_hexchar+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x66,%eax
jne    114e <inc_hexchar+0x4e>
mov    -0x10(%rbp),%rax
movb   $0x30,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1160 <inc_hexchar+0x60>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
add    $0x1,%cl
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_hexchar>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    $0x39,%cl
je     1118 <inc_hexchar+0x18>
cmp    $0x66,%cl
jne    111d <inc_hexchar+0x1d>
mov    $0x1,%eax
mov    $0x30,%cl
mov    %cl,(%rdi)
ret
mov    $0x61,%cl
mov    %cl,(%rdi)
ret
add    $0x1,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define i32 @inc_hexchar(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 57
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 97, i8* %9
store i32 0, i32* %2
br label %21
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 102
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i8*, i8** %3
store i8 48, i8* %16
store i32 1, i32* %2
br label %21
17: ; preds = %10
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = add i8 %19, 1
store i8 %20, i8* %18
store i32 0, i32* %2
br label %21
21: ; preds = %17, %15, %8
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @inc_hexchar(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %4 [
i8 57, label %6
i8 102, label %3
]
3: ; preds = %1
br label %6
4: ; preds = %1
%5 = add i8 %2, 1
br label %6
6: ; preds = %1, %4, %3
%7 = phi i8 [ %5, %4 ], [ 48, %3 ], [ 97, %1 ]
%8 = phi i32 [ 0, %4 ], [ 1, %3 ], [ 0, %1 ]
store i8 %7, i8* %0
ret i32 %8
}
void movepos(char *text, int num) {}


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

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

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

LLVM IR (-O2):
define void @movepos(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct utsname {
  int dummy;
};

/* Variables and functions */
int uname(struct utsname *);
int main() {
  struct utsname unm;
  return uname(&unm);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <uname@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.utsname = type { i32 }
define i32 @main() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i32 @uname(%struct.utsname* %1)
ret i32 %3
}
char is_king(char p) { return (p & (1 << 5)) == (1 << 5); }


x86 assembly (clang, -O0):
<is_king>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x20,%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_king>:
mov    %edi,%eax
shr    $0x5,%al
and    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @is_king(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 32
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @is_king(i8 signext %0) {
%2 = lshr i8 %0, 5
%3 = and i8 %2, 1
ret i8 %3
}
int f_i11(int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7,
          int i8, int i9, int i10) {
  return i10;
}


x86 assembly (clang, -O0):
<f_i11>:
push   %rbp
mov    %rsp,%rbp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    0x30(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_i11>:
mov    0x28(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @f_i11(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32 %0, i32* %12
store i32 %1, i32* %13
store i32 %2, i32* %14
store i32 %3, i32* %15
store i32 %4, i32* %16
store i32 %5, i32* %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32 %8, i32* %20
store i32 %9, i32* %21
store i32 %10, i32* %22
%23 = load i32, i32* %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @f_i11(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 returned %10) {
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void udpv6head(int osvers, int osrel, int ossub) {
  printf("indgram/s outdgram/s   inerr/s  noport/s    "
         "                  _udpv6_");
}


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

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

LLVM IR (-O0):
@.str = [70 x i8] c"indgram/s outdgram/s inerr/s noport/s _udpv6_\00"
define void @udpv6head(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
%7 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"indgram/s outdgram/s inerr/s noport/s _udpv6_\00"
define void @udpv6head(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_C9uint16_reg(unsigned short val) {
  return ((val) & (0xC9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C9uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xc9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C9uint16_reg>:
test   $0xc9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C9uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 201
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ StateEstimationHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void StateEstimationRequestUpdate() {
  UAVObjRequestUpdate(StateEstimationHandle());
}


x86 assembly (clang, -O0):
<StateEstimationRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <StateEstimationHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StateEstimationRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <StateEstimationHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @StateEstimationRequestUpdate() {
%1 = call i32 (...) @StateEstimationHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StateEstimationRequestUpdate() {
%1 = tail call i32 (...) @StateEstimationHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ umem_startup(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
void __attribute__((constructor)) __malloc_umem_init(void) {
  umem_startup(NULL, 0, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<__malloc_umem_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%r8d
xor    %edx,%edx
mov    %r8,%rdi
mov    %edx,%esi
mov    %r8,%rcx
call   1030 <umem_startup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malloc_umem_init>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <umem_startup@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__malloc_umem_init, i8* null }]
define void @__malloc_umem_init() {
%1 = call i32 @umem_startup(i32* null, i32 0, i32 0, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__malloc_umem_init, i8* null }]
define void @__malloc_umem_init() {
%1 = tail call i32 @umem_startup(i32* null, i32 0, i32 0, i32* null, i32* null)
ret void
}
/* Variables and functions */
double trunc(double const);
double stdlib_base_trunc(const double x) { return trunc(x); }


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

x86 assembly (clang, -O2):
<stdlib_base_trunc>:
jmp    1030 <trunc@plt>

LLVM IR (-O0):
define double @stdlib_base_trunc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.trunc.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @stdlib_base_trunc(double %0) {
%2 = tail call double @llvm.trunc.f64(double %0)
ret double %2
}
void display_tick(void) {}


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

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

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

LLVM IR (-O2):
define void @display_tick() {
ret void
}
int get_cycle_count_6809(unsigned short int opcode) { return -1; }


x86 assembly (clang, -O0):
<get_cycle_count_6809>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_cycle_count_6809(i16 zeroext %0) {
ret i32 -1
}
void swap(char *v[], int i, int j) {
  char *temp;
  temp = v[i];
  v[i] = v[j];
  v[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,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
store i8* %9, i8** %5
store i8* %6, i8** %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int mystrtime(char *timebuf, char *formt) {
  struct tm tm_t;
  time_t t_time;
  t_time = time(NULL);
  localtime_r(&t_time, &tm_t);
  strftime(timebuf, 100, formt, &tm_t);
  return 0;
}


x86 assembly (clang, -O0):
<mystrtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x64,%esi
lea    -0x18(%rbp),%rcx
call   1050 <strftime@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrtime>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%r15
mov    %r15,%rsi
call   1030 <localtime_r@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %r14,%rdx
mov    %r15,%rcx
call   1050 <strftime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @mystrtime(i8* %0, i8* %1) {
%3 = alloca %struct.tm
%4 = alloca i32
%5 = bitcast %struct.tm* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 @time(i32* null)
store i32 %7, i32* %4
%8 = call i32 @localtime_r(i32* %4, %struct.tm* %3)
%9 = call i32 @strftime(i8* %0, i32 100, i8* %1, %struct.tm* %3)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int sw_parity(uint16_t data) {
  int bits_set = 0;
  while (data) {
    bits_set++;
    data &= (data - 1);
  }
  return bits_set & 1;
}


x86 assembly (clang, -O0):
<sw_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <sw_parity+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <sw_parity+0xe>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sw_parity>:
xor    %eax,%eax
test   %edi,%edi
je     111f <sw_parity+0x1f>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <sw_parity+0x10>
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sw_parity(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add nsw i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = and i32 %6, 1
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int mean_array(int *array, size_t length) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mean_array(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
double ls_costN_nm8_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<ls_costN_nm8_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm8_sq>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @ls_costN_nm8_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((constructor)) __attribute__((used)) B11(void) {
  printf("Test2\n");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Test2\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @B11, i8* null }]
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @B11 to i8*)], section "llvm.metadata"
define void @B11() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @B11, i8* null }]
@str = [6 x i8] c"Test2\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @B11 to i8*)], section "llvm.metadata"
define void @B11() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ioctl(int, int, int *);
int mms_ioc_getblocksize(int fd, int *block_size) {
  return ioctl(fd, 0x80046D01, block_size);
}


x86 assembly (clang, -O0):
<mms_ioc_getblocksize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x80046d01,%esi
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mms_ioc_getblocksize>:
mov    %rsi,%rdx
mov    $0x80046d01,%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
define i32 @mms_ioc_getblocksize(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 @ioctl(i32 %5, i32 -2147193599, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mms_ioc_getblocksize(i32 %0, i32* %1) {
%3 = tail call i32 @ioctl(i32 %0, i32 -2147193599, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HMAC_CTX_free(void *);
int /*<<< orphan*/ HMAC_Final(void *, char *, int *);
int HMAC_finish(void *ctx, char *output) {
  int len = 32;
  HMAC_Final(ctx, output, &len);
  HMAC_CTX_free(ctx);
  return len;
}


x86 assembly (clang, -O0):
<HMAC_finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x20,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <HMAC_Final@plt>
mov    -0x8(%rbp),%rdi
call   1040 <HMAC_CTX_free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMAC_finish>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x20,0xc(%rsp)
lea    0xc(%rsp),%rdx
call   1030 <HMAC_Final@plt>
mov    %rbx,%rdi
call   1040 <HMAC_CTX_free@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @HMAC_finish(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 32, i32* %3
%5 = call i32 @HMAC_Final(i8* %0, i8* %1, i32* %3)
%6 = call i32 @HMAC_CTX_free(i8* %0)
%7 = load i32, i32* %3
ret i32 %7
}
/* Variables and functions */
unsigned char i2c_ReadDataREG(int);
unsigned char i2c1_ReadDataREG(void) { return i2c_ReadDataREG(1); }


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

x86 assembly (clang, -O2):
<i2c1_ReadDataREG>:
mov    $0x1,%edi
jmp    1030 <i2c_ReadDataREG@plt>

LLVM IR (-O0):
define zeroext i8 @i2c1_ReadDataREG() {
%1 = call zeroext i8 @i2c_ReadDataREG(i32 1)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @i2c1_ReadDataREG() {
%1 = tail call zeroext i8 @i2c_ReadDataREG(i32 1)
ret i8 %1
}
/* Variables and functions */
char *stb_malloc_string(void *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *stb_strdup(char *str, void *pool) {
  int len = strlen(str);
  char *p = stb_malloc_string(pool, len + 1);
  strcpy(p, str);
  return p;
}


x86 assembly (clang, -O0):
<stb_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1050 <stb_malloc_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
lea    0x1(%rax),%esi
mov    %r14,%rdi
call   1050 <stb_malloc_string@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @stb_strdup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i8* @stb_malloc_string(i8* %9, i32 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
define i8* @stb_strdup(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = tail call i8* @stb_malloc_string(i8* %1, i32 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
scalar_t__ strtol(char const *, char **, int);
int atoi(const char *str) { return ((int)strtol(str, (char **)NULL, 10)); }


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

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i8** null, i32 10)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int IsLetter(char c) {
  if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<IsLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <IsLetter+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    113e <IsLetter+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     114a <IsLetter+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     114a <IsLetter+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <IsLetter+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsLetter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsLetter(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %19, label %20
19: ; preds = %15, %7
store i32 1, i32* %2
br label %21
20: ; preds = %15, %11
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @IsLetter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
const char *sqlassieName() { return "SQLassie"; }


x86 assembly (clang, -O0):
<sqlassieName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlassieName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"SQLassie\00"
define i8* @sqlassieName() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"SQLassie\00"
define i8* @sqlassieName() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_backtrace(int);
void *time__TimeT__init(void *self) {
  void *var;
  printf("NOT YET IMPLEMENTED nitni for time#TimeT#init at "
         "lib/standard/time.nit:34,2--29\n");
  show_backtrace(1);
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<time__TimeT__init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <show_backtrace@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time__TimeT__init>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <show_backtrace@plt>

LLVM IR (-O0):
@.str = [81 x i8] c"NOT YET IMPLEMENTED nitni for time#TimeT#init at lib/standard/time.nit:34,2--29\0A\00"
define i8* @time__TimeT__init(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @show_backtrace(i32 1)
br label %6
6: ; preds = %1
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@str = [80 x i8] c"NOT YET IMPLEMENTED nitni for time#TimeT#init at lib/standard/time.nit:34,2--29\00"
define noalias i8* @time__TimeT__init(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @show_backtrace(i32 1)
ret i8* undef
}
void map_boot() { (*(unsigned int *)(0x40074000)) = 0; }


x86 assembly (clang, -O0):
<map_boot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40074000,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_boot>:
movl   $0x0,0x40074000
ret

LLVM IR (-O0):
define void @map_boot() {
store i32 0, i32* inttoptr (i64 1074216960 to i32*)
ret void
}

LLVM IR (-O2):
define void @map_boot() {
store i32 0, i32* inttoptr (i64 1074216960 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x44() {
  Assert_real((isdigit(68) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              345, ("isdigit should be 0 for D"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x44>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x159,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x44>:
push   %rax
mov    $0x44,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x159,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for D\00"
define void @t_isdigit_0x44() {
%1 = call i64 @isdigit(i32 68)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for D\00"
define void @t_isdigit_0x44() {
%1 = tail call i64 @isdigit(i32 68)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}