xunge/DecIR huggingface dataset:
/* Variables and functions */
int fabs(double);
double fmod(double, double);
double swe_degnorm(double x) {
  double y;
  y = fmod(x, 360.0);
  if (fabs(y) < 1e-13)
    y = 0;
  if (y < 0.0)
    y += 360.0;
  return (y);
}


x86 assembly (clang, -O0):
<swe_degnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xea6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    116c <swe_degnorm+0x4c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    118c <swe_degnorm+0x6c>
movsd  0xe86(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swe_degnorm>:
push   %rax
movsd  0xed7(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,(%rsp)
call   1040 <fabs@plt>
xorpd  %xmm2,%xmm2
xorpd  %xmm1,%xmm1
test   %eax,%eax
jle    1149 <swe_degnorm+0x29>
movsd  (%rsp),%xmm1
movsd  0xeaf(%rip),%xmm3
addsd  %xmm1,%xmm3
movapd %xmm1,%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm3
andnpd %xmm1,%xmm0
orpd   %xmm3,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @swe_degnorm(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @fmod(double %4, double 3.600000e+02)
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 @fabs(double %6)
%8 = sitofp i32 %7 to double
%9 = fcmp olt double %8, 1.000000e-13
br i1 %9, label %10, label %11
10: ; preds = %1
store double 0.000000e+00, double* %3
br label %11
11: ; preds = %10, %1
%12 = load double, double* %3
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load double, double* %3
%16 = fadd double %15, 3.600000e+02
store double %16, double* %3
br label %17
17: ; preds = %14, %11
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @swe_degnorm(double %0) {
%2 = tail call double @fmod(double %0, double 3.600000e+02)
%3 = tail call i32 @fabs(double %2)
%4 = icmp slt i32 %3, 1
%5 = select i1 %4, double 0.000000e+00, double %2
%6 = fcmp olt double %5, 0.000000e+00
%7 = fadd double %5, 3.600000e+02
%8 = select i1 %6, double %7, double %5
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponseGeneric(void const *, char *, char *, char *);
void UpnpResponse_MediaRenderer_AVTransport_Stop(const void *UPnPToken) {
  UpnpResponseGeneric(UPnPToken, "urn:schemas-upnp-org:service:AVTransport:1",
                      "Stop", "");
}


x86 assembly (clang, -O0):
<UpnpResponse_MediaRenderer_AVTransport_Stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xefd(%rip),%rdx
lea    0xef5(%rip),%rcx
call   1030 <UpnpResponseGeneric@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpResponse_MediaRenderer_AVTransport_Stop>:
lea    0xee9(%rip),%rsi
lea    0xf0d(%rip),%rdx
lea    0xf05(%rip),%rcx
jmp    1030 <UpnpResponseGeneric@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"urn:schemas-upnp-org:service:AVTransport:1\00"
@.str.1 = [5 x i8] c"Stop\00"
@.str.2 = [1 x i8] zeroinitializer
define void @UpnpResponse_MediaRenderer_AVTransport_Stop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @UpnpResponseGeneric(i8* %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"urn:schemas-upnp-org:service:AVTransport:1\00"
@.str.1 = [5 x i8] c"Stop\00"
@.str.2 = [1 x i8] zeroinitializer
define void @UpnpResponse_MediaRenderer_AVTransport_Stop(i8* %0) {
%2 = tail call i32 @UpnpResponseGeneric(i8* %0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void repeat_char(int counter, char charachter) {
  while (counter != 0) {
    putchar(charachter);
    counter--;
  }
}


x86 assembly (clang, -O0):
<repeat_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <repeat_char+0x32>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1121 <repeat_char+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeat_char>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     112c <repeat_char+0x1c>
mov    %edi,%ebx
movsbl %sil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <repeat_char+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @repeat_char(i32 %0, i8 signext %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = tail call i32 @putchar(i8 signext %1)
%7 = add nsw i32 %5, -1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
dwalltime() {
  double sec;
  struct timeval tv;
  gettimeofday(&tv, NULL);
  sec = tv.tv_sec + tv.tv_usec / 1000000.0;
  return sec;
}


x86 assembly (clang, -O0):
<dwalltime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwalltime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define i32 @dwalltime() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
store double %9, double* %1
%10 = load double, double* %1
%11 = fptosi double %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define i32 @dwalltime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
%10 = fptosi double %9 to i32
ret i32 %10
}
void _icache_flush_all(void) { ; }


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

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

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

LLVM IR (-O2):
define void @_icache_flush_all() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xd2() {
  Assert_real((isalpha(210) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1055, ("isalpha should be 0 for 0xd2"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xd2\00"
define void @t_isalpha_0xd2() {
%1 = tail call i64 @isalpha(i32 210)
%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 1055, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct fdi {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ track_atari_st(struct fdi *, int);
void track_atari_st_10(struct fdi *fdi) { track_atari_st(fdi, 10); }


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

x86 assembly (clang, -O2):
<track_atari_st_10>:
mov    $0xa,%esi
jmp    1030 <track_atari_st@plt>

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

LLVM IR (-O2):
%struct.fdi = type { i32 }
define void @track_atari_st_10(%struct.fdi* %0) {
%2 = tail call i32 @track_atari_st(%struct.fdi* %0, i32 10)
ret void
}
/* Variables and functions */
unsigned int strlen(char const *);
int /*<<< orphan*/ uart_putc(char const);
void puts(const char *str) {
  unsigned int i, n = strlen(str);
  for (i = 0; i < n; uart_putc(str[i++]))
    ;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    116f <puts+0x4f>
jmp    1150 <puts+0x30>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_putc@plt>
jmp    113f <puts+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
je     1153 <puts+0x33>
mov    %eax,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
add    $0x1,%rbx
call   1030 <uart_putc@plt>
cmp    %rbx,%r15
jne    1140 <puts+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = tail call i32 @uart_putc(i8 signext %10)
%12 = icmp eq i64 %8, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__29__IO__set();
void Msp430GpioC__9__HplGeneralIO__set(void) {
  HplMsp430GeneralIOP__29__IO__set();
}


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

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

LLVM IR (-O0):
define void @Msp430GpioC__9__HplGeneralIO__set() {
%1 = call i32 (...) @HplMsp430GeneralIOP__29__IO__set()
ret void
}

LLVM IR (-O2):
define void @Msp430GpioC__9__HplGeneralIO__set() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__29__IO__set()
ret void
}
int math_abs(int n) { return n < 0 ? -n : n; }


x86 assembly (clang, -O0):
<math_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <math_abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <math_abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @math_abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @math_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long root;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
void set_XButtonPressedEvent_root(void *_p, unsigned long _v) {
  ((XButtonPressedEvent *)_p)->root = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XButtonPressedEvent_root(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lib_free(char *);
int /*<<< orphan*/ util_addline(char **, char *);
void util_addline_free(char **list, char *line) {
  util_addline(list, line);
  lib_free(line);
}


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

x86 assembly (clang, -O2):
<util_addline_free>:
push   %rbx
mov    %rsi,%rbx
call   1040 <util_addline@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <lib_free@plt>

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

LLVM IR (-O2):
define void @util_addline_free(i8** %0, i8* %1) {
%3 = tail call i32 @util_addline(i8** %0, i8* %1)
%4 = tail call i32 @lib_free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ auto_state();
int /*<<< orphan*/ function_static_state();
int /*<<< orphan*/ module_global_state();
int /*<<< orphan*/ module_static_state();
int /*<<< orphan*/ register_state();
int main(int argc, char **argv) {
  register_state();
  auto_state();
  function_static_state();
  module_static_state();
  module_global_state();
  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   1040 <register_state@plt>
mov    $0x0,%al
call   1030 <auto_state@plt>
mov    $0x0,%al
call   1060 <function_static_state@plt>
mov    $0x0,%al
call   1050 <module_static_state@plt>
mov    $0x0,%al
call   1070 <module_global_state@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <register_state@plt>
xor    %eax,%eax
call   1030 <auto_state@plt>
xor    %eax,%eax
call   1060 <function_static_state@plt>
xor    %eax,%eax
call   1050 <module_static_state@plt>
xor    %eax,%eax
call   1070 <module_global_state@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 = call i32 (...) @register_state()
%7 = call i32 (...) @auto_state()
%8 = call i32 (...) @function_static_state()
%9 = call i32 (...) @module_static_state()
%10 = call i32 (...) @module_global_state()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @register_state()
%4 = tail call i32 (...) @auto_state()
%5 = tail call i32 (...) @function_static_state()
%6 = tail call i32 (...) @module_static_state()
%7 = tail call i32 (...) @module_global_state()
ret i32 0
}
void atomic_dec(volatile int *num) {
  __asm__ __volatile__("lock decl %0" : "=m"(*num));
}


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

x86 assembly (clang, -O2):
<atomic_dec>:
lock decl (%rdi)
ret

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

LLVM IR (-O2):
define void @atomic_dec(i32* %0) {
tail call void asm sideeffect "lock decl $0", "=*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, char);
int zomp_writeChar(void *file, char val) {
  return fprintf((FILE *)file, "%c", val);
}


x86 assembly (clang, -O0):
<zomp_writeChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movsbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zomp_writeChar>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @zomp_writeChar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i8, i8* %4
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @zomp_writeChar(i8* nocapture %0, i8 signext %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %1)
ret i32 %4
}
float *fvector(nl, nh)
int nl, nh;
{
  float *v;
  v = (float *)malloc((unsigned)(nh - nl + 1) * sizeof(float));
  return (v - nl);
}


x86 assembly (clang, -O0):
<fvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
shl    $0x2,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvector>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
lea    0x1(%rsi),%edi
shl    $0x2,%rdi
call   1030 <malloc@plt>
movslq %ebx,%rcx
shl    $0x2,%rcx
sub    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias float* @fvector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = zext i32 %4 to i64
%6 = shl nuw nsw i64 %5, 2
%7 = tail call i8* @malloc(i64 %6)
%8 = bitcast i8* %7 to float*
%9 = sext i32 %0 to i64
%10 = sub nsw i64 0, %9
%11 = getelementptr inbounds float, float* %8, i64 %10
ret float* %11
}
int ordering_eq(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @ordering_eq() {
ret i32 0
}
/* Variables and functions */
double **getData(char *, int, int);
void readInMiniData(double ***trainingData, int minTestPicNum) {
  char trainingDataPath[100] = "data/train.csv";
  int trainingPicNum = minTestPicNum;
  (*trainingData) = getData(trainingDataPath, trainingPicNum, 785);
}


x86 assembly (clang, -O0):
<readInMiniData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
mov    $0x311,%edx
call   1030 <getData@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInMiniData>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rbx
movaps 0xf31(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%rdi
mov    $0x311,%edx
call   1030 <getData@plt>
mov    %rax,(%rbx)
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.readInMiniData.trainingDataPath = [100 x i8] c"data/train.csv\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @readInMiniData(double*** %0, i32 %1) {
%3 = alloca double***
%4 = alloca i32
%5 = alloca [100 x i8]
%6 = alloca i32
store double*** %0, double**** %3
store i32 %1, i32* %4
%7 = bitcast [100 x i8]* %5 to i8*
%8 = load i32, i32* %4
store i32 %8, i32* %6
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = load i32, i32* %6
%11 = call double** @getData(i8* %9, i32 %10, i32 785)
%12 = load double***, double**** %3
store double** %11, double*** %12
ret void
}

LLVM IR (-O2):
@__const.readInMiniData.trainingDataPath = [100 x i8] c"data/train.csv\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @readInMiniData(double*** nocapture writeonly %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call double** @getData(i8* %4, i32 %1, i32 785)
store double** %5, double*** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ caguard2l(float *, int, int, int, int);
void caguard2l_(float *q, int *nx, int *ny, int *nxe, int *nye) {
  caguard2l(q, *nx, *ny, *nxe, *nye);
  return;
}


x86 assembly (clang, -O0):
<caguard2l_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
call   1030 <caguard2l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caguard2l_>:
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
mov    (%r8),%r8d
jmp    1030 <caguard2l@plt>

LLVM IR (-O0):
define void @caguard2l_(float* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca float*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store float* %0, float** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = load i32*, i32** %10
%19 = load i32, i32* %18
%20 = call i32 @caguard2l(float* %11, i32 %13, i32 %15, i32 %17, i32 %19)
ret void
}

LLVM IR (-O2):
define void @caguard2l_(float* %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4) {
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = tail call i32 @caguard2l(float* %0, i32 %6, i32 %7, i32 %8, i32 %9)
ret void
}
int HelpItem6(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem6() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lcd_set_type_command();
int /*<<< orphan*/ lcd_write_byte(int);
void nklcd_start_blinking() {
  lcd_set_type_command();
  lcd_write_byte(0x08 | 0x04 | 0x02 | 0x01);
}


x86 assembly (clang, -O0):
<nklcd_start_blinking>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lcd_set_type_command@plt>
mov    $0xf,%edi
call   1040 <lcd_write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nklcd_start_blinking>:
push   %rax
xor    %eax,%eax
call   1030 <lcd_set_type_command@plt>
mov    $0xf,%edi
pop    %rax
jmp    1040 <lcd_write_byte@plt>

LLVM IR (-O0):
define void @nklcd_start_blinking() {
%1 = call i32 (...) @lcd_set_type_command()
%2 = call i32 @lcd_write_byte(i32 15)
ret void
}

LLVM IR (-O2):
define void @nklcd_start_blinking() {
%1 = tail call i32 (...) @lcd_set_type_command()
%2 = tail call i32 @lcd_write_byte(i32 15)
ret void
}
/* Variables and functions */
int KIONIX_ACCEL_disable_all();
int /*<<< orphan*/ KIONIX_ACCEL_disable_interrupt();
int KIONIX_ACCEL_disable_outputs();
int KIONIX_ACCEL_sleep();
int KIONIX_ACCEL_deinit(void) {
  int res = 0;
  res = KIONIX_ACCEL_disable_outputs();
  KIONIX_ACCEL_disable_interrupt();
  res |= KIONIX_ACCEL_disable_all();
  res |= KIONIX_ACCEL_sleep();
  ;
  return res;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <KIONIX_ACCEL_disable_outputs@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <KIONIX_ACCEL_disable_interrupt@plt>
mov    $0x0,%al
call   1040 <KIONIX_ACCEL_disable_all@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <KIONIX_ACCEL_sleep@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_deinit>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <KIONIX_ACCEL_disable_outputs@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <KIONIX_ACCEL_disable_interrupt@plt>
xor    %eax,%eax
call   1040 <KIONIX_ACCEL_disable_all@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1050 <KIONIX_ACCEL_sleep@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_deinit() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @KIONIX_ACCEL_disable_outputs()
store i32 %2, i32* %1
%3 = call i32 (...) @KIONIX_ACCEL_disable_interrupt()
%4 = call i32 (...) @KIONIX_ACCEL_disable_all()
%5 = load i32, i32* %1
%6 = or i32 %5, %4
store i32 %6, i32* %1
%7 = call i32 (...) @KIONIX_ACCEL_sleep()
%8 = load i32, i32* %1
%9 = or i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_deinit() {
%1 = tail call i32 (...) @KIONIX_ACCEL_disable_outputs()
%2 = tail call i32 (...) @KIONIX_ACCEL_disable_interrupt()
%3 = tail call i32 (...) @KIONIX_ACCEL_disable_all()
%4 = or i32 %3, %1
%5 = tail call i32 (...) @KIONIX_ACCEL_sleep()
%6 = or i32 %4, %5
ret i32 %6
}
/* Type definitions */
struct in_addr {
  int dummy;
};
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *_gethostbynis(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ inet_ntoa(struct in_addr);
struct hostent *_gethostbynisaddr(const char *addr, int len, int af) {
  return _gethostbynis(inet_ntoa(*(struct in_addr *)addr), "hosts.byaddr", af);
}


x86 assembly (clang, -O0):
<_gethostbynisaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1040 <_gethostbynis@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gethostbynisaddr>:
push   %rbx
mov    %edx,%ebx
mov    (%rdi),%edi
call   1030 <inet_ntoa@plt>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <_gethostbynis@plt>

LLVM IR (-O0):
%struct.hostent = type { i32 }
%struct.in_addr = type { i32 }
@.str = [13 x i8] c"hosts.byaddr\00"
define %struct.hostent* @_gethostbynisaddr(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 = bitcast i8* %7 to %struct.in_addr*
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @inet_ntoa(i32 %10)
%12 = load i32, i32* %6
%13 = call %struct.hostent* @_gethostbynis(i32 %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %12)
ret %struct.hostent* %13
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@.str = [13 x i8] c"hosts.byaddr\00"
define %struct.hostent* @_gethostbynisaddr(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @inet_ntoa(i32 %5)
%7 = tail call %struct.hostent* @_gethostbynis(i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
ret %struct.hostent* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Split Module Table world (3)\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [35 x i8] c"Hello Split Module Table world (3)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double floor(double);
double double_floor(double val) { return floor(val); }


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

x86 assembly (clang, -O2):
<double_floor>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @double_floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.floor.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @double_floor(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void Print_Symbol(char c) {
  int i;
  for (i = 0; i < 3000; i++) {
    putchar(c);
    printf("\b");
  }
}


x86 assembly (clang, -O0):
<Print_Symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xbb8,-0x8(%rbp)
jge    1165 <Print_Symbol+0x45>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <Print_Symbol+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print_Symbol>:
push   %rbp
push   %rbx
push   %rax
mov    $0xbb8,%ebp
movsbl %dil,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1120 <Print_Symbol+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Print_Symbol(i8 signext %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = tail call i32 @putchar(i8 signext %0)
%5 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 8)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 3000
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *);
int /*<<< orphan*/ pA_mes(char *);
void pA_reg_noname(const char *register_name) {
  pA_mes("[");
  pA("junkApi_putStringDec('\\1', %s, 11, 0);", register_name);
  pA_mes("]");
}


x86 assembly (clang, -O0):
<pA_reg_noname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <pA_mes@plt>
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <pA@plt>
lea    0xeda(%rip),%rdi
call   1030 <pA_mes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pA_reg_noname>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <pA_mes@plt>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <pA@plt>
lea    0xee3(%rip),%rdi
pop    %rbx
jmp    1030 <pA_mes@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"[\00"
@.str.1 = [39 x i8] c"junkApi_putStringDec('\\1', %s, 11, 0);\00"
@.str.2 = [2 x i8] c"]\00"
define void @pA_reg_noname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @pA_mes(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @pA(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @pA_mes(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"[\00"
@.str.1 = [39 x i8] c"junkApi_putStringDec('\\1', %s, 11, 0);\00"
@.str.2 = [2 x i8] c"]\00"
define void @pA_reg_noname(i8* %0) {
%2 = tail call i32 @pA_mes(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pA(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @pA_mes(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int is_bg(void *elem) { return *(int *)elem == 0x00; }


x86 assembly (clang, -O0):
<is_bg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bg>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_bg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_bg(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int foo(int p, int x) {
  if (x < 0) {
    return 0;
  }
  if (p == 1) {
    if (x > 65535) {
      goto ERROR;
    }
  }
  return x;
ERROR:
  return -1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1120 <foo+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1153 <foo+0x53>
cmpl   $0x1,-0x8(%rbp)
jne    1141 <foo+0x41>
cmpl   $0xffff,-0xc(%rbp)
jle    113c <foo+0x3c>
jmp    114c <foo+0x4c>
jmp    1141 <foo+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <foo+0x53>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x10000,%esi
mov    $0xffffffff,%ecx
cmovl  %esi,%ecx
cmp    $0x1,%edi
cmovne %esi,%ecx
xor    %eax,%eax
test   %esi,%esi
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
%4 = icmp eq i32 %0, 1
%5 = icmp sgt i32 %1, 65535
%6 = and i1 %4, %5
%7 = select i1 %6, i32 -1, i32 %1
%8 = select i1 %3, i32 0, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
pid_t outside_fork(void) { return fork(); }


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

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

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

LLVM IR (-O2):
define i32 @outside_fork() {
%1 = tail call i32 (...) @fork()
ret i32 %1
}
void glDetachShader(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDetachShader() {
ret void
}
int tls13_client_certificate_verify_recv(struct tls13_ctx *ctx) { return 1; }


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

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

LLVM IR (-O0):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_certificate_verify_recv(%struct.tls13_ctx* %0) {
%2 = alloca %struct.tls13_ctx*
store %struct.tls13_ctx* %0, %struct.tls13_ctx** %2
ret i32 1
}

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_certificate_verify_recv(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_2d(void **p, unsigned p_sz) {
  for (unsigned i = 0; i < p_sz; ++i) {
    free(p[i]);
  }
  free(p);
}


x86 assembly (clang, -O0):
<free_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <free_2d+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_2d+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_2d>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <free_2d+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_2d+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_2d(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @free(i8** %0)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = bitcast i8** %10 to i8***
%12 = load i8**, i8*** %11
%13 = tail call i32 @free(i8** %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int memoryCheck(void) {
  fprintf(stderr, "\nUnable to allocate memory.\n\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<memoryCheck>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<memoryCheck>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"\0AUnable to allocate memory.\0A\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @memoryCheck() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"\0AUnable to allocate memory.\0A\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @memoryCheck() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}