xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
scalar_t__ realloc(char *, int);
void reallocRadar6337483_1() {
  char *buf = malloc(100);
  buf = (char *)realloc(buf, 0x1000000);
  if (!buf) {
    return;
  }
  free(buf);
}


x86 assembly (clang, -O0):
<reallocRadar6337483_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1000000,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1168 <reallocRadar6337483_1+0x38>
jmp    1171 <reallocRadar6337483_1+0x41>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocRadar6337483_1>:
push   %rax
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x1000000,%esi
call   1050 <realloc@plt>
test   %rax,%rax
je     1156 <reallocRadar6337483_1+0x26>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @reallocRadar6337483_1() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 100)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i64 @realloc(i8* %3, i32 16777216)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %0
br label %12
9: ; preds = %0
%10 = load i8*, i8** %1
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @reallocRadar6337483_1() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i64 @realloc(i8* %1, i32 16777216)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = inttoptr i64 %2 to i8*
%6 = tail call i32 @free(i8* %5)
br label %7
7: ; preds = %0, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int answer = (4 + (5 - 2)) * 6 / 3;
  printf("The answer is %d", answer);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"The answer is %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 14)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
signed int vsprintf(char *pString, const char *pFormat, va_list ap) {
  return vsnprintf(pString, 128, pFormat, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x80,%esi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x80,%esi
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
define i32 @vsprintf(i8* %0, i8* %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 @vsnprintf(i8* %7, i32 128, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i32 128, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ size_to_objp(size_t);
void *compare_strn_context(size_t n) { return (void *)size_to_objp(n); }


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

x86 assembly (clang, -O2):
<compare_strn_context>:
jmp    1030 <size_to_objp@plt>

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

LLVM IR (-O2):
define i8* @compare_strn_context(i64 %0) {
%2 = tail call i64 @size_to_objp(i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatal(char *msg) {
  fprintf(stderr, "?dbow: fatal error: %s.\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"?dbow: fatal error: %s.\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"?dbow: fatal error: %s.\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xf4() {
  Assert_real((isdigit(244) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              1225, ("isdigit should be 0 for 0xf4"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf4\00"
define void @t_isdigit_0xf4() {
%1 = call i64 @isdigit(i32 244)
%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 1225, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf4\00"
define void @t_isdigit_0xf4() {
%1 = tail call i64 @isdigit(i32 244)
%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 1225, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callee(void **);
int /*<<< orphan*/ clang_analyzer_eval(int);
void loop() {
  void *arr[2];
  for (int i = 0; i < 2; ++i)
    callee(&arr[i]);
  clang_analyzer_eval(arr[0] == arr[1]);
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    115b <loop+0x3b>
movslq -0x14(%rbp),%rax
lea    -0x10(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <callee@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <loop+0xf>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <callee@plt>
lea    0x8(%rsp),%rdi
call   1030 <callee@plt>
mov    (%rsp),%rax
xor    %edi,%edi
cmp    0x8(%rsp),%rax
sete   %dil
call   1040 <clang_analyzer_eval@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @loop() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @callee(i8** %3)
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
%6 = call i32 @callee(i8** %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %5
%9 = icmp eq i8* %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @clang_analyzer_eval(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f();
main() {
  if (f() != 1)
    abort();
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0x1,%eax
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
int suspend_nvs_save(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @suspend_nvs_save() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_strlen(char *);
scalar_t__ my_strncmp(char *, char *, int /*<<< orphan*/);
int my_strcmp_start(char *str, char *start) {
  if (my_strncmp(start, str, my_strlen(start)) == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<my_strcmp_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <my_strncmp@plt>
cmp    $0x0,%rax
jne    116e <my_strcmp_start+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <my_strcmp_start+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp_start>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <my_strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <my_strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @my_strcmp_start(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @my_strlen(i8* %8)
%10 = call i64 @my_strncmp(i8* %6, i8* %7, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @my_strcmp_start(i8* %0, i8* %1) {
%3 = tail call i32 @my_strlen(i8* %1)
%4 = tail call i64 @my_strncmp(i8* %1, i8* %0, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void hright_(i) int *i;
{ hrightjustify(*i); }


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

x86 assembly (clang, -O2):
<hright_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <hrightjustify@plt>

LLVM IR (-O0):
define void @hright_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @hrightjustify to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @hright_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @hrightjustify to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  int num = 0;
  for (i = 1; i <= 50; i++) {
    printf("%d, ", num);
    num = num + 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jg     115d <main+0x4d>
mov    -0xc(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x2,%ebx
cmp    $0x64,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = phi i32 [ 1, %0 ], [ %6, %1 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = add nuw nsw i32 %2, 2
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 51
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xb6() {
  Assert_real((isbdigit(182) == 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_isbdigit.c",
              915, ("isbdigit should be 0 for 0xb6"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xb6>:
push   %rax
mov    $0xb6,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x393,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb6\00"
define void @t_isbdigit_0xb6() {
%1 = call i64 @isbdigit(i32 182)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 915, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb6\00"
define void @t_isbdigit_0xb6() {
%1 = tail call i64 @isbdigit(i32 182)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 915, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void BN_GF2m_mod_exp(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_GF2m_mod_exp() {
ret void
}
/* Type definitions */
struct binder_io {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct binder_io *);
void free_binder_io(struct binder_io *p) { free(p); }


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

x86 assembly (clang, -O2):
<free_binder_io>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.binder_io = type { i32 }
define void @free_binder_io(%struct.binder_io* %0) {
%2 = alloca %struct.binder_io*
store %struct.binder_io* %0, %struct.binder_io** %2
%3 = load %struct.binder_io*, %struct.binder_io** %2
%4 = call i32 @free(%struct.binder_io* %3)
ret void
}

LLVM IR (-O2):
%struct.binder_io = type { i32 }
define void @free_binder_io(%struct.binder_io* nocapture %0) {
%2 = tail call i32 @free(%struct.binder_io* %0)
ret void
}
void LedDriver_Destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @LedDriver_Destroy() {
ret void
}
/* Variables and functions */
int my_strlen(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  printf("%s, %d\n", "Hello", my_strlen("Hello"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee0(%rip),%rbx
mov    %rbx,%rdi
call   1030 <my_strlen@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s, %d\0A\00"
@.str.1 = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @my_strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s, %d\0A\00"
@.str.1 = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @my_strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
int convert_hex_to_decimal(char *hex) {
  if ('0' <= *hex && *hex <= '9') {
    return *hex - '0';
  }
  if ('a' <= *hex && *hex <= 'z') {
    return *hex - 'a' + 10;
  }
  return 0;
}


x86 assembly (clang, -O0):
<convert_hex_to_decimal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     113e <convert_hex_to_decimal+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     113e <convert_hex_to_decimal+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117e <convert_hex_to_decimal+0x7e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1177 <convert_hex_to_decimal+0x77>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1177 <convert_hex_to_decimal+0x77>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117e <convert_hex_to_decimal+0x7e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_hex_to_decimal>:
movsbl (%rdi),%eax
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     110f <convert_hex_to_decimal+0xf>
add    $0xffffffd0,%eax
ret
lea    -0x61(%rax),%ecx
add    $0xffffffa9,%eax
xor    %edx,%edx
cmp    $0x1a,%cl
cmovb  %eax,%edx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @convert_hex_to_decimal(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add i8 %2, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = add nsw i32 %3, -48
br label %13
8: ; preds = %1
%9 = add i8 %2, -97
%10 = icmp ult i8 %9, 26
%11 = add nsw i32 %3, -87
%12 = select i1 %10, i32 %11, i32 0
br label %13
13: ; preds = %8, %6
%14 = phi i32 [ %7, %6 ], [ %12, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ blastSRR(unsigned char *, int /*<<< orphan*/);
void blastConnect(unsigned char destIP[4]) { blastSRR(destIP, 0); }


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

x86 assembly (clang, -O2):
<blastConnect>:
xor    %esi,%esi
jmp    1030 <blastSRR@plt>

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

LLVM IR (-O2):
define void @blastConnect(i8* %0) {
%2 = tail call i32 @blastSRR(i8* %0, i32 0)
ret void
}
double test_fmod(double x, double y) { return __builtin_fmod(x, y); }


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

x86 assembly (clang, -O2):
<test_fmod>:
jmp    1030 <fmod@plt>

LLVM IR (-O0):
define double @test_fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @fmod(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @test_fmod(double %0, double %1) {
%3 = tail call double @fmod(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ acos(int);
int glmComputeVectorLength2f(float const *);
float glmDegf(int /*<<< orphan*/);
int glmDotProduct2f(float const *, float const *);
float glmComputeVectorAngle2fDeg(const float v1[2], const float v2[2]) {
  return glmDegf(
      acos(glmDotProduct2f(v1, v2) /
           (glmComputeVectorLength2f(v1) * glmComputeVectorLength2f(v2))));
}


x86 assembly (clang, -O0):
<glmComputeVectorAngle2fDeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <glmDotProduct2f@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <glmComputeVectorLength2f@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <glmComputeVectorLength2f@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <acos@plt>
mov    %eax,%edi
call   1050 <glmDegf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeVectorAngle2fDeg>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1060 <glmDotProduct2f@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <glmComputeVectorLength2f@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <glmComputeVectorLength2f@plt>
mov    %eax,%ecx
imul   %ebx,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <acos@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <glmDegf@plt>

LLVM IR (-O0):
define float @glmComputeVectorAngle2fDeg(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @glmDotProduct2f(float* %5, float* %6)
%8 = load float*, float** %3
%9 = call i32 @glmComputeVectorLength2f(float* %8)
%10 = load float*, float** %4
%11 = call i32 @glmComputeVectorLength2f(float* %10)
%12 = mul nsw i32 %9, %11
%13 = sdiv i32 %7, %12
%14 = call i32 @acos(i32 %13)
%15 = call float @glmDegf(i32 %14)
ret float %15
}

LLVM IR (-O2):
define float @glmComputeVectorAngle2fDeg(float* %0, float* %1) {
%3 = tail call i32 @glmDotProduct2f(float* %0, float* %1)
%4 = tail call i32 @glmComputeVectorLength2f(float* %0)
%5 = tail call i32 @glmComputeVectorLength2f(float* %1)
%6 = mul nsw i32 %5, %4
%7 = sdiv i32 %3, %6
%8 = tail call i32 @acos(i32 %7)
%9 = tail call float @glmDegf(i32 %8)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ p16e_eeprom_2();
int /*<<< orphan*/ p16e_int_pin_2();
int /*<<< orphan*/ p16e_int_ports();
int /*<<< orphan*/ p16e_mssp();
int /*<<< orphan*/ p16e_pps_out();
int /*<<< orphan*/ p16e_tmr0_2();
int /*<<< orphan*/ p16e_tmr1();
int /*<<< orphan*/ p16e_tmr2();
int /*<<< orphan*/ p16e_wdt();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC16F18855_periferic(void) {
  p16e_pps_out();
  p16e_mssp();
  p16e_int_pin_2();
  p16e_int_ports();
  p16e_tmr0_2();
  p16e_wdt();
  p16e_eeprom_2();
  p16e_tmr1();
  p16e_tmr2();
  serial(0);
}


x86 assembly (clang, -O0):
<PIC16F18855_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10b0 <p16e_pps_out@plt>
mov    $0x0,%al
call   1050 <p16e_mssp@plt>
mov    $0x0,%al
call   10a0 <p16e_int_pin_2@plt>
mov    $0x0,%al
call   1090 <p16e_int_ports@plt>
mov    $0x0,%al
call   1030 <p16e_tmr0_2@plt>
mov    $0x0,%al
call   1040 <p16e_wdt@plt>
mov    $0x0,%al
call   1080 <p16e_eeprom_2@plt>
mov    $0x0,%al
call   10c0 <p16e_tmr1@plt>
mov    $0x0,%al
call   1070 <p16e_tmr2@plt>
xor    %edi,%edi
call   1060 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC16F18855_periferic>:
push   %rax
xor    %eax,%eax
call   10b0 <p16e_pps_out@plt>
xor    %eax,%eax
call   1050 <p16e_mssp@plt>
xor    %eax,%eax
call   10a0 <p16e_int_pin_2@plt>
xor    %eax,%eax
call   1090 <p16e_int_ports@plt>
xor    %eax,%eax
call   1030 <p16e_tmr0_2@plt>
xor    %eax,%eax
call   1040 <p16e_wdt@plt>
xor    %eax,%eax
call   1080 <p16e_eeprom_2@plt>
xor    %eax,%eax
call   10c0 <p16e_tmr1@plt>
xor    %eax,%eax
call   1070 <p16e_tmr2@plt>
xor    %edi,%edi
pop    %rax
jmp    1060 <serial@plt>

LLVM IR (-O0):
define void @PIC16F18855_periferic() {
%1 = call i32 (...) @p16e_pps_out()
%2 = call i32 (...) @p16e_mssp()
%3 = call i32 (...) @p16e_int_pin_2()
%4 = call i32 (...) @p16e_int_ports()
%5 = call i32 (...) @p16e_tmr0_2()
%6 = call i32 (...) @p16e_wdt()
%7 = call i32 (...) @p16e_eeprom_2()
%8 = call i32 (...) @p16e_tmr1()
%9 = call i32 (...) @p16e_tmr2()
%10 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F18855_periferic() {
%1 = tail call i32 (...) @p16e_pps_out()
%2 = tail call i32 (...) @p16e_mssp()
%3 = tail call i32 (...) @p16e_int_pin_2()
%4 = tail call i32 (...) @p16e_int_ports()
%5 = tail call i32 (...) @p16e_tmr0_2()
%6 = tail call i32 (...) @p16e_wdt()
%7 = tail call i32 (...) @p16e_eeprom_2()
%8 = tail call i32 (...) @p16e_tmr1()
%9 = tail call i32 (...) @p16e_tmr2()
%10 = tail call i32 @serial(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos4i(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
void RasterPos4i(GLint x, GLint y, GLint z, GLint w) {
  glRasterPos4i(x, y, z, w);
}


x86 assembly (clang, -O0):
<RasterPos4i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <glRasterPos4i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterPos4i>:
jmp    1030 <glRasterPos4i@plt>

LLVM IR (-O0):
define void @RasterPos4i(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @glRasterPos4i(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @RasterPos4i(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glRasterPos4i(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpu_send_control_gp1(int);
void gpu_display_start(int x1, int y1) {
  gpu_send_control_gp1(0x05000000 | (x1 & 0x3FF) | ((y1 & 0x1FF) << 10));
}


x86 assembly (clang, -O0):
<gpu_display_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    $0x3ff,%edi
or     $0x5000000,%edi
mov    -0x8(%rbp),%eax
and    $0x1ff,%eax
shl    $0xa,%eax
or     %eax,%edi
call   1030 <gpu_send_control_gp1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpu_display_start>:
and    $0x3ff,%edi
shl    $0xa,%esi
and    $0x7fc00,%esi
add    %esi,%edi
add    $0x5000000,%edi
jmp    1030 <gpu_send_control_gp1@plt>

LLVM IR (-O0):
define void @gpu_display_start(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 1023
%7 = or i32 83886080, %6
%8 = load i32, i32* %4
%9 = and i32 %8, 511
%10 = shl i32 %9, 10
%11 = or i32 %7, %10
%12 = call i32 @gpu_send_control_gp1(i32 %11)
ret void
}

LLVM IR (-O2):
define void @gpu_display_start(i32 %0, i32 %1) {
%3 = and i32 %0, 1023
%4 = shl i32 %1, 10
%5 = and i32 %4, 523264
%6 = or i32 %3, %5
%7 = or i32 %6, 83886080
%8 = tail call i32 @gpu_send_control_gp1(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ wait(int);
void perror(char *string) {
  printf("\007\nERROR - %s\n\n", string);
  wait(3);
}


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

x86 assembly (clang, -O2):
<perror>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
pop    %rax
jmp    1040 <wait@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"\07\0AERROR - %s\0A\0A\00"
define void @perror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @wait(i32 3)
ret void
}
/* Variables and functions */
int read(int, char *, int);
int serialDataBlock(int, int);
int serialDataRead(int fd, char *buf, int count) {
  int ret;
  ret = serialDataBlock(fd, count);
  if (ret < 0)
    return -1;
  return read(fd, buf, count);
}


x86 assembly (clang, -O0):
<serialDataRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <serialDataBlock@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1156 <serialDataRead+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <serialDataRead+0x48>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialDataRead>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %edx,%esi
call   1040 <serialDataBlock@plt>
test   %eax,%eax
js     1146 <serialDataRead+0x26>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <read@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @serialDataRead(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @serialDataBlock(i32 %0, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t gpio_read(uint32_t *port, uint8_t pin) {
  return (port[0x3FC / 4] >> pin) & 1;
}


x86 assembly (clang, -O0):
<gpio_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3fc(%rax),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_read>:
mov    %esi,%ecx
mov    0x3fc(%rdi),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @gpio_read(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 255
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = ashr i32 %7, %8
%10 = and i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @gpio_read(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 255
%4 = load i32, i32* %3
%5 = lshr i32 %4, %1
%6 = and i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
void help_message(void) {
  errx(EXIT_FAILURE, "Usage: chat_client <address> <nickname>\n");
}


x86 assembly (clang, -O0):
<help_message>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_message>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [41 x i8] c"Usage: chat_client <address> <nickname>\0A\00"
define void @help_message() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = call i32 @errx(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [41 x i8] c"Usage: chat_client <address> <nickname>\0A\00"
define void @help_message() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = tail call i32 @errx(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
int iHxFaceShowMsg(int iMsgType, unsigned char *pszPrompt1,
                   unsigned char *pszPrompt2, unsigned char *pszLanguage) {
  return (0);
}


x86 assembly (clang, -O0):
<iHxFaceShowMsg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @iHxFaceShowMsg(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
void X509_REQ_add1_attr(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_add1_attr() {
ret void
}
/* Variables and functions */
int strncasecmp(char const *, char const *, unsigned int);
int str_case_cmp_len(const char *s1, const char *s2, unsigned int len) {
  return strncasecmp(s1, s2, len);
}


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

x86 assembly (clang, -O2):
<str_case_cmp_len>:
jmp    1030 <strncasecmp@plt>

LLVM IR (-O0):
define i32 @str_case_cmp_len(i8* %0, i8* %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 @strncasecmp(i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @str_case_cmp_len(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int rand_num(int);
int rand_dir(void) {
  switch (rand_num(4)) {
  case 0:
    return '{';
  case 1:
    return '}';
  case 2:
    return '!';
  case 3:
    return 'i';
  }
  return (-1);
}


x86 assembly (clang, -O0):
<rand_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <rand_num@plt>
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1175 <rand_dir+0x65>
mov    -0x10(%rbp),%rax
lea    0xec4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x7b,-0x4(%rbp)
jmp    117c <rand_dir+0x6c>
movl   $0x7d,-0x4(%rbp)
jmp    117c <rand_dir+0x6c>
movl   $0x21,-0x4(%rbp)
jmp    117c <rand_dir+0x6c>
movl   $0x69,-0x4(%rbp)
jmp    117c <rand_dir+0x6c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_dir>:
push   %rax
mov    $0x4,%edi
call   1030 <rand_num@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x3,%ecx
ja     1134 <rand_dir+0x24>
movslq %ecx,%rax
lea    0xecf(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_dir() {
%1 = alloca i32
%2 = call i32 @rand_num(i32 4)
switch i32 %2, label %7 [
i32 0, label %3
i32 1, label %4
i32 2, label %5
i32 3, label %6
]
3: ; preds = %0
store i32 123, i32* %1
br label %8
4: ; preds = %0
store i32 125, i32* %1
br label %8
5: ; preds = %0
store i32 33, i32* %1
br label %8
6: ; preds = %0
store i32 105, i32* %1
br label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %8
8: ; preds = %7, %6, %5, %4, %3
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@switch.table.rand_dir = [4 x i32] [i32 123, i32 125, i32 33, i32 105]
define i32 @rand_dir() {
%1 = tail call i32 @rand_num(i32 4)
%2 = icmp ult i32 %1, 4
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.rand_dir, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %0, %3
%8 = phi i32 [ %6, %3 ], [ -1, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ main_quit();
void onload(unsigned int type) { main_quit(); }


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

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

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

LLVM IR (-O2):
define void @onload(i32 %0) {
%2 = tail call i32 (...) @main_quit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void myhandler(int signo) {
  (void)signo;
  _exit(1);
}


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

x86 assembly (clang, -O2):
<myhandler>:
push   %rax
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @myhandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @myhandler(i32 %0) {
%2 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int main() {
  if (!fork())
    exit(0);
  close(0);
  close(1);
  close(2);
  char *a[] = {"/tmp/.WaEUF", 0};
  execve(*a, a, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%eax
jne    115f <main+0x1f>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1030 <close@plt>
mov    $0x2,%edi
call   1030 <close@plt>
mov    0x2c8f(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2c8c(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <execve@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1060 <fork@plt>
xor    %edi,%edi
test   %eax,%eax
je     118d <main+0x4d>
call   1030 <close@plt>
mov    $0x1,%edi
call   1030 <close@plt>
mov    $0x2,%edi
call   1030 <close@plt>
movaps 0x2c9f(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xe84(%rip),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1040 <execve@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"/tmp/.WaEUF\00"
@__const.main.a = [2 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = call i32 (...) @fork()
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = call i32 @close(i32 0)
%8 = call i32 @close(i32 1)
%9 = call i32 @close(i32 2)
%10 = bitcast [2 x i8*]* %1 to i8*
%11 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%12 = load i8*, i8** %11
%13 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%14 = call i32 @execve(i8* %12, i8** %13, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"/tmp/.WaEUF\00"
@__const.main.a = [2 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = tail call i32 (...) @fork()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = tail call i32 @close(i32 0)
%8 = tail call i32 @close(i32 1)
%9 = tail call i32 @close(i32 2)
%10 = bitcast [2 x i8*]* %1 to i8*
%11 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%12 = call i32 @execve(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %11, i32 0)
ret i32 0
}