xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Apache Tika!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Apache Tika!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int isLeapYear(const int year) {
  if (((year % 100 == 0) && (year % 4 == 0)) || year % 400 == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <isLeapYear+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1143 <isLeapYear+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <isLeapYear+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <isLeapYear+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYear>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
mov    %eax,%edx
sub    %ecx,%edx
imul   $0xc28f5c29,%eax,%ecx
and    $0x3,%eax
or     %edx,%eax
sete   %al
add    $0x51eb850,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isLeapYear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 4
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7, %1
%12 = load i32, i32* %3
%13 = srem i32 %12, 400
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @isLeapYear(i32 %0) {
%2 = srem i32 %0, 100
%3 = and i32 %0, 3
%4 = or i32 %2, %3
%5 = icmp eq i32 %4, 0
%6 = srem i32 %0, 400
%7 = icmp eq i32 %6, 0
%8 = or i1 %7, %5
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, int);
int /*<<< orphan*/ stderr;
int __attribute__((no)) AlignCheck(void *address, int align) {
  if ((uintptr_t)address % align != 0) {
    fprintf(stderr, "Address %p is not aligned to a multiple of %i\n", address,
            align);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<AlignCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
je     115e <AlignCheck+0x4e>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1165 <AlignCheck+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AlignCheck>:
mov    %esi,%r8d
mov    %rdi,%rcx
movslq %esi,%rsi
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1158 <AlignCheck+0x48>
mov    %rcx,%rax
xor    %edx,%edx
div    %rsi
test   %rdx,%rdx
je     1164 <AlignCheck+0x54>
push   %rax
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
mov    %ecx,%eax
xor    %edx,%edx
div    %r8d
test   %rdx,%rdx
jne    1132 <AlignCheck+0x22>
xor    %eax,%eax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Address %p is not aligned to a multiple of %i\0A\00"
define i32 @AlignCheck(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = urem i64 %7, %9
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15)
store i32 1, i32* %3
br label %18
17: ; preds = %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Address %p is not aligned to a multiple of %i\0A\00"
define i32 @AlignCheck(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = sext i32 %1 to i64
%5 = urem i64 %3, %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xe5() {
  Assert_real((isascii(229) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              1150, ("isascii should be 0 for 0xe5"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe5\00"
define void @t_isascii_0xe5() {
%1 = tail call i64 @isascii(i32 229)
%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 1150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c_end(void) {
  printf("\n"
         "#endif\n");
}


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"\0A#endif\00"
define void @c_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
void sigChldHandler(void) { ; }


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

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

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

LLVM IR (-O2):
define void @sigChldHandler() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void xor_swap(uint64_t *x, uint64_t *y) {
  *x = *x ^ *y;
  *y = *x ^ *y;
  *x = *x ^ *y;
}


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

x86 assembly (clang, -O2):
<xor_swap>:
mov    (%rsi),%eax
xor    (%rdi),%eax
mov    %eax,(%rdi)
xor    (%rsi),%eax
mov    %eax,(%rsi)
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @xor_swap(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = xor i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = xor i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @xor_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = xor i32 %8, %7
store i32 %9, i32* %0
ret void
}
void *chudxnu_platform_ptr(void) { return (void *)0; }


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

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

LLVM IR (-O0):
define i8* @chudxnu_platform_ptr() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @chudxnu_platform_ptr() {
ret i8* null
}
/* Type definitions */
struct XCSF {
  int dummy;
};
struct Cl {
  int dummy;
};

/* Variables and functions */
double cond_size(struct XCSF const *, struct Cl const *);
double cl_cond_size(const struct XCSF *xcsf, const struct Cl *c) {
  return cond_size(xcsf, c);
}


x86 assembly (clang, -O0):
<cl_cond_size>:
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 <cond_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_cond_size>:
jmp    1030 <cond_size@plt>

LLVM IR (-O0):
%struct.XCSF = type { i32 }
%struct.Cl = type { i32 }
define double @cl_cond_size(%struct.XCSF* %0, %struct.Cl* %1) {
%3 = alloca %struct.XCSF*
%4 = alloca %struct.Cl*
store %struct.XCSF* %0, %struct.XCSF** %3
store %struct.Cl* %1, %struct.Cl** %4
%5 = load %struct.XCSF*, %struct.XCSF** %3
%6 = load %struct.Cl*, %struct.Cl** %4
%7 = call double @cond_size(%struct.XCSF* %5, %struct.Cl* %6)
ret double %7
}

LLVM IR (-O2):
%struct.XCSF = type { i32 }
%struct.Cl = type { i32 }
define double @cl_cond_size(%struct.XCSF* %0, %struct.Cl* %1) {
%3 = tail call double @cond_size(%struct.XCSF* %0, %struct.Cl* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destroyStr(char *newStr) {
  if (newStr)
    free(newStr);
}


x86 assembly (clang, -O0):
<destroyStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <destroyStr+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyStr>:
test   %rdi,%rdi
je     111a <destroyStr+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @destroyStr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @destroyStr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int f(char a, int b, float c, int *d, float **e, int f) { return 0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i8 signext %0, i32 %1, float %2, i32* %3, float** %4, i32 %5) {
%7 = alloca i8
%8 = alloca i32
%9 = alloca float
%10 = alloca i32*
%11 = alloca float**
%12 = alloca i32
store i8 %0, i8* %7
store i32 %1, i32* %8
store float %2, float* %9
store i32* %3, i32** %10
store float** %4, float*** %11
store i32 %5, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @f(i8 signext %0, i32 %1, float %2, i32* nocapture readnone %3, float** nocapture readnone %4, i32 %5) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fshm_open(char const *, int /*<<< orphan*/, int);
FILE *fshm_create(const char *name, mode_t mode) {
  return fshm_open(name, mode, 1);
}


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

x86 assembly (clang, -O2):
<fshm_create>:
mov    $0x1,%edx
jmp    1030 <fshm_open@plt>

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

LLVM IR (-O2):
define i32* @fshm_create(i8* %0, i32 %1) {
%3 = tail call i32* @fshm_open(i8* %0, i32 %1, i32 1)
ret i32* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void hw_set_backlight(uint8_t brightness) { (void)brightness; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ abort();
int vasprintf(char **, char const *, int /*<<< orphan*/);
int fcitx_vasprintf(char **ret, const char *format, va_list va) {
  int done = vasprintf(ret, format, va);
  if (done == -1) {
    abort();
  }
  return done;
}


x86 assembly (clang, -O0):
<fcitx_vasprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vasprintf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1157 <fcitx_vasprintf+0x37>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcitx_vasprintf>:
push   %rax
call   1040 <vasprintf@plt>
cmp    $0xffffffff,%eax
je     112d <fcitx_vasprintf+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @fcitx_vasprintf(i8** %0, i8* %1, i32 %2) {
%4 = tail call i32 @vasprintf(i8** %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
ret i32 %4
}
int etk_platform_init(int argc, char **argv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @etk_platform_init(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int isreturn(c)
unsigned char c;
{ return c == '\r' || c == '\n'; }


x86 assembly (clang, -O0):
<isreturn>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isreturn+0x29>
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreturn>:
movzbl %dil,%eax
cmp    $0xd,%eax
sete   %cl
cmp    $0xa,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @isreturn(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 13
%4 = icmp eq i32 %2, 10
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ realloc(char *, unsigned int);
int strlen(char *);
char *opts_append_char(char *str, char ch) {
  unsigned int new_size = strlen(str) + 2;
  str = (char *)realloc(str, new_size);
  str[new_size - 2] = ch;
  str[new_size - 1] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<opts_append_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x2,%ecx
mov    %ecx,%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opts_append_char>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
lea    0x2(%rbp),%esi
mov    %rbx,%rdi
call   1040 <realloc@plt>
mov    %ebp,%ecx
mov    %r14b,(%rax,%rcx,1)
add    $0x1,%ebp
movb   $0x0,(%rax,%rbp,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @opts_append_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 2
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = call i64 @realloc(i8* %9, i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %3
%13 = load i8, i8* %4
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sub i32 %15, 2
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
store i8 %13, i8* %18
%19 = load i8*, i8** %3
%20 = load i32, i32* %5
%21 = sub i32 %20, 1
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 0, i8* %23
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @opts_append_char(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 2
%5 = tail call i64 @realloc(i8* %0, i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = zext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8 %1, i8* %8
%9 = add i32 %3, 1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
store i8 0, i8* %11
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct syslog_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vsyslog(int, char const *, int /*<<< orphan*/);
void vsyslogp_ss(int priority, struct syslog_data *data, const char *msgid,
                 const char *sdfmt, const char *fmt, va_list ap) {
  vsyslog(priority, fmt, ap);
}


x86 assembly (clang, -O0):
<vsyslogp_ss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1030 <vsyslog@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsyslogp_ss>:
mov    %r9d,%edx
mov    %r8,%rsi
jmp    1030 <vsyslog@plt>

LLVM IR (-O0):
%struct.syslog_data = type { i32 }
define void @vsyslogp_ss(i32 %0, %struct.syslog_data* %1, i8* %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca %struct.syslog_data*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
store i32 %0, i32* %7
store %struct.syslog_data* %1, %struct.syslog_data** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %11
%15 = load i32, i32* %12
%16 = call i32 @vsyslog(i32 %13, i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.syslog_data = type { i32 }
define void @vsyslogp_ss(i32 %0, %struct.syslog_data* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* %4, i32 %5) {
%7 = tail call i32 @vsyslog(i32 %0, i8* %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PipeWrite(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void WriteProcess(int fd[2]) {
  PipeWrite(fd, 70);
  printf("Write Process: Sleep - 10 Seconds ...\n");
  sleep(10);
  printf("Write Process: Wake up  then Why not rewrite 70 characters  ? \n");
  PipeWrite(fd, 70);
  printf("Write Process : Done\n");
}


x86 assembly (clang, -O0):
<WriteProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x46,%esi
call   1040 <PipeWrite@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x46,%esi
call   1040 <PipeWrite@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteProcess>:
push   %rbx
mov    %rdi,%rbx
mov    $0x46,%esi
call   1040 <PipeWrite@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x46,%esi
call   1040 <PipeWrite@plt>
lea    0xef1(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Write Process: Sleep - 10 Seconds ...\0A\00"
@.str.1 = [64 x i8] c"Write Process: Wake up then Why not rewrite 70 characters ? \0A\00"
@.str.2 = [22 x i8] c"Write Process : Done\0A\00"
define void @WriteProcess(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @PipeWrite(i32* %3, i32 70)
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sleep(i32 10)
%7 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32*, i32** %2
%9 = call i32 @PipeWrite(i32* %8, i32 70)
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"Write Process: Sleep - 10 Seconds ...\00"
@str.3 = [63 x i8] c"Write Process: Wake up then Why not rewrite 70 characters ? \00"
@str.4 = [21 x i8] c"Write Process : Done\00"
define void @WriteProcess(i32* %0) {
%2 = tail call i32 @PipeWrite(i32* %0, i32 70)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 10)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @PipeWrite(i32* %0, i32 70)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_close_solution_output_file(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(138, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_close_solution_output_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x8a,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_close_solution_output_file>:
mov    $0x8a,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_close_solution_output_file() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 138, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_close_solution_output_file() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 138, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
__attribute__((always_)) int valid_signal(unsigned long sig) {
  return sig <= 64 ? 1 : 0;
}


x86 assembly (clang, -O0):
<valid_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x40,%rdx
cmovbe %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_signal>:
xor    %eax,%eax
cmp    $0x41,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @valid_signal(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ule i64 %3, 64
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @valid_signal(i64 %0) {
%2 = icmp ult i64 %0, 65
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR68_set(void) { return U_WMRCORENONE_set("U_WMR68"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR68\00"
define i8* @U_WMR68_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR68\00"
define i8* @U_WMR68_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ together_main(int, char **);
int main(int argc, char **argv) {
  printf("Hello, World to OpenGL experiments!\n");
  together_main(argc, argv);
  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    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <together_main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <together_main@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Hello, World to OpenGL experiments!\0A\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 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @together_main(i32 %7, i8** %8)
ret i32 0
}

LLVM IR (-O2):
@str = [36 x i8] c"Hello, World to OpenGL experiments!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @together_main(i32 %0, i8** %1)
ret i32 0
}
void *rvi_get_user_data(struct rvi_t *rvi) { return 0; }


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

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

LLVM IR (-O0):
%struct.rvi_t = type opaque
define i8* @rvi_get_user_data(%struct.rvi_t* %0) {
%2 = alloca %struct.rvi_t*
store %struct.rvi_t* %0, %struct.rvi_t** %2
ret i8* null
}

LLVM IR (-O2):
%struct.rvi_t = type opaque
define noalias i8* @rvi_get_user_data(%struct.rvi_t* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcomplex4array_(char *x, unsigned int *n) { lookNarray(x, (*n * 4)); }


x86 assembly (clang, -O0):
<lookcomplex4array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x2,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookcomplex4array_>:
mov    (%rsi),%esi
shl    $0x2,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcomplex4array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 4
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookcomplex4array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 2
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int sqrt(int);
int is_prime_number(int count) {
  int i;
  int root = sqrt(count);
  for (i = 2; i <= root; i++) {
    if (0 == count % i)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1169 <is_prime_number+0x59>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
jne    1156 <is_prime_number+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1170 <is_prime_number+0x60>
jmp    115b <is_prime_number+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <is_prime_number+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime_number>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    $0x1,%ecx
cmp    $0x2,%eax
jl     114f <is_prime_number+0x3f>
mov    %eax,%esi
neg    %esi
mov    $0x2,%edi
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     114d <is_prime_number+0x3d>
lea    (%rsi,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%edx
add    $0x1,%edx
mov    %edx,%edi
cmp    $0x1,%eax
jne    1130 <is_prime_number+0x20>
jmp    114f <is_prime_number+0x3f>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_prime_number(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %11, label %7
4: ; preds = %7
%5 = add nuw i32 %8, 1
%6 = icmp eq i32 %8, %2
br i1 %6, label %11, label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ 2, %1 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
void set_mask(unsigned long color, unsigned long *mask, int *shift) {
  *shift = 0;
  while (color != 0 && (color & 1) == 0) {
    (*shift)++;
    color >>= 1;
  }
  *mask = color;
}


x86 assembly (clang, -O0):
<set_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
je     113c <set_mask+0x3c>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <set_mask+0x4c>
jmp    1168 <set_mask+0x68>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111a <set_mask+0x1a>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mask>:
movl   $0x0,(%rdx)
test   %rdi,%rdi
je     113d <set_mask+0x3d>
mov    %edi,%eax
and    $0x1,%eax
test   %rax,%rax
jne    113d <set_mask+0x3d>
xor    %ecx,%ecx
mov    %rdi,%rax
nopw   0x0(%rax,%rax,1)
add    $0x1,%ecx
shr    %rax
cmp    $0x2,%rdi
jb     1137 <set_mask+0x37>
and    $0x2,%edi
test   %rdi,%rdi
mov    %rax,%rdi
je     1120 <set_mask+0x20>
mov    %ecx,(%rdx)
mov    %rax,(%rsi)
ret
mov    %rdi,(%rsi)
ret

LLVM IR (-O0):
define void @set_mask(i64 %0, i64* %1, i32* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i32*
store i64 %0, i64* %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
store i32 0, i32* %7
br label %8
8: ; preds = %17, %3
%9 = load i64, i64* %4
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i64, i64* %4
%13 = and i64 %12, 1
%14 = icmp eq i64 %13, 0
br label %15
15: ; preds = %11, %8
%16 = phi i1 [ false, %8 ], [ %14, %11 ]
br i1 %16, label %17, label %23
17: ; preds = %15
%18 = load i32*, i32** %6
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %18
%21 = load i64, i64* %4
%22 = lshr i64 %21, 1
store i64 %22, i64* %4
br label %8
23: ; preds = %15
%24 = load i64, i64* %4
%25 = load i64*, i64** %5
store i64 %24, i64* %25
ret void
}

LLVM IR (-O2):
define void @set_mask(i64 %0, i64* nocapture writeonly %1, i32* nocapture %2) {
store i32 0, i32* %2
%4 = icmp ne i64 %0, 0
%5 = and i64 %0, 1
%6 = icmp eq i64 %5, 0
%7 = and i1 %4, %6
br i1 %7, label %8, label %18
8: ; preds = %3, %8
%9 = phi i32 [ %11, %8 ], [ 0, %3 ]
%10 = phi i64 [ %12, %8 ], [ %0, %3 ]
%11 = add nuw nsw i32 %9, 1
%12 = lshr i64 %10, 1
%13 = icmp ugt i64 %10, 1
%14 = and i64 %10, 2
%15 = icmp eq i64 %14, 0
%16 = and i1 %13, %15
br i1 %16, label %8, label %17
17: ; preds = %8
store i32 %11, i32* %2
br label %18
18: ; preds = %17, %3
%19 = phi i64 [ %12, %17 ], [ %0, %3 ]
store i64 %19, i64* %1
ret void
}
void item_interaction(char *item_description) {}


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

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

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

LLVM IR (-O2):
define void @item_interaction(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf(
      "Usage: q3 [FILE]... [KEY]...\nEncrypt the FILE (the current directory "
      "by default) using the KEY passed. \n\nAs an illustrative example If you "
      "call < q3 test.txt 123456 > it will take \nthe text of test.txt that, "
      "e.g. contains the text 'encrypt me please', that \nin ASCII is:\n\t'101 "
      "110 099 114 121 112 116 032 109 101 032 112 108 101 097 115 101', \nthe "
      "file ASCII encrypted would be:\n\t'102 111 100 115 122 113 117 032 111 "
      "103 032 115 111 104 100 118 104', \nthat actually means 'fodszqu og "
      "sohdvh'.\n\n\t\t\t\t\t Made by github.com/joaoantoniocardoso\n");
}


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

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

LLVM IR (-O0):
@.str = [539 x i8] c"Usage: q3 [FILE]... [KEY]...\0AEncrypt the FILE (the current directory by default) using the KEY passed. \0A\0AAs an illustrative example If you call < q3 test.txt 123456 > it will take \0Athe text of test.txt that, e.g. contains the text 'encrypt me please', that \0Ain ASCII is:\0A\09'101 110 099 114 121 112 116 032 109 101 032 112 108 101 097 115 101', \0Athe file ASCII encrypted would be:\0A\09'102 111 100 115 122 113 117 032 111 103 032 115 111 104 100 118 104', \0Athat actually means 'fodszqu og sohdvh'.\0A\0A\09\09\09\09\09 Made by github.com/joaoantoniocardoso\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([539 x i8], [539 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [538 x i8] c"Usage: q3 [FILE]... [KEY]...\0AEncrypt the FILE (the current directory by default) using the KEY passed. \0A\0AAs an illustrative example If you call < q3 test.txt 123456 > it will take \0Athe text of test.txt that, e.g. contains the text 'encrypt me please', that \0Ain ASCII is:\0A\09'101 110 099 114 121 112 116 032 109 101 032 112 108 101 097 115 101', \0Athe file ASCII encrypted would be:\0A\09'102 111 100 115 122 113 117 032 111 103 032 115 111 104 100 118 104', \0Athat actually means 'fodszqu og sohdvh'.\0A\0A\09\09\09\09\09 Made by github.com/joaoantoniocardoso\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([538 x i8], [538 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void flush_stdout_() {
  int ier;
  ier = fflush(stdout);
}


x86 assembly (clang, -O0):
<flush_stdout_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_stdout_>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @flush_stdout_() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @flush_stdout_() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
int refc_inc(void *handle) {
  int *ptr = ((void *)(((int *)handle) - 1));
  int ret = ++*ptr;

  return ret;
}


x86 assembly (clang, -O0):
<refc_inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<refc_inc>:
mov    -0x4(%rdi),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rdi)
ret

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

LLVM IR (-O2):
define i32 @refc_inc(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
ret i32 %5
}
unsigned short edosk2674_smsc_inw(volatile unsigned short *a) {
  unsigned short d;
  d = *a;
  return (d >> 8) | (d << 8);
}


x86 assembly (clang, -O0):
<edosk2674_smsc_inw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
movzwl -0xa(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<edosk2674_smsc_inw>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @edosk2674_smsc_inw(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = load volatile i16, i16* %4
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @edosk2674_smsc_inw(i16* %0) {
%2 = load volatile i16, i16* %0
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
ret i16 %3
}
int ld_blt_rr1(long double a1, long double a2) {
  return (__builtin_isless(a1, a2));
}


x86 assembly (clang, -O0):
<ld_blt_rr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blt_rr1>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_blt_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp olt x86_fp80 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ld_blt_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp olt x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ do_report(char *, int, int);
int /*<<< orphan*/ erl_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ erl_mk_pid(char *, int, int, int);
int /*<<< orphan*/ send_term(int /*<<< orphan*/);
void t_erl_mk_xpid(void) {
  erl_init(NULL, 0);
  send_term(erl_mk_pid("kalle@localhost", 32767, 8191, 1));
  do_report("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/"
            "erl_interface/test/erl_eterm_SUITE_data/eterm_test.c",
            523, 1);
}


x86 assembly (clang, -O0):
<t_erl_mk_xpid>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1060 <erl_init@plt>
lea    0xeaa(%rip),%rdi
mov    $0x7fff,%esi
mov    $0x1fff,%edx
mov    $0x1,%ecx
call   1050 <erl_mk_pid@plt>
mov    %eax,%edi
call   1040 <send_term@plt>
lea    0xe98(%rip),%rdi
mov    $0x20b,%esi
mov    $0x1,%edx
call   1030 <do_report@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_erl_mk_xpid>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1060 <erl_init@plt>
lea    0xeaf(%rip),%rdi
mov    $0x7fff,%esi
mov    $0x1fff,%edx
mov    $0x1,%ecx
call   1050 <erl_mk_pid@plt>
mov    %eax,%edi
call   1040 <send_term@plt>
lea    0xe9d(%rip),%rdi
mov    $0x20b,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <do_report@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"kalle@localhost\00"
@.str.1 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @t_erl_mk_xpid() {
%1 = call i32 @erl_init(i32* null, i32 0)
%2 = call i32 @erl_mk_pid(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 32767, i32 8191, i32 1)
%3 = call i32 @send_term(i32 %2)
%4 = call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 523, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"kalle@localhost\00"
@.str.1 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @t_erl_mk_xpid() {
%1 = tail call i32 @erl_init(i32* null, i32 0)
%2 = tail call i32 @erl_mk_pid(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 32767, i32 8191, i32 1)
%3 = tail call i32 @send_term(i32 %2)
%4 = tail call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 523, i32 1)
ret void
}
int main() { return 1UL < 0UL; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR51_set(void) { return U_WMRCORENONE_set("U_WMR51"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR51\00"
define i8* @U_WMR51_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR51\00"
define i8* @U_WMR51_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_outpkt_news(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_outpkt_news>:
jmp    1030 <mock@plt>

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

LLVM IR (-O2):
define i8* @cf_s_outpkt_news(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}