xunge/DecIR huggingface dataset:
/* Variables and functions */
const char *read_until(const char *s, char tk) {
  while (*s != tk)
    if (!*s)
      return NULL;
    else
      ++s;
  return s;
}


x86 assembly (clang, -O0):
<read_until>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     114c <read_until+0x4c>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113b <read_until+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1154 <read_until+0x54>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <read_until+0xe>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_until>:
mov    %rdi,%rax
mov    (%rdi),%cl
cmp    %sil,%cl
je     1121 <read_until+0x21>
nopw   0x0(%rax,%rax,1)
test   %cl,%cl
je     1122 <read_until+0x22>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %sil,%cl
jne    1110 <read_until+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @read_until(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8 [ %11, %9 ], [ %3, %2 ]
%7 = phi i8* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i8 %6, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i8* [ %0, %2 ], [ %10, %9 ], [ null, %5 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x57() {
  Assert_real((isxdigit(87) == 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_isxdigit.c",
              440, ("isxdigit should be 0 for W"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x57>:
push   %rax
mov    $0x57,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1b8,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for W\00"
define void @t_isxdigit_0x57() {
%1 = call i64 @isxdigit(i32 87)
%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 440, i8* getelementptr inbounds ([27 x i8], [27 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for W\00"
define void @t_isxdigit_0x57() {
%1 = tail call i64 @isxdigit(i32 87)
%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 440, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void h_to_le32(uint32_t val32, void *dest) {
  uint8_t *b = dest;
  b[0] = (val32 >> 0) & 0xff;
  b[1] = (val32 >> 8) & 0xff;
  b[2] = (val32 >> 16) & 0xff;
  b[3] = (val32 >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<h_to_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_to_le32>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,(%rsi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rsi)
mov    %edi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rsi)
shr    $0x18,%eax
mov    %eax,0xc(%rsi)
ret

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

LLVM IR (-O2):
define void @h_to_le32(i32 %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
%4 = and i32 %0, 255
store i32 %4, i32* %3
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i8, i8* %1, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = lshr i32 %0, 16
%10 = and i32 %9, 255
%11 = getelementptr inbounds i8, i8* %1, i64 8
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
%13 = lshr i32 %0, 24
%14 = getelementptr inbounds i8, i8* %1, i64 12
%15 = bitcast i8* %14 to i32*
store i32 %13, i32* %15
ret void
}
unsigned int asIEEE32BitWord(float val) {
  union {
    float input;
    unsigned int output;
  } data;
  data.input = val;
  return data.output;
}


x86 assembly (clang, -O0):
<asIEEE32BitWord>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asIEEE32BitWord>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @asIEEE32BitWord(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @asIEEE32BitWord(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int sys__gettid();
int sys_getpid();
pid_t sys_gettid() {
  pid_t tid = sys__gettid();
  if (tid != -1) {
    return tid;
  }
  return sys_getpid();
}


x86 assembly (clang, -O0):
<sys_gettid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <sys__gettid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1147 <sys_gettid+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <sys_gettid+0x31>
mov    $0x0,%al
call   1030 <sys_getpid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_gettid>:
push   %rax
xor    %eax,%eax
call   1040 <sys__gettid@plt>
cmp    $0xffffffff,%eax
je     112f <sys_gettid+0xf>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <sys_getpid@plt>

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

LLVM IR (-O2):
define i32 @sys_gettid() {
%1 = tail call i32 (...) @sys__gettid()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @sys_getpid()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ HandleInterrupt(int /*<<< orphan*/);
void INT_P0(void) { HandleInterrupt(0); }


x86 assembly (clang, -O0):
<INT_P0>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <HandleInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_P0>:
xor    %edi,%edi
jmp    1030 <HandleInterrupt@plt>

LLVM IR (-O0):
define void @INT_P0() {
%1 = call i32 @HandleInterrupt(i32 0)
ret void
}

LLVM IR (-O2):
define void @INT_P0() {
%1 = tail call i32 @HandleInterrupt(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void *e_realloc(void *ptr, size_t size) {
  void *a = realloc(ptr, size);
  if (a == NULL) {
    fprintf(stderr, "Error: realloc: %s\n", strerror(errno));
    exit(1);
  }
  return a;
}


x86 assembly (clang, -O0):
<e_realloc>:
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   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11a2 <e_realloc+0x62>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    %rax,%rdx
lea    0xe6d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_realloc>:
push   %rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     114d <e_realloc+0xd>
pop    %rbx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%ebx
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe95(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Error: realloc: %s\0A\00"
@errno = global i32 0
define i8* @e_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* @errno
%14 = call i8* @strerror(i32 %13)
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Error: realloc: %s\0A\00"
@errno = global i32 0
define noalias i8* @e_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = tail call i8* @strerror(i32 %7)
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret i8* %3
}
double printf_int_to_float(int t) {
  float float_tmp;
  double double_tmp;
  if (sizeof(t) == sizeof(float)) {
    memcpy(&float_tmp, &t, sizeof(t));
    double_tmp = float_tmp;
  } else {
    memcpy(&double_tmp, &t, sizeof(t));
  }
  return double_tmp;
}


x86 assembly (clang, -O0):
<printf_int_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_int_to_float>:
movd   %edi,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @printf_int_to_float(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca double
store i32 %0, i32* %2
%5 = bitcast float* %3 to i8*
%6 = bitcast i32* %2 to i8*
%7 = load float, float* %3
%8 = fpext float %7 to double
store double %8, double* %4
%9 = load double, double* %4
ret double %9
}

LLVM IR (-O2):
define double @printf_int_to_float(i32 %0) {
%2 = bitcast i32 %0 to float
%3 = fpext float %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ EPOLL_CLOEXEC;
int epoll_create1(int /*<<< orphan*/);
int errno;
int shl_pty_bridge_new(void) {
  int fd;
  fd = epoll_create1(EPOLL_CLOEXEC);
  if (fd < 0)
    return -errno;
  return fd;
}


x86 assembly (clang, -O0):
<shl_pty_bridge_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <epoll_create1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1146 <shl_pty_bridge_new+0x36>
xor    %eax,%eax
mov    0x2e9c(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <shl_pty_bridge_new+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_pty_bridge_new>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <epoll_create1@plt>
mov    0x2eb2(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovs  %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EPOLL_CLOEXEC = global i32 0
@errno = global i32 0
define i32 @shl_pty_bridge_new() {
%1 = load i32, i32* @EPOLL_CLOEXEC
%2 = tail call i32 @epoll_create1(i32 %1)
%3 = icmp slt i32 %2, 0
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 %5, i32 %2
ret i32 %6
}
/* Variables and functions */
int vle_compl_add_match(char const *);
int vle_compl_add_last_match(const char origin[]) {
  return vle_compl_add_match(origin);
}


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

x86 assembly (clang, -O2):
<vle_compl_add_last_match>:
jmp    1030 <vle_compl_add_match@plt>

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

LLVM IR (-O2):
define i32 @vle_compl_add_last_match(i8* %0) {
%2 = tail call i32 @vle_compl_add_match(i8* %0)
ret i32 %2
}
backoff(n) int n;
{
  if (n <= 4)
    return 1 << n;
  else
    return n * n;
}


x86 assembly (clang, -O0):
<backoff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jg     1123 <backoff+0x23>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <backoff+0x2d>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<backoff>:
mov    %edi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edi,%eax
imul   %edi,%eax
cmp    $0x5,%edi
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @backoff(i32 %0) {
%2 = icmp slt i32 %0, 5
%3 = shl nuw i32 1, %0
%4 = mul nsw i32 %0, %0
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
int ft_isspace(int c) {
  if (c == ' ' || c == '\t' || c == '\n')
    return (1);
  else if (c == '\v' || c == '\f' || c == '\r')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     1125 <ft_isspace+0x25>
cmpl   $0x9,-0x8(%rbp)
je     1125 <ft_isspace+0x25>
cmpl   $0xa,-0x8(%rbp)
jne    1131 <ft_isspace+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1162 <ft_isspace+0x62>
cmpl   $0xb,-0x8(%rbp)
je     114f <ft_isspace+0x4f>
cmpl   $0xc,-0x8(%rbp)
je     114f <ft_isspace+0x4f>
cmpl   $0xd,-0x8(%rbp)
jne    115b <ft_isspace+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <ft_isspace+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isspace>:
cmp    $0x20,%edi
ja     111d <ft_isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111d <ft_isspace+0x1d>
ret
add    $0xfffffff5,%edi
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %6
i32 10, label %6
i32 9, label %6
]
2: ; preds = %1
%3 = add i32 %0, -11
%4 = icmp ult i32 %3, 3
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %2, %1, %1, %1
%7 = phi i32 [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ %5, %2 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ waddch(int /*<<< orphan*/ *, char);
int seperator(WINDOW *pad, int compact) {
  if (compact)
    return 0;
  waddch(pad, '\n');
  return 1;
}


x86 assembly (clang, -O0):
<seperator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1135 <seperator+0x25>
movl   $0x0,-0x4(%rbp)
jmp    114a <seperator+0x3a>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <waddch@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seperator>:
xor    %eax,%eax
test   %esi,%esi
je     1117 <seperator+0x7>
ret
push   %rax
mov    $0xa,%esi
call   1030 <waddch@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @seperator(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @waddch(i32* %0, i8 signext 10)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
unsigned long sysfs_get_transitions(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @sysfs_get_transitions(i32 %0) {
ret i64 0
}
/* Variables and functions */
int Game_scale(int);
int on(unsigned int lev) {
  int perlevel = (int)((8 + 3 * lev) * Game_scale(2));
  return ((perlevel) < (100) ? (perlevel) : (100));
}


x86 assembly (clang, -O0):
<on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
call   1030 <Game_scale@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    114f <on+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    115c <on+0x4c>
mov    $0x64,%eax
mov    %eax,-0x10(%rbp)
jmp    115c <on+0x4c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on>:
push   %rbx
lea    (%rdi,%rdi,2),%ebx
add    $0x8,%ebx
mov    $0x2,%edi
call   1030 <Game_scale@plt>
imul   %ebx,%eax
cmp    $0x64,%eax
mov    $0x64,%ecx
cmovge %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @on(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul i32 3, %4
%6 = add i32 8, %5
%7 = call i32 @Game_scale(i32 2)
%8 = mul i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %3
br label %14
13: ; preds = %1
br label %14
14: ; preds = %13, %11
%15 = phi i32 [ %12, %11 ], [ 100, %13 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @on(i32 %0) {
%2 = mul i32 %0, 3
%3 = add i32 %2, 8
%4 = tail call i32 @Game_scale(i32 2)
%5 = mul i32 %4, %3
%6 = icmp slt i32 %5, 100
%7 = select i1 %6, i32 %5, i32 100
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ VirtualizeTimerC__0__Timer__stop(unsigned int);
void NodeApp__ResendTimer__stop(void) { VirtualizeTimerC__0__Timer__stop(1U); }


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

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

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

LLVM IR (-O2):
define void @NodeApp__ResendTimer__stop() {
%1 = tail call i32 @VirtualizeTimerC__0__Timer__stop(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, float);
int /*<<< orphan*/ stderr;
void print_float(float m) { fprintf(stderr, "%f", m); }


x86 assembly (clang, -O0):
<print_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
movss  -0x4(%rbp),%xmm0
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%f\00"
define void @print_float(float %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
int xglobWeak(int i) { return i * 2; }


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

x86 assembly (clang, -O2):
<xglobWeak>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @xglobWeak(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void Exit_ASA(char *statement) { ; }


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

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

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

LLVM IR (-O2):
define void @Exit_ASA(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f1() { printf("hello world\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define void @f1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define void @f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int log(double);
int ilog2(int x) { return log(x) / log(2.0); }


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
call   1030 <log@plt>
mov    %eax,-0x8(%rbp)
movsd  0xed0(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog2>:
push   %rbx
cvtsi2sd %edi,%xmm0
call   1030 <log@plt>
mov    %eax,%ebx
movsd  0xedc(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ilog2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call i32 @log(double %4)
%6 = call i32 @log(double 2.000000e+00)
%7 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call i32 @log(double %2)
%4 = tail call i32 @log(double 2.000000e+00)
%5 = sdiv i32 %3, %4
ret i32 %5
}
/* Variables and functions */
bool nrf52_errata_196(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_196() {
ret i32 0
}
/* Variables and functions */
int endwin();
int wrap_endwin(void) { return endwin(); }


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

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

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

LLVM IR (-O2):
define i32 @wrap_endwin() {
%1 = tail call i32 (...) @endwin()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int draw_frame(unsigned char *src[]) {
  printf("draw_frame() called!!!!!!");
  return -1;
}


x86 assembly (clang, -O0):
<draw_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"draw_frame() called!!!!!!\00"
define i32 @draw_frame(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [26 x i8] c"draw_frame() called!!!!!!\00"
define i32 @draw_frame(i8** nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int base_th(int pid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @base_th(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int write_i2c_reg(int, int, int /*<<< orphan*/);
int piups_set_vrailconv(int file_i2c, uint16_t vrailconv) {
  return write_i2c_reg(file_i2c, 0x52, vrailconv);
}


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

x86 assembly (clang, -O2):
<piups_set_vrailconv>:
mov    %esi,%edx
mov    $0x52,%esi
jmp    1030 <write_i2c_reg@plt>

LLVM IR (-O0):
define i32 @piups_set_vrailconv(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @write_i2c_reg(i32 %5, i32 82, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @piups_set_vrailconv(i32 %0, i32 %1) {
%3 = tail call i32 @write_i2c_reg(i32 %0, i32 82, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *ultoa(long, char *, int);
char *ltoa(long val, char *buf, int radix) {
  if (val >= 0) {
    return ultoa(val, buf, radix);
  } else {
    buf[0] = '-';
    ultoa(-val, buf + 1, radix);
    return buf;
  }
}


x86 assembly (clang, -O0):
<ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1147 <ltoa+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <ultoa@plt>
mov    %rax,-0x8(%rbp)
jmp    116e <ltoa+0x5e>
mov    -0x18(%rbp),%rax
movb   $0x2d,(%rax)
xor    %eax,%eax
mov    %eax,%edi
sub    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <ultoa@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoa>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
js     1122 <ltoa+0x12>
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <ultoa@plt>
movb   $0x2d,(%rbx)
neg    %rdi
lea    0x1(%rbx),%rsi
call   1030 <ultoa@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = icmp sgt i64 %0, -1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i8* @ultoa(i64 %0, i8* %1, i32 %2)
br label %11
7: ; preds = %3
store i8 45, i8* %1
%8 = sub nsw i64 0, %0
%9 = getelementptr inbounds i8, i8* %1, i64 1
%10 = tail call i8* @ultoa(i64 %8, i8* %9, i32 %2)
br label %11
11: ; preds = %7, %5
%12 = phi i8* [ %6, %5 ], [ %1, %7 ]
ret i8* %12
}
/* Variables and functions */
void *strdup(char *);
extern void *ReturnSomePointer() {
  return strdup("Got passed back the pointer I returned");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Got passed back the pointer I returned\00"
define i8* @ReturnSomePointer() {
%1 = call i8* @strdup(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [39 x i8] c"Got passed back the pointer I returned\00"
define noalias i8* @ReturnSomePointer() {
%1 = tail call dereferenceable_or_null(39) i8* @strdup(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int DocumentDistance_popcnt3(int, unsigned char const *, unsigned char const *,
                             unsigned char const *);
int DocumentDistance(int sigwidth, const unsigned char *in_bsig,
                     const unsigned char *in_bmask,
                     const unsigned char *in_dsig) {
  return DocumentDistance_popcnt3(sigwidth, in_bsig, in_bmask, in_dsig);
}


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

x86 assembly (clang, -O2):
<DocumentDistance>:
jmp    1030 <DocumentDistance_popcnt3@plt>

LLVM IR (-O0):
define i32 @DocumentDistance(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
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @DocumentDistance_popcnt3(i32 %9, i8* %10, i8* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @DocumentDistance(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @DocumentDistance_popcnt3(i32 %0, i8* %1, i8* %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *grt_dynload_symbol(void *handle, const char *symbol) {
  return dlsym(handle, symbol);
}


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

x86 assembly (clang, -O2):
<grt_dynload_symbol>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @grt_dynload_symbol(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ target;
};
typedef TYPE_1__ XSelectionRequestEvent;

/* Variables and functions */
unsigned long get_XSelectionRequestEvent_target(void *_p) {
  return (unsigned long)((XSelectionRequestEvent *)_p)->target;
}


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

x86 assembly (clang, -O2):
<get_XSelectionRequestEvent_target>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XSelectionRequestEvent_target(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XSelectionRequestEvent_target(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct subpolygon {
  int dummy;
};

/* Variables and functions */
scalar_t__ error();
int /*<<< orphan*/ free_object(int, short *);
void free_subpolygon(struct subpolygon *spg) {
  free_object(53, (short *)spg);
  if (error())
    return;
}


x86 assembly (clang, -O0):
<free_subpolygon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x35,%edi
call   1030 <free_object@plt>
mov    $0x0,%al
call   1040 <error@plt>
cmp    $0x0,%rax
je     1150 <free_subpolygon+0x30>
jmp    1150 <free_subpolygon+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_subpolygon>:
push   %rax
mov    %rdi,%rsi
mov    $0x35,%edi
call   1030 <free_object@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <error@plt>

LLVM IR (-O0):
%struct.subpolygon = type { i32 }
define void @free_subpolygon(%struct.subpolygon* %0) {
%2 = alloca %struct.subpolygon*
store %struct.subpolygon* %0, %struct.subpolygon** %2
%3 = load %struct.subpolygon*, %struct.subpolygon** %2
%4 = bitcast %struct.subpolygon* %3 to i16*
%5 = call i32 @free_object(i32 53, i16* %4)
%6 = call i64 (...) @error()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.subpolygon = type { i32 }
define void @free_subpolygon(%struct.subpolygon* %0) {
%2 = bitcast %struct.subpolygon* %0 to i16*
%3 = tail call i32 @free_object(i32 53, i16* %2)
%4 = tail call i64 (...) @error()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int /*<<< orphan*/ h();
void foo() {
  f();
  g();
  h();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <f@plt>
mov    $0x0,%al
call   1050 <g@plt>
mov    $0x0,%al
call   1030 <h@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
xor    %eax,%eax
call   1050 <g@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <h@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 (...) @f()
%2 = call i32 (...) @g()
%3 = call i32 (...) @h()
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @g()
%3 = tail call i32 (...) @h()
ret void
}
/* Variables and functions */
int anetReadWidthType(int, char *, int, int, int);
int catAnetBlockReadTime(int fd, char *buf, int count, int waitMs) {
  return anetReadWidthType(fd, buf, count, 2, waitMs);
}


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

x86 assembly (clang, -O2):
<catAnetBlockReadTime>:
mov    %ecx,%r8d
mov    $0x2,%ecx
jmp    1030 <anetReadWidthType@plt>

LLVM IR (-O0):
define i32 @catAnetBlockReadTime(i32 %0, i8* %1, i32 %2, i32 %3) {
%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
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @anetReadWidthType(i32 %9, i8* %10, i32 %11, i32 2, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @catAnetBlockReadTime(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @anetReadWidthType(i32 %0, i8* %1, i32 %2, i32 2, i32 %3)
ret i32 %5
}
/* Variables and functions */
bool checkDigit(char charToCheck) {
  return (charToCheck >= '0' && charToCheck <= '9');
}


x86 assembly (clang, -O0):
<checkDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <checkDigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @checkDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @checkDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int atoi(char const *);
char *om_gsm_flowcontrol_path();
char *om_sysfs_readfile(char const *);
int om_gsm_flowcontrol_get() {
  const char *path = om_gsm_flowcontrol_path();
  if (path == NULL)
    return -1;
  const char *val = om_sysfs_readfile(path);
  if (val == NULL)
    return -1;
  return atoi(val);
}


x86 assembly (clang, -O0):
<om_gsm_flowcontrol_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <om_gsm_flowcontrol_path@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <om_gsm_flowcontrol_get+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <om_gsm_flowcontrol_get+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <om_sysfs_readfile@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117e <om_gsm_flowcontrol_get+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <om_gsm_flowcontrol_get+0x5a>
mov    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_gsm_flowcontrol_get>:
push   %rax
xor    %eax,%eax
call   1040 <om_gsm_flowcontrol_path@plt>
test   %rax,%rax
je     1153 <om_gsm_flowcontrol_get+0x23>
mov    %rax,%rdi
call   1030 <om_sysfs_readfile@plt>
test   %rax,%rax
je     1153 <om_gsm_flowcontrol_get+0x23>
mov    %rax,%rdi
pop    %rax
jmp    1050 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @om_gsm_flowcontrol_get() {
%1 = tail call i8* (...) @om_gsm_flowcontrol_path()
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i8* @om_sysfs_readfile(i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %4)
br label %8
8: ; preds = %6, %3, %0
%9 = phi i32 [ -1, %0 ], [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int /*<<< orphan*/);
void t_isalpha_0x00() {
  Assert_real((isalpha(0) == 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_isalpha.c",
              5, ("isalpha should be 0 for 0x00"));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec2(%rip),%rsi
mov    $0x5,%edx
lea    0xf5e(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %edi,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec8(%rip),%rsi
lea    0xf69(%rip),%rcx
mov    $0x5,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x00\00"
define void @t_isalpha_0x00() {
%1 = call i64 @isalpha(i32 0)
%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 5, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x00\00"
define void @t_isalpha_0x00() {
%1 = tail call i64 @isalpha(i32 0)
%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 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
__attribute__((noreturn)) void f(void) { exit(1); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @f() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 @exit(i32 1)
unreachable
}