xunge/DecIR huggingface dataset:
char *_trim_right(char *str, char *end) {
  if (*str == ' ') {
    *str = '\0';
    if (str == end) {
      return end;
    } else {
      return _trim_right(str - 1, end);
    }
  } else {
    return end;
  }
}


x86 assembly (clang, -O0):
<_trim_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    116c <_trim_right+0x5c>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1152 <_trim_right+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <_trim_right+0x64>
mov    -0x10(%rbp),%rdi
add    $0xffffffffffffffff,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_trim_right@plt>
mov    %rax,-0x8(%rbp)
jmp    1174 <_trim_right+0x64>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_trim_right>:
mov    %rsi,%rax
cmpb   $0x20,(%rdi)
jne    1122 <_trim_right+0x22>
nopl   0x0(%rax,%rax,1)
movb   $0x0,(%rdi)
cmp    %rax,%rdi
je     1122 <_trim_right+0x22>
cmpb   $0x20,-0x1(%rdi)
lea    -0x1(%rdi),%rdi
je     1110 <_trim_right+0x10>
ret

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

LLVM IR (-O2):
define i8* @_trim_right(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 32
br i1 %4, label %8, label %12
5: ; preds = %8
%6 = load i8, i8* %11
%7 = icmp eq i8 %6, 32
br i1 %7, label %8, label %12
8: ; preds = %2, %5
%9 = phi i8* [ %11, %5 ], [ %0, %2 ]
store i8 0, i8* %9
%10 = icmp eq i8* %9, %1
%11 = getelementptr inbounds i8, i8* %9, i64 -1
br i1 %10, label %12, label %5
12: ; preds = %8, %5, %2
ret i8* %1
}
int test_imm_D1uint32_reg(unsigned int val) {
  return ((val) & (0xD1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D1uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D1uint32_reg>:
test   $0xd1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D1uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 209
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_D1uint32_reg(i32 %0) {
%2 = and i32 %0, 209
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int f1(void *x __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f1(i8* nocapture readnone %0) {
ret i32 0
}
int le16(int x) {
  unsigned long test = 0x12345678;
  unsigned char *tp = (unsigned char *)&test;
  if (*tp == 0x78)
    return x;
  else
    return ((x << 8) & 0xff00) | ((x >> 8) & 0x00ff);
}


x86 assembly (clang, -O0):
<le16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movq   $0x12345678,-0x10(%rbp)
12
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x78,%eax
jne    1132 <le16+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <le16+0x4e>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le16>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @le16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
store i32 %0, i32* %3
store i64 305419896, i64* %4
%6 = bitcast i64* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 120
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %21
13: ; preds = %1
%14 = load i32, i32* %3
%15 = shl i32 %14, 8
%16 = and i32 %15, 65280
%17 = load i32, i32* %3
%18 = ashr i32 %17, 8
%19 = and i32 %18, 255
%20 = or i32 %16, %19
store i32 %20, i32* %2
br label %21
21: ; preds = %13, %11
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @le16(i32 returned %0) {
ret i32 %0
}
int test_imm_9Auint8_reg(unsigned char val) {
  return ((val) & (-0x9A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Auint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff66,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Auint8_reg>:
test   $0x66,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Auint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -154
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_9Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 102
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int /*<<< orphan*/, char *, char *, char *, int);
int gmx_setup(int *argc, char **argv, int *nnodes) {
  fatal_error(0, "Routine %s called in %s, %d", "gmx_setup",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/"
              "tests/test_07/network.c",
              182);
  return 0;
}


x86 assembly (clang, -O0):
<gmx_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
lea    0xed3(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xeeb(%rip),%rcx
mov    $0xb6,%r8d
call   1030 <fatal_error@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmx_setup>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xefd(%rip),%rdx
lea    0xf00(%rip),%rcx
xor    %edi,%edi
mov    $0xb6,%r8d
call   1030 <fatal_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Routine %s called in %s, %d\00"
@.str.1 = [10 x i8] c"gmx_setup\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/tests/test_07/network.c\00"
define i32 @gmx_setup(i32* %0, i8** %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32*
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 182)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Routine %s called in %s, %d\00"
@.str.1 = [10 x i8] c"gmx_setup\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/tests/test_07/network.c\00"
define i32 @gmx_setup(i32* nocapture readnone %0, i8** nocapture readnone %1, i32* nocapture readnone %2) {
%4 = tail call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 182)
ret i32 0
}
void nps_ack_gic(void) {}


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

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

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

LLVM IR (-O2):
define void @nps_ack_gic() {
ret void
}
int hash_plugin_hash_length(void) { return 16; }


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

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

LLVM IR (-O0):
define i32 @hash_plugin_hash_length() {
ret i32 16
}

LLVM IR (-O2):
define i32 @hash_plugin_hash_length() {
ret i32 16
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int);
char *xmalloc(int);
const char *gen_raw_code(unsigned int operand) {
  char *ret;
  ret = xmalloc(6);
  snprintf(ret, 6, "@%X", operand);
  return ret;
}


x86 assembly (clang, -O0):
<gen_raw_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x6,%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x6,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_raw_code>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x6,%edi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rdx
mov    %rax,%rdi
mov    $0x6,%esi
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"@%X\00"
define i8* @gen_raw_code(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @xmalloc(i32 6)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* %5, i32 6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"@%X\00"
define i8* @gen_raw_code(i32 %0) {
%2 = tail call i8* @xmalloc(i32 6)
%3 = tail call i32 @snprintf(i8* %2, i32 6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
int isa__9ExceptionFPCc(__0this, __2type)
struct Exception *__0this;
char *__2type;
{ return is__9ExceptionFPCcT1(__0this, __2type, (char *)"Exception"); }


x86 assembly (clang, -O0):
<isa__9ExceptionFPCc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
mov    $0x0,%al
call   1030 <is__9ExceptionFPCcT1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isa__9ExceptionFPCc>:
lea    0xee9(%rip),%rdx
xor    %eax,%eax
jmp    1030 <is__9ExceptionFPCcT1@plt>

LLVM IR (-O0):
%struct.Exception = type opaque
@.str = [10 x i8] c"Exception\00"
define i32 @isa__9ExceptionFPCc(%struct.Exception* %0, i8* %1) {
%3 = alloca %struct.Exception*
%4 = alloca i8*
store %struct.Exception* %0, %struct.Exception** %3
store i8* %1, i8** %4
%5 = load %struct.Exception*, %struct.Exception** %3
%6 = load i8*, i8** %4
%7 = call i32 (%struct.Exception*, i8*, i8*, ...) bitcast (i32 (...)* @is__9ExceptionFPCcT1 to i32 (%struct.Exception*, i8*, i8*, ...)*)(%struct.Exception* %5, i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
%struct.Exception = type opaque
@.str = [10 x i8] c"Exception\00"
define i32 @isa__9ExceptionFPCc(%struct.Exception* %0, i8* %1) {
%3 = tail call i32 (%struct.Exception*, i8*, i8*, ...) bitcast (i32 (...)* @is__9ExceptionFPCcT1 to i32 (%struct.Exception*, i8*, i8*, ...)*)(%struct.Exception* %0, i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
void ExttInvoiceItemsAuxTable(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ sema_init(struct semaphore *, int /*<<< orphan*/);
__attribute__((always_)) void init_MUTEX_LOCKED(struct semaphore *sem) {
  sema_init(sem, 0);
}


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

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

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

LLVM IR (-O2):
%struct.semaphore = type { i32 }
define void @init_MUTEX_LOCKED(%struct.semaphore* %0) {
%2 = tail call i32 @sema_init(%struct.semaphore* %0, i32 0)
ret void
}
/* Type definitions */
typedef scalar_t__ int_fast8_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_int_fast8_t(int_fast8_t const k1,
                                             int_fast8_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_LESS_THAN_int_fast8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_LESS_THAN_int_fast8_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_int_fast8_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_int_fast8_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void test_00(char *dstb) { __builtin_memset(dstb, 0, 15); }


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

x86 assembly (clang, -O2):
movq   $0x0,0x7(%rdi)
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @test_00(i8* nocapture writeonly %0) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(15) %0, i8 0, i64 15, i1 false)
ret void
}
void foo_2_2_1_1_2_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_2_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_select(int, int);
void j_select(int arg0, int arg1) { japi_select(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_select>:
jmp    1030 <japi_select@plt>

LLVM IR (-O0):
define void @j_select(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 @japi_select(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @j_select(i32 %0, i32 %1) {
%3 = tail call i32 @japi_select(i32 %0, i32 %1)
ret void
}
double f4_cb_send_pre_int_int_int_int_int(double (*cb)(int, int, int, int,
                                                       int)) {
  int r = 44;
  return cb(8, 9, 10, 11, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_int_int_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2c,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%r8d
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
call   *%rax
movsd  0xec7(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_int_int_int>:
push   %rax
mov    %rdi,%rax
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
mov    $0x2c,%r8d
call   *%rax
addsd  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_int_int_int(double (i32, i32, i32, i32, i32)* %0) {
%2 = alloca double (i32, i32, i32, i32, i32)*
%3 = alloca i32
store double (i32, i32, i32, i32, i32)* %0, double (i32, i32, i32, i32, i32)** %2
store i32 44, i32* %3
%4 = load double (i32, i32, i32, i32, i32)*, double (i32, i32, i32, i32, i32)** %2
%5 = load i32, i32* %3
%6 = call double %4(i32 8, i32 9, i32 10, i32 11, i32 %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_int_int_int(double (i32, i32, i32, i32, i32)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, i32 10, i32 11, i32 44)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
float sum(float *arr, int start, int length) {
  float result = 0;
  for (int i = start; i < start + length; i++) {
    result += arr[i];
  }
  return result;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    1152 <sum+0x52>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <sum+0x1c>
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edx,%edx
jle    111f <sum+0x1f>
add    %esi,%edx
movslq %esi,%rax
movslq %edx,%rcx
xorps  %xmm0,%xmm0
nop
addss  (%rdi,%rax,4),%xmm0
add    $0x1,%rax
cmp    %rcx,%rax
jl     1110 <sum+0x10>
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sum(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store float 0.000000e+00, float* %7
%9 = load i32, i32* %5
store i32 %9, i32* %8
br label %10
10: ; preds = %24, %3
%11 = load i32, i32* %8
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = icmp slt i32 %11, %14
br i1 %15, label %16, label %27
16: ; preds = %10
%17 = load float*, float** %4
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float, float* %17, i64 %19
%21 = load float, float* %20
%22 = load float, float* %7
%23 = fadd float %22, %21
store float %23, float* %7
br label %24
24: ; preds = %16
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %10
27: ; preds = %10
%28 = load float, float* %7
ret float %28
}

LLVM IR (-O2):
define float @sum(float* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = add nsw i32 %2, %1
%7 = sext i32 %1 to i64
%8 = sext i32 %6 to i64
br label %11
9: ; preds = %11, %3
%10 = phi float [ 0.000000e+00, %3 ], [ %16, %11 ]
ret float %10
11: ; preds = %5, %11
%12 = phi i64 [ %7, %5 ], [ %17, %11 ]
%13 = phi float [ 0.000000e+00, %5 ], [ %16, %11 ]
%14 = getelementptr inbounds float, float* %0, i64 %12
%15 = load float, float* %14
%16 = fadd float %13, %15
%17 = add nsw i64 %12, 1
%18 = icmp slt i64 %17, %8
br i1 %18, label %11, label %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x5c() {
  Assert_real((isbdigit(92) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              465, ("isbdigit should be 0 for 0x5c"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x5c\00"
define void @t_isbdigit_0x5c() {
%1 = tail call i64 @isbdigit(i32 92)
%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 465, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
char *createString(char c) {
  char *string = malloc(2 * sizeof(char));
  string[0] = c;
  string[1] = '\0';
  return string;
}


x86 assembly (clang, -O0):
<createString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createString>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %bl,(%rax)
movb   $0x0,0x1(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @createString(i8 signext %0) {
%2 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
store i8 %0, i8* %2
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %3
ret i8* %2
}
void curl_global_init() {}


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

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

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

LLVM IR (-O2):
define void @curl_global_init() {
ret void
}
unsigned int __scanbit(unsigned long val, unsigned long max) {
  asm("bsf %1,%0 ; cmovz %2,%0" : "=&r"(val) : "r"(val), "r"(max));
  return (unsigned int)val;
}


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

x86 assembly (clang, -O2):
<__scanbit>:
bsf    %rdi,%rax
cmove  %rsi,%rax
ret

LLVM IR (-O0):
define i32 @__scanbit(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 asm "bsf $1,$0 ; cmovz $2,$0", "=&r,r,r,~{dirflag},~{fpsr},~{flags}"(i64 %5, i64 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__scanbit(i64 %0, i64 %1) {
%3 = tail call i64 asm "bsf $1,$0 ; cmovz $2,$0", "=&r,r,r,~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
void ar9003_mci_check_bt(struct ath_hw *ah) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.ath_hw = type opaque
define void @ar9003_mci_check_bt(%struct.ath_hw* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char);
void blad(char s[], char ch) {
  printf("!!! %s  '%c' !!!\n\n", s, ch);
  exit(1);
}


x86 assembly (clang, -O0):
<blad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
movsbl -0x9(%rbp),%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<blad>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"!!! %s '%c' !!!\0A\0A\00"
define void @blad(i8* %0, i8 signext %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 i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5, i8 signext %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"!!! %s '%c' !!!\0A\0A\00"
define void @blad(i8* %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
unsigned char clamp_u8(unsigned char x, unsigned char min, unsigned char max) {
  return x < min ? min : (x > max ? max : x);
}


x86 assembly (clang, -O0):
<clamp_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    1131 <clamp_u8+0x31>
movzbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    115a <clamp_u8+0x5a>
movzbl -0x1(%rbp),%eax
movzbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
jle    114d <clamp_u8+0x4d>
movzbl -0x3(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <clamp_u8+0x54>
movzbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_u8>:
cmp    %dl,%dil
mov    %edi,%eax
cmova  %edx,%eax
cmp    %sil,%dil
cmovb  %esi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @clamp_u8(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
br label %29
15: ; preds = %3
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = load i8, i8* %6
%19 = zext i8 %18 to i32
%20 = icmp sgt i32 %17, %19
br i1 %20, label %21, label %24
21: ; preds = %15
%22 = load i8, i8* %6
%23 = zext i8 %22 to i32
br label %27
24: ; preds = %15
%25 = load i8, i8* %4
%26 = zext i8 %25 to i32
br label %27
27: ; preds = %24, %21
%28 = phi i32 [ %23, %21 ], [ %26, %24 ]
br label %29
29: ; preds = %27, %12
%30 = phi i32 [ %14, %12 ], [ %28, %27 ]
%31 = trunc i32 %30 to i8
ret i8 %31
}

LLVM IR (-O2):
define zeroext i8 @clamp_u8(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = icmp ult i8 %0, %1
%5 = icmp ugt i8 %0, %2
%6 = select i1 %5, i8 %2, i8 %0
%7 = select i1 %4, i8 %1, i8 %6
ret i8 %7
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
void mult(char *arg1, char *arg2) {
  int a, b;
  a = atoi(arg1);
  b = atoi(arg2);
  printf("%d\n", a * b);
}


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
imul   -0x18(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <atoi@plt>
imul   %eax,%ebp
lea    0xec1(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @mult(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @atoi(i8* %0)
%4 = tail call i32 @atoi(i8* %1)
%5 = mul nsw i32 %4, %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_nan_string(char *);
int main(int argc, char *argv[]) {
  do_nan_string("");
  do_nan_string("string");
  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)
lea    0xed9(%rip),%rdi
call   1030 <do_nan_string@plt>
lea    0xec7(%rip),%rdi
call   1030 <do_nan_string@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"string\00"
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 @do_nan_string(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @do_nan_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"string\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @do_nan_string(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @do_nan_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int fun1228() { return 1228; }


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

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

LLVM IR (-O0):
define i32 @fun1228() {
ret i32 1228
}

LLVM IR (-O2):
define i32 @fun1228() {
ret i32 1228
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main(int argc, const char *argv[]) {
  char input;
  input = getchar();
  while (input != EOF) {
    printf("%c\n", input);
    input = getchar();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    0x2e9d(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1175 <main+0x55>
lea    0xea3(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
jmp    1140 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%al
je     1157 <main+0x37>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%al
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %6
br label %8
8: ; preds = %14, %2
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = load i8, i8* @EOF
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %10, %12
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = load i8, i8* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %15)
%17 = call signext i8 (...) @getchar()
store i8 %17, i8* %6
br label %8
18: ; preds = %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 (...) @getchar()
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = tail call signext i8 (...) @getchar()
%10 = load i8, i8* @EOF
%11 = icmp eq i8 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i32 0
}
void test_atoi() {}


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

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

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

LLVM IR (-O2):
define void @test_atoi() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isatty(int /*<<< orphan*/);
int main() {
  isatty(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @isatty(i32 0)
ret i32 0
}
void sk_shift(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_shift() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kiir(char *);
int kilep() {
  kiir("Koszonom, hogy jatszottal velem!\n");
  return 1;
}


x86 assembly (clang, -O0):
<kilep>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <kiir@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"Koszonom, hogy jatszottal velem!\0A\00"
define i32 @kilep() {
%1 = call i32 @kiir(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [34 x i8] c"Koszonom, hogy jatszottal velem!\0A\00"
define i32 @kilep() {
%1 = tail call i32 @kiir(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void osMemRelease(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @osMemRelease(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
char *strchr(char const *, char);
unsigned int get_numcaces(const char *aces) {
  unsigned int num = 1;
  const char *current;
  current = aces;
  while ((current = strchr(current, ','))) {
    ++current;
    ++num;
  }
  return num;
}


x86 assembly (clang, -O0):
<get_numcaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1161 <get_numcaces+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <get_numcaces+0x1b>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_numcaces>:
push   %rbx
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     1149 <get_numcaces+0x39>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
add    $0x1,%ebx
mov    %rax,%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <get_numcaces+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_numcaces(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 1, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add i32 %6, 1
%9 = tail call i8* @strchr(i8* dereferenceable(1) %7, i8 signext 44)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void display_text(char *string, int row, int col) {
  printf("\x1B[%d;%dH", row, col);
  printf("%s\n", string);
}


x86 assembly (clang, -O0):
<display_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_text>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @display_text(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @display_text(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void lcddatawrite(uint8_t data) {
  volatile uint8_t dummy;
  while (((*((volatile uint16_t *)0x40001C1C)) & 0x0002) == 0x0000) {
  };
  (*((volatile uint8_t *)0x40004C82)) |= 0x04;
  (*((volatile uint16_t *)0x40001C0E)) = data;
  dummy = (*((volatile uint16_t *)0x40001C0C));
}


x86 assembly (clang, -O0):
<lcddatawrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40001c1c,%eax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    111f <lcddatawrite+0x1f>
jmp    1107 <lcddatawrite+0x7>
mov    $0x40004c82,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    $0x40004c82,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    $0x40001c0e,%eax
mov    %ecx,(%rax)
mov    $0x40001c0c,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcddatawrite>:
testl  $0x2,0x40001c1c
je     1100 <lcddatawrite>
orl    $0x4,0x40004c82
04
mov    %edi,0x40001c0e
mov    0x40001c0c,%eax
mov    %eax,-0x4(%rsp)
ret

LLVM IR (-O0):
define void @lcddatawrite(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load volatile i32, i32* inttoptr (i64 1073749020 to i32*)
%6 = and i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = load volatile i32, i32* inttoptr (i64 1073761410 to i32*)
%11 = or i32 %10, 4
store volatile i32 %11, i32* inttoptr (i64 1073761410 to i32*)
%12 = load i32, i32* %2
store volatile i32 %12, i32* inttoptr (i64 1073749006 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 1073749004 to i32*)
store volatile i32 %13, i32* %3
ret void
}

LLVM IR (-O2):
define void @lcddatawrite(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = load volatile i32, i32* inttoptr (i64 1073749020 to i32*)
%6 = and i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = load volatile i32, i32* inttoptr (i64 1073761410 to i32*)
%10 = or i32 %9, 4
store volatile i32 %10, i32* inttoptr (i64 1073761410 to i32*)
store volatile i32 %0, i32* inttoptr (i64 1073749006 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1073749004 to i32*)
store volatile i32 %11, i32* %2
ret void
}
unsigned int array_uint24_le(const unsigned char data[]) {
  return data[0] + (data[1] << 8) + (data[2] << 16);
}


x86 assembly (clang, -O0):
<array_uint24_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_uint24_le>:
movzwl (%rdi),%ecx
movzbl 0x2(%rdi),%eax
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @array_uint24_le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = add nsw i32 %12, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @array_uint24_le(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
ret i32 %13
}
char *stripchr(char *mainstr, int separator) {
  char *ptr;
  if (mainstr == ((void *)0))
    return ((void *)0);
  ptr = strchr(mainstr, separator);
  if (ptr == 0)
    return ((void *)0);
  ptr[0] = '\0';
  ptr++;
  return ptr;
}


x86 assembly (clang, -O0):
<stripchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <stripchr+0x27>
movq   $0x0,-0x8(%rbp)
jmp    117a <stripchr+0x6a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115f <stripchr+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    117a <stripchr+0x6a>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripchr>:
push   %rax
test   %rdi,%rdi
je     1129 <stripchr+0x19>
call   1030 <strchr@plt>
test   %rax,%rax
je     1129 <stripchr+0x19>
movb   $0x0,(%rax)
add    $0x1,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @stripchr(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i8* @strchr(i8* %0, i32 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
store i8 0, i8* %5
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %9
9: ; preds = %4, %2, %7
%10 = phi i8* [ %8, %7 ], [ null, %2 ], [ null, %4 ]
ret i8* %10
}