xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x8b() {
  Assert_real((isascii(139) == 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_isascii.c",
              700, ("isascii should be 0 for 0x8b"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x8b>:
push   %rax
mov    $0x8b,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2bc,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x8b\00"
define void @t_isascii_0x8b() {
%1 = call i64 @isascii(i32 139)
%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 700, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x8b\00"
define void @t_isascii_0x8b() {
%1 = tail call i64 @isascii(i32 139)
%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 700, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash_tw2(uint32_t a) {
  a = ~a + (a << 15);
  a = a ^ (a >> 12);
  a = a + (a << 2);
  a = a ^ (a >> 4);
  a = a * 2057;
  a = a ^ (a >> 16);
  return a;
}


x86 assembly (clang, -O0):
<hash_tw2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
shl    $0xf,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xc,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x809,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_tw2>:
mov    %edi,%eax
not    %eax
shl    $0xf,%edi
add    %eax,%edi
mov    %edi,%eax
sar    $0xc,%eax
xor    %edi,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
xor    %eax,%ecx
imul   $0x809,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash_tw2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = load i32, i32* %2
%6 = shl i32 %5, 15
%7 = add nsw i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 12
%11 = xor i32 %8, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = shl i32 %13, 2
%15 = add nsw i32 %12, %14
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 4
%19 = xor i32 %16, %18
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = mul nsw i32 %20, 2057
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = load i32, i32* %2
%24 = ashr i32 %23, 16
%25 = xor i32 %22, %24
store i32 %25, i32* %2
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @hash_tw2(i32 %0) {
%2 = xor i32 %0, -1
%3 = shl i32 %0, 15
%4 = add nsw i32 %3, %2
%5 = ashr i32 %4, 12
%6 = xor i32 %5, %4
%7 = mul i32 %6, 5
%8 = ashr i32 %7, 4
%9 = xor i32 %8, %7
%10 = mul nsw i32 %9, 2057
%11 = ashr i32 %10, 16
%12 = xor i32 %11, %10
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ __bound_new_region(void *, size_t);
void *libc_malloc(size_t);
void *__bound_malloc(size_t size, const void *caller) {
  void *ptr;
  ptr = libc_malloc(size + 1);
  if (!ptr)
    return NULL;

  ;
  __bound_new_region(ptr, size);
  return ptr;
}


x86 assembly (clang, -O0):
<__bound_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <libc_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <__bound_malloc+0x39>
movq   $0x0,-0x8(%rbp)
jmp    116e <__bound_malloc+0x4e>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__bound_new_region@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bound_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0x1,%rdi
call   1040 <libc_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1143 <__bound_malloc+0x23>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <__bound_new_region@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @__bound_malloc(i64 %0, i8* nocapture readnone %1) {
%3 = add i64 %0, 1
%4 = tail call i8* @libc_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @__bound_new_region(i8* %4, i64 %0)
br label %8
8: ; preds = %2, %6
ret i8* %4
}
int maximum(int y, int x) { return (y > 25 - x) ? y : 25 - x; }


x86 assembly (clang, -O0):
<maximum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x19,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jle    1128 <maximum+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <maximum+0x33>
mov    $0x19,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximum>:
mov    $0x19,%eax
sub    %esi,%eax
cmp    %edi,%eax
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @maximum(i32 %0, i32 %1) {
%3 = sub nsw i32 25, %1
%4 = icmp slt i32 %3, %0
%5 = select i1 %4, i32 %0, i32 %3
ret i32 %5
}
/* Variables and functions */
char *concat(char *, char const *, char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
char *xstrdup(char const *);
char *concat_and_free(char *orig, const char *delim, const char *new_line) {
  char *ret;
  if (!orig)
    ret = xstrdup(new_line);
  else
    ret = concat(orig, delim, new_line, NULL);
  free(orig);
  return ret;
}


x86 assembly (clang, -O0):
<concat_and_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1161 <concat_and_free+0x31>
mov    -0x18(%rbp),%rdi
call   1050 <xstrdup@plt>
mov    %rax,-0x20(%rbp)
jmp    117a <concat_and_free+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <concat@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat_and_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdi,%rdi
je     1148 <concat_and_free+0x18>
mov    %rbx,%rdi
xor    %ecx,%ecx
call   1040 <concat@plt>
jmp    1150 <concat_and_free+0x20>
mov    %rdx,%rdi
call   1050 <xstrdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @concat_and_free(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i8* @xstrdup(i8* %2)
br label %9
7: ; preds = %3
%8 = tail call i8* @concat(i8* %0, i8* %1, i8* %2, i32* null)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %8, %7 ], [ %6, %5 ]
%11 = tail call i32 @free(i8* %0)
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ DisplayUsage();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void DisplayInvalidParameter(char *param) {
  fprintf(stderr, "insert_region: Parameter %s is invalid.\n", param);
  DisplayUsage();
}


x86 assembly (clang, -O0):
<DisplayInvalidParameter>:
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    $0x0,%al
call   1040 <DisplayUsage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplayInvalidParameter>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <DisplayUsage@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"insert_region: Parameter %s is invalid.\0A\00"
define void @DisplayInvalidParameter(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 ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @DisplayUsage()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"insert_region: Parameter %s is invalid.\0A\00"
define void @DisplayInvalidParameter(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @DisplayUsage()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_OPEN_MAX;
int /*<<< orphan*/ printf(char *, long);
long sysconf(int /*<<< orphan*/);
int main() {
  long open_max = sysconf(_SC_OPEN_MAX);
  printf("%ld\n", open_max);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@_SC_OPEN_MAX = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = load i32, i32* @_SC_OPEN_MAX
%3 = call i64 @sysconf(i32 %2)
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@_SC_OPEN_MAX = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = load i32, i32* @_SC_OPEN_MAX
%2 = tail call i64 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
__attribute__((always_)) void _tu_clear(void) { system("clear"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
define void @_tu_clear() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @_tu_clear() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void IntIfClkAutoGateSet(void) {
  (*((volatile unsigned int *)((0x48200000) + (0x10)))) |= (0x1);
}


x86 assembly (clang, -O0):
<IntIfClkAutoGateSet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48200010,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x48200010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntIfClkAutoGateSet>:
orl    $0x1,0x48200010
01
ret

LLVM IR (-O0):
define void @IntIfClkAutoGateSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056720 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1210056720 to i32*)
ret void
}

LLVM IR (-O2):
define void @IntIfClkAutoGateSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056720 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1210056720 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lirerr(int);
int strlen(char *);
void blankfill_egrmsg(char *msg) {
  int i;
  i = strlen(msg);
  if (i >= 30)
    lirerr(3413400);
  while (i < 30 - 1) {
    msg[i] = ' ';
    i++;
  }
  msg[30 - 1] = 0;
}


x86 assembly (clang, -O0):
<blankfill_egrmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jl     114c <blankfill_egrmsg+0x2c>
mov    $0x341598,%edi
call   1040 <lirerr@plt>
jmp    1151 <blankfill_egrmsg+0x31>
cmpl   $0x1d,-0xc(%rbp)
jge    1175 <blankfill_egrmsg+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <blankfill_egrmsg+0x31>
mov    -0x8(%rbp),%rax
movb   $0x0,0x1d(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blankfill_egrmsg>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x1e,%eax
jl     114a <blankfill_egrmsg+0x1a>
mov    $0x341598,%edi
call   1050 <lirerr@plt>
jmp    116a <blankfill_egrmsg+0x3a>
cmp    $0x1d,%eax
je     116a <blankfill_egrmsg+0x3a>
movslq %eax,%rdi
add    %rbx,%rdi
mov    $0x1c,%edx
sub    %eax,%edx
add    $0x1,%rdx
mov    $0x20,%esi
call   1040 <memset@plt>
movb   $0x0,0x1d(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @blankfill_egrmsg(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 30
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @lirerr(i32 3413400)
br label %10
10: ; preds = %8, %1
br label %11
11: ; preds = %14, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 29
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 32, i8* %18
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %11
21: ; preds = %11
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 29
store i8 0, i8* %23
ret void
}

LLVM IR (-O2):
define void @blankfill_egrmsg(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 29
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lirerr(i32 3413400)
br label %14
6: ; preds = %1
%7 = icmp eq i32 %2, 29
br i1 %7, label %14, label %8
8: ; preds = %6
%9 = sext i32 %2 to i64
%10 = getelementptr i8, i8* %0, i64 %9
%11 = sub i32 28, %2
%12 = zext i32 %11 to i64
%13 = add nuw nsw i64 %12, 1
br label %14
14: ; preds = %4, %8, %6
%15 = getelementptr inbounds i8, i8* %0, i64 29
store i8 0, i8* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
char *tmx_strerr();
void tmx_perror(const char *pos) {
  const char *msg = tmx_strerr();
  fprintf(stderr, "%s: %s\n", pos, msg);
}


x86 assembly (clang, -O0):
<tmx_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <tmx_strerr@plt>
mov    %rax,-0x10(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmx_perror>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <tmx_strerr@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%edi
lea    0xec5(%rip),%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
pop    %rbx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @tmx_perror(i8* %0) {
%2 = tail call i8* (...) @tmx_strerr()
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2)
ret void
}
int isUpper(char *i) {
  switch (*i) {
  case 'A':
  case 'B':
  case 'C':
  case 'D':
  case 'E':
  case 'F':
  case 'G':
  case 'H':
  case 'I':
  case 'J':
  case 'K':
  case 'L':
  case 'M':
  case 'N':
  case 'O':
  case 'P':
  case 'Q':
  case 'R':
  case 'S':
  case 'T':
  case 'U':
  case 'V':
  case 'W':
  case 'X':
  case 'Y':
  case 'Z':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isUpper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffbf,%eax
sub    $0x19,%eax
ja     112c <isUpper+0x2c>
jmp    1120 <isUpper+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1133 <isUpper+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUpper>:
movsbl (%rdi),%ecx
add    $0xffffffbf,%ecx
xor    %eax,%eax
cmp    $0x1a,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isUpper(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
switch i32 %6, label %8 [
i32 65, label %7
i32 66, label %7
i32 67, label %7
i32 68, label %7
i32 69, label %7
i32 70, label %7
i32 71, label %7
i32 72, label %7
i32 73, label %7
i32 74, label %7
i32 75, label %7
i32 76, label %7
i32 77, label %7
i32 78, label %7
i32 79, label %7
i32 80, label %7
i32 81, label %7
i32 82, label %7
i32 83, label %7
i32 84, label %7
i32 85, label %7
i32 86, label %7
i32 87, label %7
i32 88, label %7
i32 89, label %7
i32 90, label %7
]
7: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @isUpper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -65
%5 = icmp ult i32 %4, 26
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
void multimap_failed(char *, char *, int);
void *realloc(void *, size_t);
void *multimap_realloc(void *data, size_t size) {
  ((size) ? ((void)0)
          : multimap_failed("size",
                            "/scratch/repos/new/home/jordi_armengol_estape/"
                            "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                            "tregon/multimap/refs/heads/develop/src/malloc.c",
                            42));
  return realloc(data, size);
}


x86 assembly (clang, -O0):
<multimap_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <multimap_realloc+0x20>
jmp    1158 <multimap_realloc+0x38>
lea    0xeb9(%rip),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x2a,%edx
call   1030 <multimap_failed@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multimap_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
jne    1147 <multimap_realloc+0x27>
lea    0xeca(%rip),%rdi
lea    0xec8(%rip),%rsi
mov    $0x2a,%edx
call   1030 <multimap_failed@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <realloc@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"size\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tregon/multimap/refs/heads/develop/src/malloc.c\00"
define i8* @multimap_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %9
8: ; preds = %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i8* @realloc(i8* %10, i64 %11)
ret i8* %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"size\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tregon/multimap/refs/heads/develop/src/malloc.c\00"
define noalias i8* @multimap_realloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @multimap_failed(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 42)
br label %5
5: ; preds = %2, %4
%6 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %6
}
void init_add_rel_mask_color_span_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_add_rel_mask_color_span_funcs_c() {
ret void
}
void DUMP(void) {}


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

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

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

LLVM IR (-O2):
define void @DUMP() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_39() {
  Assert_real((isqrt(39) == 6),
              "/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/stdlib/isqrt.c",
              200, ("Integer square root of 39 should be 6"));
}


x86 assembly (clang, -O0):
<t_sqrt_39>:
push   %rbp
mov    %rsp,%rbp
mov    $0x27,%edi
call   1030 <isqrt@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xc8,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_39>:
push   %rax
mov    $0x27,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xc8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 39 should be 6\00"
define void @t_sqrt_39() {
%1 = call i32 @isqrt(i32 39)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 200, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 39 should be 6\00"
define void @t_sqrt_39() {
%1 = tail call i32 @isqrt(i32 39)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 200, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct udphdr {
  int /*<<< orphan*/ source;
};

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t _udphdr_source_ntohs(struct udphdr *h) { return ntohs(h->source); }


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

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

LLVM IR (-O0):
%struct.udphdr = type { i32 }
define i32 @_udphdr_source_ntohs(%struct.udphdr* %0) {
%2 = alloca %struct.udphdr*
store %struct.udphdr* %0, %struct.udphdr** %2
%3 = load %struct.udphdr*, %struct.udphdr** %2
%4 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.udphdr = type { i32 }
define i32 @_udphdr_source_ntohs(%struct.udphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ allocateBuffer();
int /*<<< orphan*/ copyOut();
int /*<<< orphan*/ getoptions(int, char **);
int main(int argc, char **argv) {
  char *buffer;
  getoptions(argc, argv);
  allocateBuffer();
  copyOut();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <getoptions@plt>
mov    $0x0,%al
call   1050 <allocateBuffer@plt>
mov    $0x0,%al
call   1040 <copyOut@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @getoptions(i32 %6, i8** %7)
%9 = call i32 (...) @allocateBuffer()
%10 = call i32 (...) @copyOut()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getoptions(i32 %0, i8** %1)
%4 = tail call i32 (...) @allocateBuffer()
%5 = tail call i32 (...) @copyOut()
ret i32 0
}
int fcmpge(float a, float b) { return a >= b; }


x86 assembly (clang, -O0):
<fcmpge>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmpge>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @fcmpge(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 = fcmp oge float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @fcmpge(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void ARGBToRGB565() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB565() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TerminalNewMode(int);
void setcommandmode() { TerminalNewMode(-1); }


x86 assembly (clang, -O0):
<setcommandmode>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <TerminalNewMode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setcommandmode>:
mov    $0xffffffff,%edi
jmp    1030 <TerminalNewMode@plt>

LLVM IR (-O0):
define void @setcommandmode() {
%1 = call i32 @TerminalNewMode(i32 -1)
ret void
}

LLVM IR (-O2):
define void @setcommandmode() {
%1 = tail call i32 @TerminalNewMode(i32 -1)
ret void
}
int port_num_digit(int port) {
  int num_digit = 0;
  int i = 0;
  i = port;
  for (num_digit = 0;; num_digit++) {
    if (i / 10 != 0)
      i = i / 10;
    else
      break;
  }
  num_digit += 1;
  return num_digit;
}


x86 assembly (clang, -O0):
<port_num_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1149 <port_num_digit+0x49>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    114e <port_num_digit+0x4e>
jmp    1161 <port_num_digit+0x61>
jmp    1153 <port_num_digit+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <port_num_digit+0x22>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_num_digit>:
lea    0x9(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x13,%ecx
jb     1145 <port_num_digit+0x45>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <port_num_digit+0x20>
ret

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

LLVM IR (-O2):
define i32 @port_num_digit(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 1, %1 ]
%7 = sdiv i32 %5, 10
%8 = add i32 %6, 1
%9 = add nsw i32 %7, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
int https_init(const char *certfile) { return -6; }


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

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

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

LLVM IR (-O2):
define i32 @https_init(i8* nocapture readnone %0) {
ret i32 -6
}
int clean_array_long(long *buffer, int num_bytes) {
  int i = 0;
  for (; i < num_bytes; i++)
    buffer[i] = 0L;
  return 0;
}


x86 assembly (clang, -O0):
<clean_array_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <clean_array_long+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clean_array_long+0x12>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_array_long>:
test   %esi,%esi
jle    1126 <clean_array_long+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @clean_array_long(i64* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i64* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rfc4175_get_line_field_id(const uint8_t *buf) { return buf[2] >> 7; }


x86 assembly (clang, -O0):
<rfc4175_get_line_field_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
sar    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc4175_get_line_field_id>:
mov    0x8(%rdi),%eax
sar    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @rfc4175_get_line_field_id(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = ashr i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @rfc4175_get_line_field_id(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 7
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ asin(int);
int /*<<< orphan*/ calcObliquityCorrection(double);
int /*<<< orphan*/ calcSunApparentLong(double);
int /*<<< orphan*/ deg2rad(int /*<<< orphan*/);
double rad2deg(int /*<<< orphan*/);
int sin(int /*<<< orphan*/);
double calcSunDeclination(double t) {
  return rad2deg(asin(sin(deg2rad(calcObliquityCorrection(t))) *
                      sin(deg2rad(calcSunApparentLong(t)))));
}


x86 assembly (clang, -O0):
<calcSunDeclination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <calcObliquityCorrection@plt>
mov    %eax,%edi
call   1040 <deg2rad@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1080 <calcSunApparentLong@plt>
mov    %eax,%edi
call   1040 <deg2rad@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mov    -0xc(%rbp),%edi
imul   %eax,%edi
call   1060 <asin@plt>
mov    %eax,%edi
call   1070 <rad2deg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcSunDeclination>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <calcObliquityCorrection@plt>
mov    %eax,%edi
call   1040 <deg2rad@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1080 <calcSunApparentLong@plt>
mov    %eax,%edi
call   1040 <deg2rad@plt>
mov    %eax,%edi
call   1050 <sin@plt>
imul   %eax,%ebx
mov    %ebx,%edi
call   1060 <asin@plt>
mov    %eax,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1070 <rad2deg@plt>

LLVM IR (-O0):
define double @calcSunDeclination(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @calcObliquityCorrection(double %3)
%5 = call i32 @deg2rad(i32 %4)
%6 = call i32 @sin(i32 %5)
%7 = load double, double* %2
%8 = call i32 @calcSunApparentLong(double %7)
%9 = call i32 @deg2rad(i32 %8)
%10 = call i32 @sin(i32 %9)
%11 = mul nsw i32 %6, %10
%12 = call i32 @asin(i32 %11)
%13 = call double @rad2deg(i32 %12)
ret double %13
}

LLVM IR (-O2):
define double @calcSunDeclination(double %0) {
%2 = tail call i32 @calcObliquityCorrection(double %0)
%3 = tail call i32 @deg2rad(i32 %2)
%4 = tail call i32 @sin(i32 %3)
%5 = tail call i32 @calcSunApparentLong(double %0)
%6 = tail call i32 @deg2rad(i32 %5)
%7 = tail call i32 @sin(i32 %6)
%8 = mul nsw i32 %7, %4
%9 = tail call i32 @asin(i32 %8)
%10 = tail call double @rad2deg(i32 %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(int, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *m1_malloc(size_t size) {
  void *mem = calloc(1, size);
  if (mem == NULL) {
    fprintf(stderr, "Failed to allocate mem!\n");
    exit(EXIT_FAILURE);
  }
  return mem;
}


x86 assembly (clang, -O0):
<m1_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117c <m1_malloc+0x4c>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m1_malloc>:
push   %rax
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
test   %rax,%rax
je     1145 <m1_malloc+0x15>
pop    %rcx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Failed to allocate mem!\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @m1_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Failed to allocate mem!\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @m1_malloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int ioctl(int, unsigned int, int *);
int get_sector_size(int filedes) {
  int rc, sector_size = 512;
  rc = ioctl(filedes,
             (((0U) << (((0 + 8) + 8) + 14)) | (((0x12)) << (0 + 8)) |
              (((104)) << 0) | ((0) << ((0 + 8) + 8))),
             &sector_size);
  if (rc)
    sector_size = 512;
  return sector_size;
}


x86 assembly (clang, -O0):
<get_sector_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x200,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1268,%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1147 <get_sector_size+0x37>
movl   $0x200,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sector_size>:
push   %rax
movl   $0x200,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x1268,%esi
call   1030 <ioctl@plt>
mov    %eax,%ecx
mov    $0x200,%eax
test   %ecx,%ecx
jne    1137 <get_sector_size+0x27>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_sector_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 512, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @ioctl(i32 %5, i32 4712, i32* %4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 512, i32* %4
br label %10
10: ; preds = %9, %1
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_sector_size(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 512, i32* %2
%4 = call i32 @ioctl(i32 %0, i32 4712, i32* %2)
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 512
ret i32 %7
}
void av_mdct_calc() {}


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

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

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

LLVM IR (-O2):
define void @av_mdct_calc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
int main(int argc, char **argv) {
  foo(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @foo(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ errno;
double xstrtod(char *, char **, char, char, int);
int to_double(char *item, double *p_value, char sci, char decimal) {
  char *p_end;
  *p_value = xstrtod(item, &p_end, decimal, sci, 1);
  return (errno == 0) && (!*p_end);
}


x86 assembly (clang, -O0):
<to_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x12(%rbp),%al
lea    -0x20(%rbp),%rsi
mov    $0x1,%r8d
movsbl %al,%edx
movsbl -0x11(%rbp),%ecx
call   1030 <xstrtod@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
mov    0x2e88(%rip),%rcx
cmpq   $0x0,(%rcx)
mov    %al,-0x21(%rbp)
jne    1174 <to_double+0x64>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_double>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%eax
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    %ecx,%edx
mov    %eax,%ecx
mov    $0x1,%r8d
call   1030 <xstrtod@plt>
movsd  %xmm0,(%rbx)
mov    0x2ea7(%rip),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
jne    114e <to_double+0x3e>
mov    0x8(%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
define i32 @to_double(i8* %0, double* %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca double*
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
store i8* %0, i8** %5
store double* %1, double** %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = load i8*, i8** %5
%11 = load i8, i8* %8
%12 = load i8, i8* %7
%13 = call double @xstrtod(i8* %10, i8** %9, i8 signext %11, i8 signext %12, i32 1)
%14 = load double*, double** %6
store double %13, double* %14
%15 = load i64, i64* @errno
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %4
%18 = load i8*, i8** %9
%19 = load i8, i8* %18
%20 = icmp ne i8 %19, 0
%21 = xor i1 %20, true
br label %22
22: ; preds = %17, %4
%23 = phi i1 [ false, %4 ], [ %21, %17 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @to_double(i8* %0, double* nocapture writeonly %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = call double @xstrtod(i8* %0, i8** %5, i8 signext %3, i8 signext %2, i32 1)
store double %7, double* %1
%8 = load i64, i64* @errno
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %4
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %10, %4
%16 = phi i32 [ 0, %4 ], [ %14, %10 ]
ret i32 %16
}
void delay(int usecs) { return; }


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

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
void gui_notifyVarChange(const char *name, const char *value) { return; }


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

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

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

LLVM IR (-O2):
define void @gui_notifyVarChange(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int add_one(int i) { return i + 1; }


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

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

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

LLVM IR (-O2):
define i32 @add_one(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}