xunge/DecIR huggingface dataset:
/* Type definitions */
typedef double time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(double *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
const char *tz_string(double t) {
  static char buf[16];
  time_t time = t / 1000;
  strftime(buf, sizeof buf, "%Z", localtime(&time));
  buf[sizeof buf - 1] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<tz_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%ecx
lea    0x2eeb(%rip),%rdi
mov    $0x10,%esi
lea    0xea7(%rip),%rdx
call   1040 <strftime@plt>
movb   $0x0,0x2ee2(%rip)
lea    0x2ecc(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tz_string>:
push   %rbx
sub    $0x10,%rsp
divsd  0xed3(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2efc(%rip),%rbx
lea    0xebd(%rip),%rdx
mov    %rbx,%rdi
mov    $0x10,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
movb   $0x0,0x2eee(%rip)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@tz_string.buf = internal global [16 x i8] zeroinitializer
@.str = [3 x i8] c"%Z\00"
define i8* @tz_string(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 1.000000e+03
store double %5, double* %3
%6 = call i32 @localtime(double* %3)
%7 = call i32 @strftime(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @tz_string.buf, i64 0, i64 0), i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
store i8 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @tz_string.buf, i64 0, i64 15)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @tz_string.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@tz_string.buf = internal global [16 x i8] zeroinitializer
@.str = [3 x i8] c"%Z\00"
define i8* @tz_string(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = fdiv double %0, 1.000000e+03
store double %4, double* %2
%5 = call i32 @localtime(double* %2)
%6 = call i32 @strftime(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @tz_string.buf, i64 0, i64 0), i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
store i8 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @tz_string.buf, i64 0, i64 15)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @tz_string.buf, i64 0, i64 0)
}
int __flsl(long x) {
  unsigned long value = x;
  int ls = 0;
  for (ls = 0; value; ls++) {
    value >>= 1;
  }
  return ls;
}


x86 assembly (clang, -O0):
<__flsl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1143 <__flsl+0x43>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111e <__flsl+0x1e>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__flsl>:
xor    %eax,%eax
test   %rdi,%rdi
je     111f <__flsl+0x1f>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%eax
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <__flsl+0x10>
ret

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

LLVM IR (-O2):
define i32 @__flsl(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
float UI_GetValue(int ownerDraw) { return 0; }


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

x86 assembly (clang, -O2):
<UI_GetValue>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @UI_GetValue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @UI_GetValue(i32 %0) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_imatrix(int **m, int nrl, int nrh, int ncl, int nch) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_imatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_imatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
mov    (%rdi,%rbx,8),%rax
movslq %ecx,%rcx
lea    (%rax,%rcx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
lea    (%r14,%rbx,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_imatrix(i32** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32*, i32** %0, i64 %6
%8 = load i32*, i32** %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = getelementptr inbounds i32, i32* %10, i64 -1
%12 = bitcast i32* %11 to i8*
%13 = tail call i32 @free(i8* %12)
%14 = getelementptr inbounds i32*, i32** %7, i64 -1
%15 = bitcast i32** %14 to i8*
%16 = tail call i32 @free(i8* %15)
ret void
}
void os_daemonize(void) {}


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

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

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

LLVM IR (-O2):
define void @os_daemonize() {
ret void
}
void UART_UartRestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @UART_UartRestoreConfig() {
ret void
}
void ComputeSumSquareErrorPlane() {}


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

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

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

LLVM IR (-O2):
define void @ComputeSumSquareErrorPlane() {
ret void
}
msglist(s) char **s;
{
  while (*s)
    printf("%s\n", *s++);
}


x86 assembly (clang, -O0):
<msglist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <msglist+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111c <msglist+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msglist>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <msglist+0x21>
add    $0x8,%rbx
call   1030 <puts@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <msglist+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @msglist(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
br label %4
4: ; preds = %8, %1
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i8**, i8*** %3
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %3
%11 = load i8*, i8** %9
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @msglist(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = tail call i32 @puts(i8* %5)
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_pidfd_send_signal;
int syscall(int /*<<< orphan*/, int, int, int /*<<< orphan*/ *, unsigned int);
int sys_pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
                          unsigned int flags) {
  return syscall(__NR_pidfd_send_signal, pidfd, sig, info, flags);
}


x86 assembly (clang, -O0):
<sys_pidfd_send_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_pidfd_send_signal>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_pidfd_send_signal = global i32 0
define i32 @sys_pidfd_send_signal(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* @__NR_pidfd_send_signal
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = call i32 @syscall(i32 %9, i32 %10, i32 %11, i32* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@__NR_pidfd_send_signal = global i32 0
define i32 @sys_pidfd_send_signal(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = load i32, i32* @__NR_pidfd_send_signal
%6 = tail call i32 @syscall(i32 %5, i32 %0, i32 %1, i32* %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  switch (sizeof(void *)) {
  case 4:
    printf("32");
    break;
  case 8:
    printf("64");
    break;
  default:
    printf("Unknown");
  }
  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 = [3 x i8] c"64\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"64\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int rom_present(char *);
int ati18800_available() { return rom_present("vgaedge16.vbi"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"vgaedge16.vbi\00"
define i32 @ati18800_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"vgaedge16.vbi\00"
define i32 @ati18800_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ idle_metric_register_blame_source();
void __attribute__((constructor)) init_xlomp_plugin(void) {
  idle_metric_register_blame_source();
}


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init_xlomp_plugin, i8* null }]
define void @init_xlomp_plugin() {
%1 = call i32 (...) @idle_metric_register_blame_source()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init_xlomp_plugin, i8* null }]
define void @init_xlomp_plugin() {
%1 = tail call i32 (...) @idle_metric_register_blame_source()
ret void
}
/* Type definitions */
struct _Locale_monetary {
  int dummy;
};

/* Variables and functions */
char _Locale_mon_decimal_point(struct _Locale_monetary *lmon) { return '.'; }


x86 assembly (clang, -O0):
<_Locale_mon_decimal_point>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x2e,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_mon_decimal_point>:
mov    $0x2e,%al
ret

LLVM IR (-O0):
%struct._Locale_monetary = type { i32 }
define signext i8 @_Locale_mon_decimal_point(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret i8 46
}

LLVM IR (-O2):
%struct._Locale_monetary = type { i32 }
define signext i8 @_Locale_mon_decimal_point(%struct._Locale_monetary* nocapture readnone %0) {
ret i8 46
}
int test(int a, int b, char flags[]) {
  int ret;
  __asm__ __volatile__("mov %3, %%edx\n\t"
                       "movw %w1, %%ax\n\t"
                       "movw %w2, %%cx\n\t"
                       "addw %%cx, %%ax\n\t"
                       "seto (%%edx)\n\t"
                       "sets 1(%%edx)\n\t"
                       "setz 2(%%edx)\n\t"
                       "setp 3(%%edx)\n\t"
                       "setc 4(%%edx)\n\t"
                       "movzwl %%ax, %%eax\n\t"
                       "mov %%eax, %0\n\t"
                       : "=m"(ret)
                       : "m"(a), "m"(b), "m"(flags)
                       : "eax", "ecx", "edx", "memory");
  return ret;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x4(%rbp),%ax
mov    -0x8(%rbp),%cx
add    %cx,%ax
seto   (%edx)
sets   0x1(%edx)
sete   0x2(%edx)
setp   0x3(%edx)
setb   0x4(%edx)
movzwl %ax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %edi,-0xc(%rsp)
mov    %esi,-0x10(%rsp)
mov    %rdx,-0x8(%rsp)
mov    -0x8(%rsp),%edx
mov    -0xc(%rsp),%ax
mov    -0x10(%rsp),%cx
add    %cx,%ax
seto   (%edx)
sets   0x1(%edx)
sete   0x2(%edx)
setp   0x3(%edx)
setb   0x4(%edx)
movzwl %ax,%eax
mov    %eax,-0x14(%rsp)
mov    -0x14(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = bitcast i32* %7 to i8*
%9 = load i32, i32* %7
ret i32 %9
}
void c_updatelcd() { ; }


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

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

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

LLVM IR (-O2):
define void @c_updatelcd() {
ret void
}
void prog_timeout(int sig) {
  asm("mov $1, %eax;"
      "mov $1, %ebx;"
      "int $0x80");
}


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

x86 assembly (clang, -O2):
<prog_timeout>:
mov    $0x1,%eax
mov    $0x1,%ebx
int    $0x80
ret

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

LLVM IR (-O2):
define void @prog_timeout(i32 %0) {
tail call void asm sideeffect "mov $$1, %eax;mov $$1, %ebx;int $$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void undefined(char *varname) {
  printf("Reference to undefined variable %s\n", varname);
  exit(1);
}


x86 assembly (clang, -O0):
<undefined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [36 x i8] c"Reference to undefined variable %s\0A\00"
define void @undefined(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [36 x i8] c"Reference to undefined variable %s\0A\00"
define void @undefined(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
long double fun_quad(long double a, long double b) { return a; }


x86 assembly (clang, -O0):
<fun_quad>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_quad>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @fun_quad(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
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @fun_quad(x86_fp80 returned %0, x86_fp80 %1) {
ret x86_fp80 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf(
      "Usage:	getverse -t <translation> [-f format] [<reference>]\n"
      "	getverse [-h | -?]\n"
      "Options:\n"
      "	-t	A Bible translation you have installed in SWORD (e.g. KJV)\n"
      "	-f	A format string that will determine the format of the output\n"
      "		 Defaults to '%%p'\n"
      "	-h\n"
      "	-?	Display this message and exit"
      "\n"
      "Format variables:\n"
      "	%%p	The passage text\n"
      "	%%t	The translation name\n"
      "	%%r	The supplied reference\n"
      "	%%%%	A literal %% character\n"
      "\n"
      "If no reference is supplied, getverse tries to read from stdin.\n");
}


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

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

LLVM IR (-O0):
@.str = [464 x i8] c"Usage:\09getverse -t <translation> [-f format] [<reference>]\0A\09getverse [-h | -?]\0AOptions:\0A\09-t\09A Bible translation you have installed in SWORD (e.g. KJV)\0A\09-f\09A format string that will determine the format of the output\0A\09\09 Defaults to '%%p'\0A\09-h\0A\09-?\09Display this message and exit\0AFormat variables:\0A\09%%p\09The passage text\0A\09%%t\09The translation name\0A\09%%r\09The supplied reference\0A\09%%%%\09A literal %% character\0A\0AIf no reference is supplied, getverse tries to read from stdin.\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([464 x i8], [464 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [464 x i8] c"Usage:\09getverse -t <translation> [-f format] [<reference>]\0A\09getverse [-h | -?]\0AOptions:\0A\09-t\09A Bible translation you have installed in SWORD (e.g. KJV)\0A\09-f\09A format string that will determine the format of the output\0A\09\09 Defaults to '%%p'\0A\09-h\0A\09-?\09Display this message and exit\0AFormat variables:\0A\09%%p\09The passage text\0A\09%%t\09The translation name\0A\09%%r\09The supplied reference\0A\09%%%%\09A literal %% character\0A\0AIf no reference is supplied, getverse tries to read from stdin.\0A\00"
define void @printUsage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([464 x i8], [464 x i8]* @.str, i64 0, i64 0))
ret void
}
void *plat_gvideo_flip(void) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @plat_gvideo_flip() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ remove_all_robot_actions();
cmd_unactionall() { remove_all_robot_actions(); }


x86 assembly (clang, -O0):
<cmd_unactionall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <remove_all_robot_actions@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmd_unactionall() {
%1 = alloca i32
%2 = call i32 (...) @remove_all_robot_actions()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @cmd_unactionall() {
%1 = tail call i32 (...) @remove_all_robot_actions()
ret i32 undef
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
void *myCalloc(int nItems, int itemSize) {
  void *p;
  p = calloc(nItems, itemSize);
  if (p == NULL)
    fprintf(stderr, "Memory error on calloc(%d,%d)\n", nItems, itemSize);
  return (p);
}


x86 assembly (clang, -O0):
<myCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1163 <myCalloc+0x43>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myCalloc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <myCalloc+0x30>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1040 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Memory error on calloc(%d,%d)\0A\00"
define i8* @myCalloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i8* @calloc(i32 %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
br label %16
16: ; preds = %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Memory error on calloc(%d,%d)\0A\00"
define noalias i8* @myCalloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %8
8: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void quit(void) { exit(0); }


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @quit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(unsigned char *);
void spy_mach_write_to_4(unsigned char *b, uint32_t data) {
  assert(b);
  b[0] = (unsigned char)(data >> 24);
  b[1] = (unsigned char)(data >> 16);
  b[2] = (unsigned char)(data >> 8);
  b[3] = (unsigned char)(data);
}


x86 assembly (clang, -O0):
<spy_mach_write_to_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spy_mach_write_to_4>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <assert@plt>
bswap  %ebx
mov    %ebx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @spy_mach_write_to_4(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 = call i32 @assert(i8* %5)
%7 = load i32, i32* %4
%8 = ashr i32 %7, 24
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 16
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 8
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
ret void
}

LLVM IR (-O2):
define void @spy_mach_write_to_4(i8* %0, i32 %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = lshr i32 %1, 24
%5 = trunc i32 %4 to i8
store i8 %5, i8* %0
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %1 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %12, i8* %13
ret void
}
double eval_gen(double *u) {
  double ret_val = 0.0;
  ret_val += 0.459697694131860;
  ret_val += 0.488876937571022 * (u[0]) + 0.352392910067197 * (u[1]);
  return ret_val;
}


x86 assembly (clang, -O0):
<eval_gen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xef8(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xed2(%rip),%xmm1
mulsd  0x8(%rax),%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_gen>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  0xeef(%rip),%xmm1
mulsd  0xeef(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xeeb(%rip),%xmm0
ret

LLVM IR (-O0):
define double @eval_gen(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
store double 0.000000e+00, double* %3
%4 = load double, double* %3
%5 = fadd double %4, 0x3FDD6BAFE095F2E4
store double %5, double* %3
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = fmul double 0x3FD68D9AFE052D24, %11
%13 = call double @llvm.fmuladd.f64(double 0x3FDF49C27EA8B710, double %8, double %12)
%14 = load double, double* %3
%15 = fadd double %14, %13
store double %15, double* %3
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @eval_gen(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, 0x3FD68D9AFE052D24
%6 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FDF49C27EA8B710, double %5)
%7 = fadd double %6, 0x3FDD6BAFE095F2E4
ret double %7
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t find_trailing_zero_num2(uint16_t num) {
  uint16_t i, zero_cnt = 0;
  if (num < 5) {
    return 0;
  }
  for (i = 5; i <= num; i *= 5) {
    zero_cnt += num / i;
  }
  return zero_cnt;
}


x86 assembly (clang, -O0):
<find_trailing_zero_num2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1124 <find_trailing_zero_num2+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1156 <find_trailing_zero_num2+0x56>
movl   $0x5,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1150 <find_trailing_zero_num2+0x50>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0x5,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112b <find_trailing_zero_num2+0x2b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_trailing_zero_num2>:
xor    %ecx,%ecx
cmp    $0x5,%edi
jl     111e <find_trailing_zero_num2+0x1e>
mov    $0x5,%esi
xor    %ecx,%ecx
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
add    %eax,%ecx
lea    (%rsi,%rsi,4),%esi
cmp    %edi,%esi
jle    1110 <find_trailing_zero_num2+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @find_trailing_zero_num2(i32 %0) {
%2 = icmp slt i32 %0, 5
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 5, %1 ]
%6 = sdiv i32 %0, %5
%7 = add nsw i32 %6, %4
%8 = mul nsw i32 %5, 5
%9 = icmp sgt i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  while (*s != 0) {
    if (*s == (char)c)
      return (char *)s;
    s++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <strchr+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    113d <strchr+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <strchr+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ null, %2 ], [ null, %13 ], [ %10, %8 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x20() {
  Assert_real((isxdigit(32) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              165, ("isxdigit should be 0 for  "));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for \00"
define void @t_isxdigit_0x20() {
%1 = call i64 @isxdigit(i32 32)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 165, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for \00"
define void @t_isxdigit_0x20() {
%1 = tail call i64 @isxdigit(i32 32)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 165, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gr_getFontDetails(int /*<<< orphan*/ *, unsigned int *,
                                     unsigned int *);
void gr_font_size(int *x, int *y) {
  gr_getFontDetails(NULL, (unsigned *)y, (unsigned *)x);
}


x86 assembly (clang, -O0):
<gr_font_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <gr_getFontDetails@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gr_font_size>:
mov    %rdi,%rdx
xor    %edi,%edi
jmp    1030 <gr_getFontDetails@plt>

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

LLVM IR (-O2):
define void @gr_font_size(i32* %0, i32* %1) {
%3 = tail call i32 @gr_getFontDetails(i32* null, i32* %1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void doFloatingPointException() {
  int a = 0;
  int b = 1;
  printf("%d", b / a);
}


x86 assembly (clang, -O0):
<doFloatingPointException>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @doFloatingPointException() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %1
%5 = sdiv i32 %3, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @doFloatingPointException() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 poison)
ret void
}
/* Variables and functions */
float floor(float);
int /*<<< orphan*/ printf(char *, float, float);
void roundToInteger(float number) {
  float rounded = floor(number + .5);
  printf("original = %f  Rounded to Integer = %.0f\n", number, rounded);
}


x86 assembly (clang, -O0):
<roundToInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <floor@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundToInteger>:
push   %rax
movaps %xmm0,%xmm1
movss  %xmm0,0x4(%rsp)
movss  0xece(%rip),%xmm0
addss  %xmm1,%xmm0
call   1040 <floorf@plt>
movaps %xmm0,%xmm1
lea    0xebf(%rip),%rdi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"original = %f Rounded to Integer = %.0f\0A\00"
define void @roundToInteger(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fadd double %5, 5.000000e-01
%7 = fptrunc double %6 to float
%8 = call float @floor(float %7)
store float %8, float* %3
%9 = load float, float* %2
%10 = load float, float* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), float %9, float %10)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"original = %f Rounded to Integer = %.0f\0A\00"
define void @roundToInteger(float %0) {
%2 = fadd float %0, 5.000000e-01
%3 = tail call float @llvm.floor.f32(float %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), float %0, float %3)
ret void
}
int execute_modify_ldt() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_modify_ldt() {
ret i32 0
}
/* Variables and functions */
scalar_t__ output_check(int);
int /*<<< orphan*/ output_timing();
void problem_output() {
  if (output_check(2. * 3.14159265358979323846)) {
    output_timing();
  }
}


x86 assembly (clang, -O0):
<problem_output>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1040 <output_check@plt>
cmp    $0x0,%rax
je     113f <problem_output+0x1f>
mov    $0x0,%al
call   1030 <output_timing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem_output>:
push   %rax
mov    $0x6,%edi
call   1040 <output_check@plt>
test   %rax,%rax
je     1138 <problem_output+0x18>
xor    %eax,%eax
pop    %rcx
jmp    1030 <output_timing@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @problem_output() {
%1 = call i64 @output_check(i32 6)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @problem_output() {
%1 = tail call i64 @output_check(i32 6)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
ret void
}
unsigned int hide_uint(unsigned int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @hide_uint(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
bool nrf51_errata_73(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_73() {
ret i32 0
}
/* Type definitions */
struct boolean {
  int dummy;
};

/* Variables and functions */
scalar_t__ generic_ptr(int, int);
struct boolean *boolean_ptr(int number) {
  return ((struct boolean *)generic_ptr(49, number));
}


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

x86 assembly (clang, -O2):
<boolean_ptr>:
mov    %edi,%esi
mov    $0x31,%edi
jmp    1030 <generic_ptr@plt>

LLVM IR (-O0):
%struct.boolean = type { i32 }
define %struct.boolean* @boolean_ptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @generic_ptr(i32 49, i32 %3)
%5 = inttoptr i64 %4 to %struct.boolean*
ret %struct.boolean* %5
}

LLVM IR (-O2):
%struct.boolean = type { i32 }
define %struct.boolean* @boolean_ptr(i32 %0) {
%2 = tail call i64 @generic_ptr(i32 49, i32 %0)
%3 = inttoptr i64 %2 to %struct.boolean*
ret %struct.boolean* %3
}
/* Type definitions */
struct smack_accesses {
  int dummy;
};

/* Variables and functions */
int accesses_apply(struct smack_accesses *, int /*<<< orphan*/);
int smack_accesses_apply(struct smack_accesses *handle) {
  return accesses_apply(handle, 0);
}


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

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

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

LLVM IR (-O2):
%struct.smack_accesses = type { i32 }
define i32 @smack_accesses_apply(%struct.smack_accesses* %0) {
%2 = tail call i32 @accesses_apply(%struct.smack_accesses* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void PWMOutputFaultLevel(uint32_t ui32Base, uint32_t ui32PWMOutBits,
                         bool bDriveHigh) {
  ;

  ;
  if (bDriveHigh == true) {
    (*((volatile uint32_t *)(ui32Base + 0x00000024))) |= ui32PWMOutBits;
  } else {
    (*((volatile uint32_t *)(ui32Base + 0x00000024))) &= ~(ui32PWMOutBits);
  }
}


x86 assembly (clang, -O0):
<PWMOutputFaultLevel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1131 <PWMOutputFaultLevel+0x31>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x24(%rax)
jmp    1148 <PWMOutputFaultLevel+0x48>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x24(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMOutputFaultLevel>:
mov    %rdi,-0x10(%rsp)
mov    %rsi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x1,%edx
jne    111e <PWMOutputFaultLevel+0x1e>
mov    -0x10(%rsp),%rcx
or     %rax,0x24(%rcx)
ret
not    %rax
mov    -0x10(%rsp),%rcx
and    %rax,0x24(%rcx)
ret

LLVM IR (-O0):
define void @PWMOutputFaultLevel(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load volatile i64, i64* %5
%11 = load volatile i64, i64* %4
%12 = add nsw i64 %11, 36
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
br label %24
16: ; preds = %3
%17 = load volatile i64, i64* %5
%18 = xor i64 %17, -1
%19 = load volatile i64, i64* %4
%20 = add nsw i64 %19, 36
%21 = inttoptr i64 %20 to i64*
%22 = load volatile i64, i64* %21
%23 = and i64 %22, %18
store volatile i64 %23, i64* %21
br label %24
24: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
define void @PWMOutputFaultLevel(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
%6 = icmp eq i32 %2, 1
%7 = load volatile i64, i64* %5
br i1 %6, label %8, label %14
8: ; preds = %3
%9 = load volatile i64, i64* %4
%10 = add nsw i64 %9, 36
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %7
store volatile i64 %13, i64* %11
br label %21
14: ; preds = %3
%15 = xor i64 %7, -1
%16 = load volatile i64, i64* %4
%17 = add nsw i64 %16, 36
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = and i64 %19, %15
store volatile i64 %20, i64* %18
br label %21
21: ; preds = %14, %8
ret void
}