xunge/DecIR huggingface dataset:
long sumFibUnevenUntil(int n) {
  unsigned int a1 = 1;
  unsigned int a2 = 1;
  unsigned int a3 = 2;
  unsigned int sumAll = 0;
  while (a3 < n) {
    a3 = a1 + a2;
    sumAll += a3 * !(a3 % 2);
    a1 = a2;
    a2 = a3;
  }
  return sumAll;
}


x86 assembly (clang, -O0):
<sumFibUnevenUntil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    116a <sumFibUnevenUntil+0x6a>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
and    $0x1,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
imul   %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <sumFibUnevenUntil+0x23>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumFibUnevenUntil>:
xor    %eax,%eax
cmp    $0x3,%edi
jb     113a <sumFibUnevenUntil+0x3a>
mov    $0x1,%edx
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %edx,%esi
add    %edx,%ecx
mov    %ecx,%edx
not    %edx
and    $0x1,%edx
imul   %ecx,%edx
add    %edx,%eax
mov    %ecx,%edx
cmp    %edi,%ecx
mov    %esi,%ecx
jb     1120 <sumFibUnevenUntil+0x20>
mov    %eax,%eax
ret

LLVM IR (-O0):
define i64 @sumFibUnevenUntil(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 1, i32* %4
store i32 2, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %11, %1
%8 = load i32, i32* %5
%9 = load i32, i32* %2
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add i32 %12, %13
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = load i32, i32* %5
%17 = urem i32 %16, 2
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
%21 = mul i32 %15, %20
%22 = load i32, i32* %6
%23 = add i32 %22, %21
store i32 %23, i32* %6
%24 = load i32, i32* %4
store i32 %24, i32* %3
%25 = load i32, i32* %5
store i32 %25, i32* %4
br label %7
26: ; preds = %7
%27 = load i32, i32* %6
%28 = zext i32 %27 to i64
ret i64 %28
}

LLVM IR (-O2):
define i64 @sumFibUnevenUntil(i32 %0) {
%2 = icmp ugt i32 %0, 2
br i1 %2, label %3, label %15
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 1, %1 ]
%6 = phi i32 [ %5, %3 ], [ 1, %1 ]
%7 = add i32 %5, %6
%8 = and i32 %7, 1
%9 = xor i32 %8, 1
%10 = mul nuw i32 %9, %7
%11 = add i32 %10, %4
%12 = icmp ult i32 %7, %0
br i1 %12, label %3, label %13
13: ; preds = %3
%14 = zext i32 %11 to i64
br label %15
15: ; preds = %13, %1
%16 = phi i64 [ 0, %1 ], [ %14, %13 ]
ret i64 %16
}
void f0(volatile int *steal_flag) {
  int i = 0;
  while (!*steal_flag)
    ;
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112a <f0+0x2a>
jmp    112f <f0+0x2f>
jmp    110f <f0+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
cmpl   $0x0,(%rdi)
je     1100 <f0>
ret

LLVM IR (-O0):
define void @f0(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32*, i32** %2
%6 = load volatile i32, i32* %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @f0(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
void sigalrm_handler(int signo) {}


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

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

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

LLVM IR (-O2):
define void @sigalrm_handler(i32 %0) {
ret void
}
int test_imm_50int64_lowword_mem(long long *val) {
  return ((*val) & (0x50 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_50int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 80
%6 = icmp ne i64 %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_50int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 80
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void thread_pexit(int err, const char *fCall) {
  fprintf(stderr, "%s: %s\n", fCall, strerror(err));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<thread_pexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<thread_pexit>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
call   1050 <strerror@plt>
lea    0xeb5(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @thread_pexit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @thread_pexit(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i8* @strerror(i32 %0)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ lcs_test();
int main() { lcs_test(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @lcs_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ doublesubcycle1();
void __attribute__((flatten)) doublesubcycle(void) { doublesubcycle1(); }


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

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

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

LLVM IR (-O2):
define void @doublesubcycle() {
%1 = tail call i32 (...) @doublesubcycle1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ClrGyr(int, int);
int /*<<< orphan*/ GenMes(int, int /*<<< orphan*/);
int /*<<< orphan*/ RamRead32A(int, unsigned long *);
unsigned long MesMSABS1AV(void) {
  unsigned long ulRamDat;
  ClrGyr(0x1000, 0x02);
  GenMes(0x144F, 0);
  RamRead32A(0x1041, &(ulRamDat));
  return (ulRamDat);
}


x86 assembly (clang, -O0):
<MesMSABS1AV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1000,%edi
mov    $0x2,%esi
call   1030 <ClrGyr@plt>
mov    $0x144f,%edi
xor    %esi,%esi
call   1040 <GenMes@plt>
mov    $0x1041,%edi
lea    -0x8(%rbp),%rsi
call   1050 <RamRead32A@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MesMSABS1AV>:
push   %rax
mov    $0x1000,%edi
mov    $0x2,%esi
call   1030 <ClrGyr@plt>
mov    $0x144f,%edi
xor    %esi,%esi
call   1040 <GenMes@plt>
mov    %rsp,%rsi
mov    $0x1041,%edi
call   1050 <RamRead32A@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @MesMSABS1AV() {
%1 = alloca i64
%2 = call i32 @ClrGyr(i32 4096, i32 2)
%3 = call i32 @GenMes(i32 5199, i32 0)
%4 = call i32 @RamRead32A(i32 4161, i64* %1)
%5 = load i64, i64* %1
ret i64 %5
}

LLVM IR (-O2):
define i64 @MesMSABS1AV() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @ClrGyr(i32 4096, i32 2)
%4 = tail call i32 @GenMes(i32 5199, i32 0)
%5 = call i32 @RamRead32A(i32 4161, i64* %1)
%6 = load i64, i64* %1
ret i64 %6
}
/* Variables and functions */
int f425(int *);
int f426(int *p) { return f425(p); }


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

x86 assembly (clang, -O2):
<f426>:
jmp    1030 <f425@plt>

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

LLVM IR (-O2):
define i32 @f426(i32* %0) {
%2 = tail call i32 @f425(i32* %0)
ret i32 %2
}
void g_signal_parse_name() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_parse_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __write2(char *);
void printUsage() {
  __write2("usage: shutdown -[rhosmn] -[t secs]\n"
           "\t -r:        reboot after shutdown\n"
           "\t -h:        halt after shutdown\n"
           "\t -o:	       power-off after shutdown\n"
           "\t -s:	       single-user console after shutdown\n"
           "\t -m:	       only shutdown the minit-part\n"
           "\t -n:        do not shutdown services using minit\n"
           "\t -t secs:   delay between SIGTERM and SIGKILL\n");
}


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

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

LLVM IR (-O0):
@.str = [330 x i8] c"usage: shutdown -[rhosmn] -[t secs]\0A\09 -r: reboot after shutdown\0A\09 -h: halt after shutdown\0A\09 -o:\09 power-off after shutdown\0A\09 -s:\09 single-user console after shutdown\0A\09 -m:\09 only shutdown the minit-part\0A\09 -n: do not shutdown services using minit\0A\09 -t secs: delay between SIGTERM and SIGKILL\0A\00"
define void @printUsage() {
%1 = call i32 @__write2(i8* getelementptr inbounds ([330 x i8], [330 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [330 x i8] c"usage: shutdown -[rhosmn] -[t secs]\0A\09 -r: reboot after shutdown\0A\09 -h: halt after shutdown\0A\09 -o:\09 power-off after shutdown\0A\09 -s:\09 single-user console after shutdown\0A\09 -m:\09 only shutdown the minit-part\0A\09 -n: do not shutdown services using minit\0A\09 -t secs: delay between SIGTERM and SIGKILL\0A\00"
define void @printUsage() {
%1 = tail call i32 @__write2(i8* getelementptr inbounds ([330 x i8], [330 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int characters_count(char const *);
int lexicographic_sort(char const *, char const *);
int sort_by_number_of_distinct_characters(const char *a, const char *b) {
  int con = characters_count(a) - characters_count(b);
  return (con ? con : lexicographic_sort(a, b));
}


x86 assembly (clang, -O0):
<sort_by_number_of_distinct_characters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <characters_count@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <characters_count@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1164 <sort_by_number_of_distinct_characters+0x44>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1174 <sort_by_number_of_distinct_characters+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <lexicographic_sort@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_by_number_of_distinct_characters>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <characters_count@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <characters_count@plt>
sub    %eax,%ebp
je     1144 <sort_by_number_of_distinct_characters+0x24>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <lexicographic_sort@plt>

LLVM IR (-O0):
define i32 @sort_by_number_of_distinct_characters(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @characters_count(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @characters_count(i8* %8)
%10 = sub nsw i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %5
br label %19
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @lexicographic_sort(i8* %16, i8* %17)
br label %19
19: ; preds = %15, %13
%20 = phi i32 [ %14, %13 ], [ %18, %15 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @sort_by_number_of_distinct_characters(i8* %0, i8* %1) {
%3 = tail call i32 @characters_count(i8* %0)
%4 = tail call i32 @characters_count(i8* %1)
%5 = sub nsw i32 %3, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @lexicographic_sort(i8* %0, i8* %1)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
/* Variables and functions */
void *_mm_malloc(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *MemoryAllocate(int NrOfElements, int SizeOfElement) {
  void *Array;
  if ((Array = _mm_malloc(NrOfElements * SizeOfElement, 16)) == NULL) {
    fprintf(stderr, "ERROR: not enough memory available!\n\n");
  }
  return Array;
}


x86 assembly (clang, -O0):
<MemoryAllocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    $0x10,%esi
call   1040 <_mm_malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1162 <MemoryAllocate+0x42>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemoryAllocate>:
push   %rbx
imul   %esi,%edi
mov    $0x10,%esi
call   1040 <_mm_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <MemoryAllocate+0x2b>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"ERROR: not enough memory available!\0A\0A\00"
define i8* @MemoryAllocate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = call i8* @_mm_malloc(i32 %8, i32 16)
store i8* %9, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"ERROR: not enough memory available!\0A\0A\00"
define i8* @MemoryAllocate(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i8* @_mm_malloc(i32 %3, i32 16)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %2
ret i8* %4
}
int do_827() { return 827; }


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

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

LLVM IR (-O0):
define i32 @do_827() {
ret i32 827
}

LLVM IR (-O2):
define i32 @do_827() {
ret i32 827
}
unsigned long WDTimerStatusGet(void) {
  return (*((volatile unsigned long *)(0x40003008)));
}


x86 assembly (clang, -O0):
<WDTimerStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40003008,%eax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WDTimerStatusGet>:
mov    0x40003008,%rax
40
ret

LLVM IR (-O0):
define i64 @WDTimerStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1073754120 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @WDTimerStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1073754120 to i64*)
ret i64 %1
}
/* Variables and functions */
int tolower(int);
int not_usually_after_r(int c0) {
  int c;
  c = tolower(c0);
  return (c == 'r' || c == 'l');
}


x86 assembly (clang, -O0):
<not_usually_after_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x72,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113f <not_usually_after_r+0x2f>
cmpl   $0x6c,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_usually_after_r>:
push   %rax
call   1030 <tolower@plt>
cmp    $0x72,%eax
sete   %cl
cmp    $0x6c,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @not_usually_after_r(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @tolower(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 114
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 108
br label %11
11: ; preds = %8, %1
%12 = phi i1 [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @not_usually_after_r(i32 %0) {
%2 = tail call i32 @tolower(i32 %0)
%3 = icmp eq i32 %2, 114
%4 = icmp eq i32 %2, 108
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int atoi(char *);
int Atoi0(char *string) {
  if (string != NULL && *string != '\0') {
    return (atoi(string));
  }
  return (0);
}


x86 assembly (clang, -O0):
<Atoi0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <Atoi0+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <Atoi0+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    114f <Atoi0+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Atoi0>:
test   %rdi,%rdi
je     111f <Atoi0+0xf>
cmpb   $0x0,(%rdi)
je     111f <Atoi0+0xf>
jmp    1030 <atoi@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Atoi0(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %0)
br label %8
8: ; preds = %1, %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ], [ 0, %1 ]
ret i32 %9
}
double f4_sum_two_short(short v1, short v2) {
  return ((double)(v1)) + ((double)(v2));
}


x86 assembly (clang, -O0):
<f4_sum_two_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
movswl -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @f4_sum_two_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 = sitofp i16 %5 to double
%7 = load i16, i16* %4
%8 = sitofp i16 %7 to double
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f4_sum_two_short(i16 signext %0, i16 signext %1) {
%3 = sitofp i16 %0 to double
%4 = sitofp i16 %1 to double
%5 = fadd double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x51() {
  Assert_real((iscntrl(81) == 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_iscntrl.c",
              410, ("iscntrl should be 0 for Q"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x51>:
push   %rax
mov    $0x51,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x19a,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for Q\00"
define void @t_iscntrl_0x51() {
%1 = call i64 @iscntrl(i32 81)
%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 410, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for Q\00"
define void @t_iscntrl_0x51() {
%1 = tail call i64 @iscntrl(i32 81)
%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 410, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int MAKE_INT_8(int A) { return (A & 0x80) ? A | ~0xff : A & 0xff; }


x86 assembly (clang, -O0):
<MAKE_INT_8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1128 <MAKE_INT_8+0x28>
mov    -0x4(%rbp),%eax
or     $0xffffff00,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <MAKE_INT_8+0x33>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAKE_INT_8>:
movsbl %dil,%eax
movzbl %al,%ecx
and    $0xffffff00,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @MAKE_INT_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, -256
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = and i32 %10, 255
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %8, %6 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @MAKE_INT_8(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 255
%5 = select i1 %3, i32 0, i32 -256
%6 = or i32 %5, %4
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, void *, size_t);
ssize_t lisp_write(int fd, void *buf, size_t count) {
  return write(fd, buf, count);
}


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

x86 assembly (clang, -O2):
<lisp_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @lisp_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void perror(const char *s) { printf("%s: %s\n", s, strerror(errno)); }


x86 assembly (clang, -O0):
<perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @perror(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret void
}
int testDefineSymbol() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @testDefineSymbol() {
ret i32 0
}
int security_file_alloc(struct file *file) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define i32 @security_file_alloc(%struct.file* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printmsg() { puts("Hello World!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @printmsg() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @printmsg() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *GetMemoryBlock(int);
int strlen(char *);
char *GetNewBuffer(char *Line, int Increment) {
  int len;
  char *retval;
  if (Line == NULL)
    return NULL;
  len = strlen(Line) + Increment + 1;
  retval = GetMemoryBlock(len);
  retval[0] = 0;
  return retval;
}


x86 assembly (clang, -O0):
<GetNewBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <GetNewBuffer+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1174 <GetNewBuffer+0x54>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <GetMemoryBlock@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNewBuffer>:
test   %rdi,%rdi
je     113d <GetNewBuffer+0x1d>
push   %rbx
mov    %esi,%ebx
call   1030 <strlen@plt>
lea    (%rbx,%rax,1),%edi
add    $0x1,%edi
call   1040 <GetMemoryBlock@plt>
movb   $0x0,(%rax)
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @GetNewBuffer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* null, i8** %3
br label %22
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @strlen(i8* %12)
%14 = load i32, i32* %5
%15 = add nsw i32 %13, %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = call i8* @GetMemoryBlock(i32 %17)
store i8* %18, i8** %7
%19 = load i8*, i8** %7
%20 = getelementptr inbounds i8, i8* %19, i64 0
store i8 0, i8* %20
%21 = load i8*, i8** %7
store i8* %21, i8** %3
br label %22
22: ; preds = %11, %10
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @GetNewBuffer(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
%6 = add i32 %1, 1
%7 = add i32 %6, %5
%8 = tail call i8* @GetMemoryBlock(i32 %7)
store i8 0, i8* %8
br label %9
9: ; preds = %2, %4
%10 = phi i8* [ %8, %4 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ puts(char *);
void quitWithError(char const *string) {
  perror(string);
  puts("\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<quitWithError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<quitWithError>:
push   %rax
call   1040 <perror@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@EXIT_FAILURE = global i32 0
define void @quitWithError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@EXIT_FAILURE = global i32 0
define void @quitWithError(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MFRC522_HAL_read(int /*<<< orphan*/);
uint8_t MFRC522_ReadRegister(uint8_t addr) { return MFRC522_HAL_read(addr); }


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

x86 assembly (clang, -O2):
<MFRC522_ReadRegister>:
jmp    1030 <MFRC522_HAL_read@plt>

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

LLVM IR (-O2):
define i32 @MFRC522_ReadRegister(i32 %0) {
%2 = tail call i32 @MFRC522_HAL_read(i32 %0)
ret i32 %2
}
/* Type definitions */
struct fcb {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned char *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ set_error(struct fcb *, int, char *);
unsigned char read_byte(struct fcb *f, FILE *file) {
  unsigned char ch = 0;
  if (fread(&ch, sizeof(char), (size_t)1, file) != 1)
    set_error(f, 16, "read_byte failed");
  return (ch);
}


x86 assembly (clang, -O0):
<read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x11(%rbp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     1169 <read_byte+0x49>
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
lea    0xe9c(%rip),%rdx
call   1040 <set_error@plt>
movzbl -0x11(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_byte>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rcx
mov    %rdi,%rbx
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rdi
mov    $0x1,%edx
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    $0x1,%eax
je     115d <read_byte+0x3d>
lea    0xeb0(%rip),%rdx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <set_error@plt>
mov    0xf(%rsp),%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.fcb = type { i32 }
@.str = [17 x i8] c"read_byte failed\00"
define zeroext i8 @read_byte(%struct.fcb* %0, i32* %1) {
%3 = alloca %struct.fcb*
%4 = alloca i32*
%5 = alloca i8
store %struct.fcb* %0, %struct.fcb** %3
store i32* %1, i32** %4
store i8 0, i8* %5
%6 = load i32*, i32** %4
%7 = call i32 @fread(i8* %5, i32 1, i64 1, i32* %6)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load %struct.fcb*, %struct.fcb** %3
%11 = call i32 @set_error(%struct.fcb* %10, i32 16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %2
%13 = load i8, i8* %5
ret i8 %13
}

LLVM IR (-O2):
%struct.fcb = type { i32 }
@.str = [17 x i8] c"read_byte failed\00"
define zeroext i8 @read_byte(%struct.fcb* %0, i32* nocapture %1) {
%3 = alloca i8
store i8 0, i8* %3
%4 = call i32 @fread(i8* %3, i32 1, i64 1, i32* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @set_error(%struct.fcb* %0, i32 16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = load i8, i8* %3
ret i8 %9
}
/* Variables and functions */
int sprintf(char *, char *, int);
char *print_cop1(int reg, char *output) {
  int len;
  len = sprintf(output, "$fcr%d", reg);
  return output + len;
}


x86 assembly (clang, -O0):
<print_cop1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cop1>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"$fcr%d\00"
define i8* @print_cop1(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
ret i8* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"$fcr%d\00"
define i8* @print_cop1(i32 %0, i8* writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
ret i8* %5
}
void rop3_72_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_72_0_1>:
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
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_72_0_1>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %dl,%cl
and    %sil,%cl
not    %sil
and    %dl,%sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_72_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %6
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = or i32 %26, %32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = and i32 %39, %42
%44 = or i32 %33, %43
%45 = trunc i32 %44 to i8
%46 = load i8*, i8** %4
store i8 %45, i8* %46
ret void
}

LLVM IR (-O2):
define void @rop3_72_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %1, -1
%8 = and i8 %7, %2
%9 = and i8 %8, %4
%10 = or i8 %6, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage_exit(int exitcode) {
  fprintf(stderr,
          "Usage: sendiso [opts] FILE\n"
          "Send IEEE 1394 isochronous packets from dump file FILE.\n"
          "\n"
          "-l --loop      COUNT       Repeat sending data COUNT times.\n"
          "-i --infinite              Repeat sending data infinitely.\n"
          "-s --speed     SPEED       Send data at SPEED (valid values are "
          "100, 200, 400 or\n"
          "                           alternatively 1, 2, 4). (default: 100)\n"
          "\n"
          "-p --port      PORT        Choose 1394 chip PORT. (default: 0)\n"
          "-h --help                  Show this help.\n");
  exit(exitcode);
}


x86 assembly (clang, -O0):
<usage_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_exit>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [458 x i8] c"Usage: sendiso [opts] FILE\0ASend IEEE 1394 isochronous packets from dump file FILE.\0A\0A-l --loop COUNT Repeat sending data COUNT times.\0A-i --infinite Repeat sending data infinitely.\0A-s --speed SPEED Send data at SPEED (valid values are 100, 200, 400 or\0A alternatively 1, 2, 4). (default: 100)\0A\0A-p --port PORT Choose 1394 chip PORT. (default: 0)\0A-h --help Show this help.\0A\00"
define void @usage_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([458 x i8], [458 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [458 x i8] c"Usage: sendiso [opts] FILE\0ASend IEEE 1394 isochronous packets from dump file FILE.\0A\0A-l --loop COUNT Repeat sending data COUNT times.\0A-i --infinite Repeat sending data infinitely.\0A-s --speed SPEED Send data at SPEED (valid values are 100, 200, 400 or\0A alternatively 1, 2, 4). (default: 100)\0A\0A-p --port PORT Choose 1394 chip PORT. (default: 0)\0A-h --help Show this help.\0A\00"
define void @usage_exit(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([458 x i8], [458 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldrd(int /*<<< orphan*/);
int /*<<< orphan*/ arm_memio_regdh_op();
void arm_ldrd_reg() { arm_memio_ldrd(arm_memio_regdh_op()); }


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

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

LLVM IR (-O0):
define void @arm_ldrd_reg() {
%1 = call i32 (...) @arm_memio_regdh_op()
%2 = call i32 @arm_memio_ldrd(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_ldrd_reg() {
%1 = tail call i32 (...) @arm_memio_regdh_op()
%2 = tail call i32 @arm_memio_ldrd(i32 %1)
ret void
}
/* Type definitions */
struct ISzAlloc {
  int dummy;
};
struct CLzmaDec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LzmaDec_FreeDict(struct CLzmaDec *, struct ISzAlloc *);
int /*<<< orphan*/ LzmaDec_FreeProbs(struct CLzmaDec *, struct ISzAlloc *);
void LzmaDec_Free(struct CLzmaDec *p, struct ISzAlloc *alloc) {
  LzmaDec_FreeProbs(p, alloc);
  LzmaDec_FreeDict(p, alloc);
}


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

x86 assembly (clang, -O2):
<LzmaDec_Free>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <LzmaDec_FreeProbs@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <LzmaDec_FreeDict@plt>

LLVM IR (-O0):
%struct.CLzmaDec = type { i32 }
%struct.ISzAlloc = type { i32 }
define void @LzmaDec_Free(%struct.CLzmaDec* %0, %struct.ISzAlloc* %1) {
%3 = alloca %struct.CLzmaDec*
%4 = alloca %struct.ISzAlloc*
store %struct.CLzmaDec* %0, %struct.CLzmaDec** %3
store %struct.ISzAlloc* %1, %struct.ISzAlloc** %4
%5 = load %struct.CLzmaDec*, %struct.CLzmaDec** %3
%6 = load %struct.ISzAlloc*, %struct.ISzAlloc** %4
%7 = call i32 @LzmaDec_FreeProbs(%struct.CLzmaDec* %5, %struct.ISzAlloc* %6)
%8 = load %struct.CLzmaDec*, %struct.CLzmaDec** %3
%9 = load %struct.ISzAlloc*, %struct.ISzAlloc** %4
%10 = call i32 @LzmaDec_FreeDict(%struct.CLzmaDec* %8, %struct.ISzAlloc* %9)
ret void
}

LLVM IR (-O2):
%struct.CLzmaDec = type { i32 }
%struct.ISzAlloc = type { i32 }
define void @LzmaDec_Free(%struct.CLzmaDec* %0, %struct.ISzAlloc* %1) {
%3 = tail call i32 @LzmaDec_FreeProbs(%struct.CLzmaDec* %0, %struct.ISzAlloc* %1)
%4 = tail call i32 @LzmaDec_FreeDict(%struct.CLzmaDec* %0, %struct.ISzAlloc* %1)
ret void
}
void g_tree_insert() {}


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

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

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

LLVM IR (-O2):
define void @g_tree_insert() {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ reverse(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *reverse_copy(char *message) {
  char *str2 = malloc(sizeof(char) * 100);
  strcpy(str2, message);
  reverse(str2);
  return str2;
}


x86 assembly (clang, -O0):
<reverse_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @reverse_copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 100)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @reverse(i8* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @reverse_copy(i8* %0) {
%2 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%3 = tail call i32 @strcpy(i8* %2, i8* %0)
%4 = tail call i32 @reverse(i8* %2)
ret i8* %2
}