xunge/DecIR huggingface dataset:
/* Variables and functions */
float App_Get_Cabinet_Setpoint();
int /*<<< orphan*/ File_Fifo_Respond(char *);
int /*<<< orphan*/ sprintf(char *, char *, float);
void File_Fifo_Get_Cook_Temp(void) {
  char buffer[50];
  float temperature;
  temperature = App_Get_Cabinet_Setpoint();
  sprintf(buffer, "1\n%4.2f\n", temperature);
  File_Fifo_Respond(buffer);
}


x86 assembly (clang, -O0):
<File_Fifo_Get_Cook_Temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x0,%al
call   1040 <App_Get_Cabinet_Setpoint@plt>
movss  %xmm0,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
movss  -0x44(%rbp),%xmm0
lea    0xeac(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <File_Fifo_Respond@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_Fifo_Get_Cook_Temp>:
push   %rbx
sub    $0x40,%rsp
xor    %eax,%eax
call   1040 <App_Get_Cabinet_Setpoint@plt>
lea    0xebd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <File_Fifo_Respond@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"1\0A%4.2f\0A\00"
define void @File_Fifo_Get_Cook_Temp() {
%1 = alloca [50 x i8]
%2 = alloca float
%3 = call float (...) @App_Get_Cabinet_Setpoint()
store float %3, float* %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%5 = load float, float* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%8 = call i32 @File_Fifo_Respond(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"1\0A%4.2f\0A\00"
define void @File_Fifo_Get_Cook_Temp() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call float (...) @App_Get_Cabinet_Setpoint()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %3)
%5 = call i32 @File_Fifo_Respond(i8* %2)
ret void
}
/* Type definitions */
struct modemchannel {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ logprintf(int /*<<< orphan*/, char *);
void pktinitmkiss(struct modemchannel *chan, const char *params[]) {
  logprintf(0, "mkiss not supported on this architecture\n");
}


x86 assembly (clang, -O0):
<pktinitmkiss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
lea    0xed7(%rip),%rsi
call   1030 <logprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pktinitmkiss>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <logprintf@plt>

LLVM IR (-O0):
%struct.modemchannel = type { i32 }
@.str = [42 x i8] c"mkiss not supported on this architecture\0A\00"
define void @pktinitmkiss(%struct.modemchannel* %0, i8** %1) {
%3 = alloca %struct.modemchannel*
%4 = alloca i8**
store %struct.modemchannel* %0, %struct.modemchannel** %3
store i8** %1, i8*** %4
%5 = call i32 @logprintf(i32 0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.modemchannel = type { i32 }
@.str = [42 x i8] c"mkiss not supported on this architecture\0A\00"
define void @pktinitmkiss(%struct.modemchannel* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 @logprintf(i32 0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ argument_is_stdin(char **, int);
char *argument_to_name(char *av[], int idx) {
  return argument_is_stdin(av, idx) ? "standard input" : av[idx];
}


x86 assembly (clang, -O0):
<argument_to_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <argument_is_stdin@plt>
cmp    $0x0,%rax
je     1145 <argument_to_name+0x35>
lea    0xec4(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1155 <argument_to_name+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argument_to_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <argument_is_stdin@plt>
test   %rax,%rax
je     112b <argument_to_name+0x1b>
lea    0xed7(%rip),%rax
jmp    1132 <argument_to_name+0x22>
movslq %ebp,%rax
mov    (%rbx,%rax,8),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"standard input\00"
define i8* @argument_to_name(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 i64 @argument_is_stdin(i8** %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %16
10: ; preds = %2
%11 = load i8**, i8*** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
br label %16
16: ; preds = %10, %9
%17 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %9 ], [ %15, %10 ]
ret i8* %17
}

LLVM IR (-O2):
@.str = [15 x i8] c"standard input\00"
define i8* @argument_to_name(i8** %0, i32 %1) {
%3 = tail call i64 @argument_is_stdin(i8** %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
br label %9
9: ; preds = %2, %5
%10 = phi i8* [ %8, %5 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %2 ]
ret i8* %10
}
XCirculateSubwindowsDown() {}


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

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

LLVM IR (-O0):
define i32 @XCirculateSubwindowsDown() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XCirculateSubwindowsDown() {
ret i32 undef
}
void CERTIFICATEPOLICIES_new(void) {}


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

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

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

LLVM IR (-O2):
define void @CERTIFICATEPOLICIES_new() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ __sigjmp_save(int /*<<< orphan*/, int);
int __libc_sigsetjmp(jmp_buf env, int savemask) {
  __sigjmp_save(env, savemask);
  __set_errno(ENOSYS);
  return 0;
}


x86 assembly (clang, -O0):
<__libc_sigsetjmp>:
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   1040 <__sigjmp_save@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_sigsetjmp>:
push   %rax
call   1040 <__sigjmp_save@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__libc_sigsetjmp(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 @__sigjmp_save(i32 %5, i32 %6)
%8 = load i32, i32* @ENOSYS
%9 = call i32 @__set_errno(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__libc_sigsetjmp(i32 %0, i32 %1) {
%3 = tail call i32 @__sigjmp_save(i32 %0, i32 %1)
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 0
}
/* Type definitions */
struct ringbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rbuf_decw(struct ringbuf *, int, int /*<<< orphan*/, char);
void rbuf_dec(struct ringbuf *r, int n) { rbuf_decw(r, n, 0, ' '); }


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

x86 assembly (clang, -O2):
<rbuf_dec>:
xor    %edx,%edx
mov    $0x20,%ecx
jmp    1030 <rbuf_decw@plt>

LLVM IR (-O0):
%struct.ringbuf = type { i32 }
define void @rbuf_dec(%struct.ringbuf* %0, i32 %1) {
%3 = alloca %struct.ringbuf*
%4 = alloca i32
store %struct.ringbuf* %0, %struct.ringbuf** %3
store i32 %1, i32* %4
%5 = load %struct.ringbuf*, %struct.ringbuf** %3
%6 = load i32, i32* %4
%7 = call i32 @rbuf_decw(%struct.ringbuf* %5, i32 %6, i32 0, i8 signext 32)
ret void
}

LLVM IR (-O2):
%struct.ringbuf = type { i32 }
define void @rbuf_dec(%struct.ringbuf* %0, i32 %1) {
%3 = tail call i32 @rbuf_decw(%struct.ringbuf* %0, i32 %1, i32 0, i8 signext 32)
ret void
}
void gx_reply_error(char *buf) {
  buf[0] = 'E';
  buf[1] = '0';
  buf[2] = '1';
  buf[3] = '\0';
}


x86 assembly (clang, -O0):
<gx_reply_error>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x45,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x30,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x31,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gx_reply_error>:
movl   $0x313045,(%rdi)
ret

LLVM IR (-O0):
define void @gx_reply_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 69, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 48, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 49, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
define void @gx_reply_error(i8* nocapture writeonly %0) {
store i8 69, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 48, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 49, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 0, i8* %4
ret void
}
/* Variables and functions */
int floor(double);
float numeroArrotondatoADecimi(double x) { return floor(x * 10 + .5) / 10; }


x86 assembly (clang, -O0):
<numeroArrotondatoADecimi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <floor@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeroArrotondatoADecimi>:
push   %rax
mulsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
call   1030 <floor@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @numeroArrotondatoADecimi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 1.000000e+01, double 5.000000e-01)
%5 = call i32 @floor(double %4)
%6 = sdiv i32 %5, 10
%7 = sitofp i32 %6 to float
ret float %7
}

LLVM IR (-O2):
define float @numeroArrotondatoADecimi(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.000000e+01, double 5.000000e-01)
%3 = tail call i32 @floor(double %2)
%4 = sdiv i32 %3, 10
%5 = sitofp i32 %4 to float
ret float %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t find_freq_from_fid(uint32_t fid) { return 800 + (fid * 100); }


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

x86 assembly (clang, -O2):
<find_freq_from_fid>:
imul   $0x64,%edi,%eax
add    $0x320,%eax
ret

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

LLVM IR (-O2):
define i32 @find_freq_from_fid(i32 %0) {
%2 = mul nsw i32 %0, 100
%3 = add nsw i32 %2, 800
ret i32 %3
}
void MIDGARD_MD5_memset(output, value, len) void *output;
int value;
unsigned int len;
{ memset(output, (char)value, len); }


x86 assembly (clang, -O0):
<MIDGARD_MD5_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
movsbl %al,%eax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
movzbl %al,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIDGARD_MD5_memset>:
mov    %edx,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @MIDGARD_MD5_memset(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 i8*, i8** %4
%8 = load i32, i32* %5
%9 = trunc i32 %8 to i8
%10 = sext i8 %9 to i32
%11 = trunc i32 %10 to i8
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
ret void
}

LLVM IR (-O2):
define void @MIDGARD_MD5_memset(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %1 to i8
%5 = zext i32 %2 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %5, i1 false)
ret void
}
int comment(int last, int current) {
  if (last == '/' && current == '*')
    return 1;
  else if (last == '*' && current == '/')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<comment>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2f,-0x8(%rbp)
jne    112a <comment+0x2a>
cmpl   $0x2a,-0xc(%rbp)
jne    112a <comment+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <comment+0x51>
cmpl   $0x2a,-0x8(%rbp)
jne    114a <comment+0x4a>
cmpl   $0x2f,-0xc(%rbp)
jne    114a <comment+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <comment+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment>:
mov    %edi,%eax
xor    $0x2f,%eax
mov    %esi,%ecx
xor    $0x2a,%ecx
or     %eax,%ecx
sete   %al
xor    $0x2a,%edi
xor    $0x2f,%esi
or     %edi,%esi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @comment(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 47
%4 = icmp eq i32 %1, 42
%5 = and i1 %3, %4
%6 = icmp eq i32 %0, 42
%7 = icmp eq i32 %1, 47
%8 = and i1 %6, %7
%9 = or i1 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int tolower(unsigned char);
int lowercase(const char *s) { return (tolower(*(unsigned char *)s)); }


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

x86 assembly (clang, -O2):
<lowercase>:
movzbl (%rdi),%edi
jmp    1030 <tolower@plt>

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

LLVM IR (-O2):
define i32 @lowercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @tolower(i8 zeroext %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void reject() { printf("Rejected\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"Rejected\00"
define void @reject() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int show_moose_elif_else() {}


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

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

LLVM IR (-O0):
define i32 @show_moose_elif_else() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @show_moose_elif_else() {
ret i32 undef
}
/* Variables and functions */
int W_OK;
int octave_access_w_ok(void) { return W_OK; }


x86 assembly (clang, -O0):
<octave_access_w_ok>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_access_w_ok>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@W_OK = global i32 0
define i32 @octave_access_w_ok() {
%1 = load i32, i32* @W_OK
ret i32 %1
}

LLVM IR (-O2):
@W_OK = global i32 0
define i32 @octave_access_w_ok() {
%1 = load i32, i32* @W_OK
ret i32 %1
}
int ft_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    return (c - 'A' + 'a');
  else
    return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <ft_tolower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <ft_tolower+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <ft_tolower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 65
%12 = add nsw i32 %11, 97
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  while (1) {
    printf("pid = %d, I am coming...\n", getpid());
    sleep(3);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [26 x i8] c"pid = %d, I am coming...\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 3)
br label %2
}

LLVM IR (-O2):
@.str = [26 x i8] c"pid = %d, I am coming...\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 3)
br label %1
}
void g_parse_debug_string() {}


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

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

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

LLVM IR (-O2):
define void @g_parse_debug_string() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ printf(char *, int);
void *wipemalloc(size_t count) {
  void *mem = malloc(count);
  if (mem != NULL) {
    memset(mem, 0, count);
  } else {
    printf("wipemalloc() failed to allocate %d bytes\n", (int)count);
  }
  return mem;
}


x86 assembly (clang, -O0):
<wipemalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <wipemalloc+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
jmp    117a <wipemalloc+0x4a>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wipemalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1153 <wipemalloc+0x23>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
jmp    1162 <wipemalloc+0x32>
lea    0xea6(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [42 x i8] c"wipemalloc() failed to allocate %d bytes\0A\00"
define i8* @wipemalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @memset(i8* %9, i32 0, i64 %10)
br label %16
12: ; preds = %1
%13 = load i64, i64* %2
%14 = trunc i64 %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %12, %8
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [42 x i8] c"wipemalloc() failed to allocate %d bytes\0A\00"
define i8* @wipemalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %9
6: ; preds = %1
%7 = trunc i64 %0 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %4
ret i8* %2
}
/* Variables and functions */
int strlen(char *);
char *get_pointer_at_position(char *pstring, int position) {
  int length = strlen(pstring);
  char *presult = NULL;
  if (position < length)
    presult = pstring + position;
  return presult;
}


x86 assembly (clang, -O0):
<get_pointer_at_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    114e <get_pointer_at_position+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pointer_at_position>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %ebp,%rdx
add    %rdx,%rbx
xor    %ecx,%ecx
cmp    %edx,%eax
cmovg  %rbx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @get_pointer_at_position(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, %1
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = select i1 %4, i8* %6, i8* null
ret i8* %7
}
/* Variables and functions */
scalar_t__ ft_isalpha(int);
int ft_toupper(int c) {
  if (ft_isalpha(c) && (c >= 'a'))
    c = c - ('a' - 'A');
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_isalpha@plt>
cmp    $0x0,%rax
je     1140 <ft_toupper+0x30>
cmpl   $0x61,-0x4(%rbp)
jl     1140 <ft_toupper+0x30>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_isalpha@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
cmp    $0x61,%ebx
cmovl  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ft_isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 97
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 32
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %6, %1
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = tail call i64 @ft_isalpha(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp sgt i32 %0, 96
%5 = and i1 %4, %3
%6 = add nsw i32 %0, -32
%7 = select i1 %5, i32 %6, i32 %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int factors_count(int);
void factors_count_test(void) { assert(factors_count(330) == 4); }


x86 assembly (clang, -O0):
<factors_count_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14a,%edi
call   1030 <factors_count@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<factors_count_test>:
push   %rax
mov    $0x14a,%edi
call   1030 <factors_count@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @factors_count_test() {
%1 = call i32 @factors_count(i32 330)
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
ret void
}

LLVM IR (-O2):
define void @factors_count_test() {
%1 = tail call i32 @factors_count(i32 330)
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xee() {
  Assert_real((iscntrl(238) == 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_iscntrl.c",
              1195, ("iscntrl should be 0 for 0xee"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xee>:
push   %rax
mov    $0xee,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ab,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xee\00"
define void @t_iscntrl_0xee() {
%1 = call i64 @iscntrl(i32 238)
%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 1195, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xee\00"
define void @t_iscntrl_0xee() {
%1 = tail call i64 @iscntrl(i32 238)
%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 1195, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float SteamAPI_vr_IVRControlPanel_GetIPD(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
  return 0;
}


x86 assembly (clang, -O0):
<SteamAPI_vr_IVRControlPanel_GetIPD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_vr_IVRControlPanel_GetIPD>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
call   1030 <xlogf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_vr_IVRControlPanel_GetIPD = [35 x i8] c"SteamAPI_vr_IVRControlPanel_GetIPD\00"
define float @SteamAPI_vr_IVRControlPanel_GetIPD(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_vr_IVRControlPanel_GetIPD, i64 0, i64 0), i8* %3)
ret float 0.000000e+00
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_vr_IVRControlPanel_GetIPD = [35 x i8] c"SteamAPI_vr_IVRControlPanel_GetIPD\00"
define float @SteamAPI_vr_IVRControlPanel_GetIPD(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_vr_IVRControlPanel_GetIPD, i64 0, i64 0), i8* %0)
ret float 0.000000e+00
}
char *dir_file_pathname(dir, file)
char const *dir, *file;
{
  char const *p = filename_lastdirchar(dir);
  return concat(dir, "/" + (p && !p[1]), file);
}


x86 assembly (clang, -O0):
<dir_file_pathname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <filename_lastdirchar@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1169 <dir_file_pathname+0x49>
mov    -0x18(%rbp),%rax
cmpb   $0x0,0x1(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
lea    0xe82(%rip),%rsi
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <concat@plt>
cltq
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_file_pathname>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <filename_lastdirchar@plt>
test   %eax,%eax
je     1143 <dir_file_pathname+0x23>
cltq
xor    %ebx,%ebx
cmpb   $0x0,0x1(%rax)
sete   %bl
lea    0xeb6(%rip),%rsi
add    %rbx,%rsi
mov    %r15,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <concat@plt>
cltq
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @dir_file_pathname(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @filename_lastdirchar to i32 (i8*, ...)*)(i8* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %3
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
%18 = xor i1 %17, true
br label %19
19: ; preds = %13, %2
%20 = phi i1 [ false, %2 ], [ %18, %13 ]
%21 = zext i1 %20 to i32
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 %22
%24 = load i8*, i8** %4
%25 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @concat to i32 (i8*, i8*, i8*, ...)*)(i8* %10, i8* %23, i8* %24)
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i8*
ret i8* %27
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @dir_file_pathname(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @filename_lastdirchar to i32 (i8*, ...)*)(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = inttoptr i64 %6 to i8*
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i64
br label %12
12: ; preds = %5, %2
%13 = phi i64 [ 0, %2 ], [ %11, %5 ]
%14 = getelementptr inbounds [2 x i8], [2 x i8]* @.str, i64 0, i64 %13
%15 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @concat to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* %14, i8* %1)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
ret i8* %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hello!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ luaA_passresults();
char *luaL_opt_lstr(int, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ lua_dofile(char *);
int /*<<< orphan*/ lua_pushusertag(int /*<<< orphan*/, int /*<<< orphan*/);
void internaldofile(void) {
  char *fname = (luaL_opt_lstr((1), (0), 0));
  if (lua_dofile(fname) == 0)
    if (luaA_passresults() == 0)
      lua_pushusertag(0, 0);
}


x86 assembly (clang, -O0):
<internaldofile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <luaL_opt_lstr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <lua_dofile@plt>
cmp    $0x0,%rax
jne    118c <internaldofile+0x4c>
mov    $0x0,%al
call   1060 <luaA_passresults@plt>
cmp    $0x0,%rax
jne    1187 <internaldofile+0x47>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <lua_pushusertag@plt>
jmp    118c <internaldofile+0x4c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internaldofile>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <luaL_opt_lstr@plt>
mov    %rax,%rdi
call   1050 <lua_dofile@plt>
test   %rax,%rax
jne    1168 <internaldofile+0x28>
xor    %eax,%eax
call   1060 <luaA_passresults@plt>
test   %rax,%rax
je     116a <internaldofile+0x2a>
pop    %rax
ret
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <lua_pushusertag@plt>

LLVM IR (-O0):
define void @internaldofile() {
%1 = alloca i8*
%2 = call i8* @luaL_opt_lstr(i32 1, i32 0, i32 0)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i64 @lua_dofile(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = call i64 (...) @luaA_passresults()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @lua_pushusertag(i32 0, i32 0)
br label %11
11: ; preds = %9, %6
br label %12
12: ; preds = %11, %0
ret void
}

LLVM IR (-O2):
define void @internaldofile() {
%1 = tail call i8* @luaL_opt_lstr(i32 1, i32 0, i32 0)
%2 = tail call i64 @lua_dofile(i8* %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i64 (...) @luaA_passresults()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @lua_pushusertag(i32 0, i32 0)
br label %9
9: ; preds = %4, %7, %0
ret void
}
int digit(int c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 16;
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 16;
  return 256;
}


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <digit+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <digit+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <digit+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     114e <digit+0x4e>
cmpl   $0x5a,-0x8(%rbp)
jg     114e <digit+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x10,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <digit+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     1173 <digit+0x73>
cmpl   $0x7a,-0x8(%rbp)
jg     1173 <digit+0x73>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x10,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <digit+0x7a>
movl   $0x100,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <digit+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x19,%eax
ja     1116 <digit+0x16>
add    $0xffffffcf,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffaf,%edi
cmp    $0x1a,%eax
mov    $0x100,%eax
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 26
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -49
br label %14
9: ; preds = %4
%10 = add i32 %0, -97
%11 = icmp ult i32 %10, 26
%12 = add nsw i32 %0, -81
%13 = select i1 %11, i32 %12, i32 256
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Type definitions */
struct jsonny_scanner_t {
  int dummy;
};

/* Variables and functions */
int jsonny_init_scanner_s(struct jsonny_scanner_t *, int, int);
int jsonny_init_scanner(struct jsonny_scanner_t *s) {
  return jsonny_init_scanner_s(s, 8196, 256);
}


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

x86 assembly (clang, -O2):
<jsonny_init_scanner>:
mov    $0x2004,%esi
mov    $0x100,%edx
jmp    1030 <jsonny_init_scanner_s@plt>

LLVM IR (-O0):
%struct.jsonny_scanner_t = type { i32 }
define i32 @jsonny_init_scanner(%struct.jsonny_scanner_t* %0) {
%2 = alloca %struct.jsonny_scanner_t*
store %struct.jsonny_scanner_t* %0, %struct.jsonny_scanner_t** %2
%3 = load %struct.jsonny_scanner_t*, %struct.jsonny_scanner_t** %2
%4 = call i32 @jsonny_init_scanner_s(%struct.jsonny_scanner_t* %3, i32 8196, i32 256)
ret i32 %4
}

LLVM IR (-O2):
%struct.jsonny_scanner_t = type { i32 }
define i32 @jsonny_init_scanner(%struct.jsonny_scanner_t* %0) {
%2 = tail call i32 @jsonny_init_scanner_s(%struct.jsonny_scanner_t* %0, i32 8196, i32 256)
ret i32 %2
}
void copy_velocities_cpu(int option) {
  if (option == 1) {
  } else {
  }
}


x86 assembly (clang, -O0):
<copy_velocities_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1116 <copy_velocities_cpu+0x16>
jmp    111b <copy_velocities_cpu+0x1b>
jmp    111b <copy_velocities_cpu+0x1b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @copy_velocities_cpu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @copy_velocities_cpu(i32 %0) {
ret void
}
const char *fpp_config_get_plugin_name(void) { return "libpdf.so frontend"; }


x86 assembly (clang, -O0):
<fpp_config_get_plugin_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpp_config_get_plugin_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"libpdf.so frontend\00"
define i8* @fpp_config_get_plugin_name() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"libpdf.so frontend\00"
define i8* @fpp_config_get_plugin_name() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long tbGetFileSize(FILE *fFile) {
  long Size;
  fseek(fFile, 0L, SEEK_END);
  Size = ftell(fFile);
  fseek(fFile, 0L, SEEK_SET);
  return Size;
}


x86 assembly (clang, -O0):
<tbGetFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbGetFileSize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @tbGetFileSize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i64 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i64 0, i32 %10)
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @tbGetFileSize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i64 0, i32 %5)
ret i64 %4
}
void my_verbose(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @my_verbose(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ client();
int32_t main(int32_t argc, char **argv) {
  argc, argv;
  client();
  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)
mov    $0x0,%al
call   1030 <client@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @client()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
int gca_search_int8(const void *aa, void *bb) {
  const int8_t a = *(const int8_t *)aa;
  const int8_t b = *(int8_t *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_search_int8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
cmp    -0x18(%rbp),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_search_int8>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rdx,%rcx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gca_search_int8(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
%16 = zext i1 %15 to i32
%17 = load i64, i64* %6
%18 = load i64, i64* %5
%19 = icmp sgt i64 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_search_int8(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}