xunge/DecIR huggingface dataset:
int binary(const unsigned char source[], const int length, const int position) {
  int retval = 0;
  if (position < length && source[position] >= 128) {
    retval = 1;
  }
  return retval;
}


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <binary+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x80,%eax
jl     113f <binary+0x3f>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
xor    %eax,%eax
cmp    %esi,%edx
jge    1110 <binary+0x10>
movslq %edx,%rax
movzbl (%rdi,%rax,1),%eax
shr    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @binary(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = lshr i8 %8, 7
%10 = zext i8 %9 to i32
br label %11
11: ; preds = %5, %3
%12 = phi i32 [ 0, %3 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("data: %s\n", "Mar 16 2022");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"data: %s\0A\00"
@.str.1 = [12 x i8] c"Mar 16 2022\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int hook_false(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hook_false() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ closeConnections();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigTERM_handler(int signum) {
  printf("Caught SIGTERM. Exiting...");
  closeConnections();
  exit(0);
}


x86 assembly (clang, -O0):
<sigTERM_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <closeConnections@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigTERM_handler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <closeConnections@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Caught SIGTERM. Exiting...\00"
define void @sigTERM_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @closeConnections()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Caught SIGTERM. Exiting...\00"
define void @sigTERM_handler(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @closeConnections()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t calc_parity(uint64_t word) {
  bool parity = false;
  while (word) {
    if (word & 1) {
      parity = !parity;
    }
    word >>= 1;
  }
  return parity;
}


x86 assembly (clang, -O0):
<calc_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <calc_parity+0x46>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1138 <calc_parity+0x38>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <calc_parity+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_parity>:
xor    %eax,%eax
test   %edi,%edi
je     1127 <calc_parity+0x27>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
test   %eax,%eax
sete   %dl
test   $0x1,%dil
cmovne %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <calc_parity+0x10>
ret

LLVM IR (-O0):
define i32 @calc_parity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
store i32 %15, i32* %3
br label %16
16: ; preds = %11, %7
%17 = load i32, i32* %2
%18 = ashr i32 %17, 1
store i32 %18, i32* %2
br label %4
19: ; preds = %4
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @calc_parity(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %11, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = icmp eq i32 %4, 0
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 %4, i32 %9
%11 = ashr i32 %5, 1
%12 = icmp ult i32 %5, 2
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %14
}
void ub_dentry_uncharge(struct dentry *d) {}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define void @ub_dentry_uncharge(%struct.dentry* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _jpeg_chunk_putc(int);
void _jpeg_chunk_putw(int w) {
  _jpeg_chunk_putc((w >> 8) & 0xff);
  _jpeg_chunk_putc(w & 0xff);
}


x86 assembly (clang, -O0):
<_jpeg_chunk_putw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <_jpeg_chunk_putc@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <_jpeg_chunk_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jpeg_chunk_putw>:
push   %rbx
mov    %edi,%ebx
movzbl %bh,%edi
call   1030 <_jpeg_chunk_putc@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <_jpeg_chunk_putc@plt>

LLVM IR (-O0):
define void @_jpeg_chunk_putw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
%6 = call i32 @_jpeg_chunk_putc(i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, 255
%9 = call i32 @_jpeg_chunk_putc(i32 %8)
ret void
}

LLVM IR (-O2):
define void @_jpeg_chunk_putw(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
%4 = tail call i32 @_jpeg_chunk_putc(i32 %3)
%5 = and i32 %0, 255
%6 = tail call i32 @_jpeg_chunk_putc(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DwReset();
int target_reset(void) {
  DwReset();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @target_reset() {
%1 = tail call i32 (...) @DwReset()
ret i32 0
}
void str_translate(char *s, char in, char out) {
  while (*s) {
    if (*s == in)
      *s = out;
    s++;
  }
}


x86 assembly (clang, -O0):
<str_translate>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <str_translate+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <str_translate+0x3c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <str_translate+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_translate>:
mov    (%rdi),%al
test   %al,%al
je     1125 <str_translate+0x25>
add    $0x1,%rdi
jmp    111b <str_translate+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <str_translate+0x25>
cmp    %sil,%al
jne    1110 <str_translate+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <str_translate+0x10>
ret

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

LLVM IR (-O2):
define void @str_translate(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
short __max_short(short x, short y) { return ((x) > (y) ? (x) : (y)); }


x86 assembly (clang, -O0):
<__max_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jle    112e <__max_short+0x2e>
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <__max_short+0x35>
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<__max_short>:
mov    %esi,%eax
cmp    %ax,%di
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @__max_short(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @__max_short(i16 signext %0, i16 signext %1) {
%3 = icmp sgt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *strbtrim(const char *data) {
  while (*data && isspace(*data))
    ++data;
  return (char *)data;
}


x86 assembly (clang, -O0):
<strbtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <strbtrim+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <strbtrim+0x47>
jmp    1168 <strbtrim+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strbtrim+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbtrim>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <strbtrim+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <strbtrim+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strbtrim+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strbtrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @strbtrim(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
void nseel_asm_xor_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_xor_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printValue(int, int);
int /*<<< orphan*/ printf(char *);
int isolateRightmostSet(int value) {
  value &= -value;
  printValue(value, 8);
  printf(" IRMS\n");
  return value;
}


x86 assembly (clang, -O0):
<isolateRightmostSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1040 <printValue@plt>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isolateRightmostSet>:
push   %rbx
mov    %edi,%ebx
neg    %ebx
and    %edi,%ebx
mov    %ebx,%edi
mov    $0x8,%esi
call   1040 <printValue@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" IRMS\0A\00"
define i32 @isolateRightmostSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = load i32, i32* %2
%6 = and i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printValue(i32 %7, i32 8)
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@str = [6 x i8] c" IRMS\00"
define i32 @isolateRightmostSet(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = tail call i32 @printValue(i32 %3, i32 8)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ReadData();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void main(int argc, char **argv) {
  ReadData();
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <ReadData@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @ReadData()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ReadData()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ arglist_free();
void optparse_exit(void) { arglist_free(); }


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

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

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

LLVM IR (-O2):
define void @optparse_exit() {
%1 = tail call i32 (...) @arglist_free()
ret void
}
/* Variables and functions */
scalar_t__ allocate_mem(int, int /*<<< orphan*/, int, unsigned long);
unsigned char *allocate_bytes(long n_byte) {
  return (unsigned char *)allocate_mem(6, 0, sizeof(unsigned char),
                                       (unsigned long)n_byte);
}


x86 assembly (clang, -O0):
<allocate_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x6,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <allocate_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_bytes>:
mov    %rdi,%rcx
mov    $0x6,%edi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <allocate_mem@plt>

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

LLVM IR (-O2):
define i8* @allocate_bytes(i64 %0) {
%2 = tail call i64 @allocate_mem(i32 6, i32 0, i32 1, i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ factorial(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Enter a number: ");
  scanf("%d", &n);
  printf("Factorial is ");
  factorial(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <factorial@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"Factorial is \00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"Factorial is \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 @factorial(i32 %6)
ret i32 0
}
int uniphier_base_address_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uniphier_base_address_init() {
ret i32 0
}
/* Variables and functions */
int addDigitsInner(int);
int addDigits(int num) {
  if (num < 10) {
    return num;
  } else {
    return addDigits(addDigitsInner(num));
  }
}


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1140 <addDigits+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <addDigits+0x32>
mov    -0x8(%rbp),%edi
call   1030 <addDigitsInner@plt>
mov    %eax,%edi
call   1040 <addDigits@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
push   %rax
mov    %edi,%eax
cmp    $0xa,%edi
jl     112c <addDigits+0x1c>
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <addDigitsInner@plt>
cmp    $0x9,%eax
jg     1120 <addDigits+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = tail call i32 @addDigitsInner(i32 %4)
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %3
7: ; preds = %3, %1
%8 = phi i32 [ %0, %1 ], [ %5, %3 ]
ret i32 %8
}
unsigned long long rdtsc(void) {
  unsigned long long int x;
  __asm__ volatile(".byte 0x0f, 0x31" : "=A"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 0x0f, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call i64 asm sideeffect ".byte 0x0f, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void arc_core_mpu_configure_thread(struct k_thread *thread) {}


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

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

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

LLVM IR (-O2):
%struct.k_thread = type opaque
define void @arc_core_mpu_configure_thread(%struct.k_thread* nocapture %0) {
ret void
}
void execute(void (*f)(double)) { (*f)(13.45); }


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xeec(%rip),%xmm0
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute>:
movsd  0xef8(%rip),%xmm0
jmp    *%rdi

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

LLVM IR (-O2):
define void @execute(void (double)* nocapture %0) {
tail call void %0(double 1.345000e+01)
ret void
}
void __mp_printfwithloc(char *s, char *t, unsigned long u, char *m, ...) {}


x86 assembly (clang, -O0):
<__mp_printfwithloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__mp_printfwithloc(i8* %0, i8* %1, i64 %2, i8* %3, ...) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @__mp_printfwithloc(i8* nocapture %0, i8* nocapture %1, i64 %2, i8* nocapture %3, ...) {
ret void
}
void msg_msmsgsprofile(struct TCP_STREAM *stream, struct NetFrame *frame,
                       struct StringReassembler *data) {
  data = (data);
  frame = (frame);
}


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

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

LLVM IR (-O0):
%struct.TCP_STREAM = type opaque
%struct.NetFrame = type opaque
%struct.StringReassembler = type opaque
define void @msg_msmsgsprofile(%struct.TCP_STREAM* %0, %struct.NetFrame* %1, %struct.StringReassembler* %2) {
%4 = alloca %struct.TCP_STREAM*
%5 = alloca %struct.NetFrame*
%6 = alloca %struct.StringReassembler*
store %struct.TCP_STREAM* %0, %struct.TCP_STREAM** %4
store %struct.NetFrame* %1, %struct.NetFrame** %5
store %struct.StringReassembler* %2, %struct.StringReassembler** %6
%7 = load %struct.StringReassembler*, %struct.StringReassembler** %6
store %struct.StringReassembler* %7, %struct.StringReassembler** %6
%8 = load %struct.NetFrame*, %struct.NetFrame** %5
store %struct.NetFrame* %8, %struct.NetFrame** %5
ret void
}

LLVM IR (-O2):
%struct.TCP_STREAM = type opaque
%struct.NetFrame = type opaque
%struct.StringReassembler = type opaque
define void @msg_msmsgsprofile(%struct.TCP_STREAM* nocapture %0, %struct.NetFrame* nocapture %1, %struct.StringReassembler* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
scalar_t__ wurm_utf8_isdigit(int /*<<< orphan*/);
scalar_t__ wurm_utf8_issymbol_initial(int /*<<< orphan*/);
int wurm_utf8_issymbol_body(int32_t code) {
  return wurm_utf8_issymbol_initial(code) || wurm_utf8_isdigit(code);
}


x86 assembly (clang, -O0):
<wurm_utf8_issymbol_body>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <wurm_utf8_issymbol_initial@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <wurm_utf8_issymbol_body+0x37>
mov    -0x4(%rbp),%edi
call   1040 <wurm_utf8_isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wurm_utf8_issymbol_body>:
push   %rbx
mov    %edi,%ebx
call   1030 <wurm_utf8_issymbol_initial@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <wurm_utf8_issymbol_body+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <wurm_utf8_isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wurm_utf8_issymbol_body(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @wurm_utf8_issymbol_initial(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @wurm_utf8_isdigit(i32 %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
ret i32 %12
}

LLVM IR (-O2):
define i32 @wurm_utf8_issymbol_body(i32 %0) {
%2 = tail call i64 @wurm_utf8_issymbol_initial(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @wurm_utf8_isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int f(int n, int i) {
  int s = 0;
  for (; i & 1; i++)
    s += i;
  return s;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1137 <f+0x37>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <f+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %esi,%eax
and    $0x1,%eax
neg    %eax
and    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 0, i32 %1
ret i32 %5
}
int main(void) {
  int counter = 0;
LOOPSTART:
  if (counter < 5) {
    counter++;
    goto LOOPSTART;
  } else if (counter < 10) {
    counter++;
    goto LOOPSTART;
  } else if (counter < 15) {
    counter++;
    goto LOOPSTART;
  }
  if (counter == 4) {
    goto ERROR;
  } else {
    goto END;
  }
ERROR:
  goto ERROR;
END:
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
cmpl   $0xa,-0x8(%rbp)
jge    1142 <main+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
cmpl   $0xf,-0x8(%rbp)
jge    115a <main+0x5a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    115f <main+0x5f>
jmp    1164 <main+0x64>
cmpl   $0x4,-0x8(%rbp)
jne    1173 <main+0x73>
jmp    1178 <main+0x78>
jmp    117d <main+0x7d>
jmp    1178 <main+0x78>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %18, %12, %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %9
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 15
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %3
21: ; preds = %15
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 4
br i1 %25, label %26, label %27
26: ; preds = %23
br label %28
27: ; preds = %23
br label %29
28: ; preds = %28, %26
br label %28
29: ; preds = %27
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char, int);
void sprint_mov_data_to_atRi(char *str, unsigned char i, uint8_t data) {
  sprintf(str,
          "MOV   @R%X, #"
          "0x%02X"
          "                ",
          i, data);
}


x86 assembly (clang, -O0):
<sprint_mov_data_to_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%ecx
lea    0xeca(%rip),%rsi
movzbl %al,%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_mov_data_to_atRi>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"MOV @R%X,x%02X \00"
define void @sprint_mov_data_to_atRi(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"MOV @R%X,x%02X \00"
define void @sprint_mov_data_to_atRi(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %1, i32 %2)
ret void
}
/* Variables and functions */
int ready_eth_rx();
unsigned rdy_eth() { return ready_eth_rx(); }


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

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

LLVM IR (-O0):
define i32 @rdy_eth() {
%1 = call i32 (...) @ready_eth_rx()
ret i32 %1
}

LLVM IR (-O2):
define i32 @rdy_eth() {
%1 = tail call i32 (...) @ready_eth_rx()
ret i32 %1
}
__attribute__((always_)) int pci_enable_msi_block(struct pci_dev *dev,
                                                  unsigned int nvec) {
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_enable_msi_block(%struct.pci_dev* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
void **PPointer() { return NULL; }


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

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

LLVM IR (-O0):
define i8** @PPointer() {
ret i8** null
}

LLVM IR (-O2):
define noalias i8** @PPointer() {
ret i8** null
}
/* Variables and functions */
int /*<<< orphan*/ japi_inserttext(int, char *, int);
void j_inserttext(int arg0, char *arg1, int arg2) {
  japi_inserttext(arg0, arg1, arg2);
}


x86 assembly (clang, -O0):
<j_inserttext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <japi_inserttext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_inserttext>:
jmp    1030 <japi_inserttext@plt>

LLVM IR (-O0):
define void @j_inserttext(i32 %0, i8* %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
%10 = call i32 @japi_inserttext(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @j_inserttext(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @japi_inserttext(i32 %0, i8* %1, i32 %2)
ret void
}
int is_ascii_hexadecimal(char in_c) {
  if ((in_c >= 0x41 && in_c <= 0x46) || (in_c >= 0x61 && in_c <= 0x66)) {
    return 0;
  }
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @is_ascii_hexadecimal(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, 65
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, 70
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, 97
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, 102
br i1 %18, label %19, label %20
19: ; preds = %15, %7
store i32 0, i32* %2
br label %21
20: ; preds = %15, %11
store i32 1, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_ascii_hexadecimal(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -71
%4 = icmp ult i8 %3, -6
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ConvertLocations();
int /*<<< orphan*/ Initialize();
int /*<<< orphan*/ Manhattan();
int /*<<< orphan*/ PathFinder();
int /*<<< orphan*/ PlaceObject();
int main(void) {
  Initialize();
  ConvertLocations();
  PlaceObject();
  Manhattan();
  PathFinder();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <Initialize@plt>
mov    $0x0,%al
call   1030 <ConvertLocations@plt>
mov    $0x0,%al
call   1070 <PlaceObject@plt>
mov    $0x0,%al
call   1040 <Manhattan@plt>
mov    $0x0,%al
call   1050 <PathFinder@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <Initialize@plt>
xor    %eax,%eax
call   1030 <ConvertLocations@plt>
xor    %eax,%eax
call   1070 <PlaceObject@plt>
xor    %eax,%eax
call   1040 <Manhattan@plt>
xor    %eax,%eax
call   1050 <PathFinder@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Initialize()
%3 = call i32 (...) @ConvertLocations()
%4 = call i32 (...) @PlaceObject()
%5 = call i32 (...) @Manhattan()
%6 = call i32 (...) @PathFinder()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Initialize()
%2 = tail call i32 (...) @ConvertLocations()
%3 = tail call i32 (...) @PlaceObject()
%4 = tail call i32 (...) @Manhattan()
%5 = tail call i32 (...) @PathFinder()
ret i32 0
}
void RTPathChangeToDosSlashes(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathChangeToDosSlashes() {
ret void
}
void eraser(char *array, unsigned short len) {
  unsigned short count = 0;
  for (count = 0; count < len; count++) {
    *(array + count) = '\0';
  }
}


x86 assembly (clang, -O0):
<eraser>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xc(%rbp)
movw   $0x0,-0xc(%rbp)
movzwl -0xc(%rbp),%eax
movzwl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jge    114b <eraser+0x4b>
mov    -0x8(%rbp),%rax
movzwl -0xc(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xc(%rbp)
jmp    111b <eraser+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eraser>:
test   %esi,%esi
je     1123 <eraser+0x13>
push   %rax
movzwl %si,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @eraser(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = icmp eq i16 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i16 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long, int);
void signal_handler(int signum) {
  printf("PID: %ld - Ricevuto segnale %d\n", (long)getpid(), signum);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rsi
mov    -0x4(%rbp),%edx
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xecf(%rip),%rdi
mov    %rax,%rsi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"PID: %ld - Ricevuto segnale %d\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"PID: %ld - Ricevuto segnale %d\0A\00"
define void @signal_handler(i32 %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %2, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void parseFail() {
  printf("\nUnable to compile program.\n  *Don't go insane fixing your code "
         ":)\n\n");
}


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

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

LLVM IR (-O0):
@.str = [69 x i8] c"\0AUnable to compile program.\0A *Don't go insane fixing your code :)\0A\0A\00"
define void @parseFail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [68 x i8] c"\0AUnable to compile program.\0A *Don't go insane fixing your code :)\0A\00"
define void @parseFail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a1, a2, n;
  scanf("%d%d%d", &a1, &a2, &n);
  printf("%d\n", a1 + (n - 1) * (a2 - a1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
imul   %ecx,%eax
add    %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0xc(%rsp),%ecx
add    $0xffffffff,%ecx
mov    0x10(%rsp),%esi
sub    %eax,%esi
imul   %ecx,%esi
add    %eax,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, %8
%13 = mul nsw i32 %12, %10
%14 = add nsw i32 %13, %8
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
struct Cyc_List_List *
Cyc_Interproc_binding_cvar_resolution(struct Cyc_List_List *);
struct Cyc_List_List *Cyc_do_interproc_resolution(int ig,
                                                  struct Cyc_List_List *tds) {
  struct Cyc_List_List *_T0;
  _T0 = Cyc_Interproc_binding_cvar_resolution(tds);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_do_interproc_resolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Cyc_Interproc_binding_cvar_resolution@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_interproc_resolution(i32 %0, %struct.Cyc_List_List* %1) {
%3 = alloca i32
%4 = alloca %struct.Cyc_List_List*
%5 = alloca %struct.Cyc_List_List*
store i32 %0, i32* %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%7 = call %struct.Cyc_List_List* @Cyc_Interproc_binding_cvar_resolution(%struct.Cyc_List_List* %6)
store %struct.Cyc_List_List* %7, %struct.Cyc_List_List** %5
%8 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
ret %struct.Cyc_List_List* %8
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_interproc_resolution(i32 %0, %struct.Cyc_List_List* %1) {
%3 = tail call %struct.Cyc_List_List* @Cyc_Interproc_binding_cvar_resolution(%struct.Cyc_List_List* %1)
ret %struct.Cyc_List_List* %3
}