xunge/DecIR huggingface dataset:
int xor2(int i, int j) { return (i % 3) ? 0 : 1; }


x86 assembly (clang, -O0):
<xor2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor2>:
imul   $0xaaaaaaab,%edi,%ecx
add    $0x2aaaaaaa,%ecx
xor    %eax,%eax
cmp    $0x55555555,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xor2(i32 %0, i32 %1) {
%3 = srem i32 %0, 3
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int toInt(char c) { return c - '0'; }


x86 assembly (clang, -O0):
<toInt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toInt>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @toInt(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @toInt(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int memcmp(char *, char *, int);
int main(int argc, char **buffer) {
  char buf[10] = "hello";
  int cmp;
  if ((cmp = memcmp(buf, "hello", 5)))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xed0(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1a(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
je     1169 <main+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6f6c6c6568,%rax
mov    %rax,0x8(%rsp)
movw   $0x0,0x10(%rsp)
lea    0xed9(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    $0x5,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.buf = [10 x i8] c"hello\00\00\00\00\00"
@.str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @memcmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int epoll_ctl(int, int, int, struct epoll_event *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void xepoll_ctl(int epfd, int op, int fd, struct epoll_event *event) {
  int rv;
  rv = epoll_ctl(epfd, op, fd, event);
  if (rv < 0)
    errx(1, "epoll_ctl: %s", strerror(errno));
}


x86 assembly (clang, -O0):
<xepoll_ctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <epoll_ctl@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1185 <xepoll_ctl+0x55>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe80(%rip),%rsi
call   1030 <errx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xepoll_ctl>:
push   %rax
call   1040 <epoll_ctl@plt>
test   %eax,%eax
js     113c <xepoll_ctl+0xc>
pop    %rax
ret
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeaf(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1030 <errx@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
@.str = [14 x i8] c"epoll_ctl: %s\00"
@errno = global i32 0
define void @xepoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.epoll_event*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.epoll_event* %3, %struct.epoll_event** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load %struct.epoll_event*, %struct.epoll_event** %8
%14 = call i32 @epoll_ctl(i32 %10, i32 %11, i32 %12, %struct.epoll_event* %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = load i32, i32* @errno
%19 = call i32 @strerror(i32 %18)
%20 = call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %17, %4
ret void
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
@.str = [14 x i8] c"epoll_ctl: %s\00"
@errno = global i32 0
define void @xepoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = tail call i32 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* @errno
%9 = tail call i32 @strerror(i32 %8)
%10 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %4
ret void
}
/* Variables and functions */
char MYwrite_char(int, char);
void MYwrite_string(int sock, char *s) {
  int i;
  for (i = 0; MYwrite_char(sock, s[i]), s[i]; i++)
    ;
}


x86 assembly (clang, -O0):
<MYwrite_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1030 <MYwrite_char@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115f <MYwrite_string+0x4f>
jmp    1151 <MYwrite_string+0x41>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <MYwrite_string+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MYwrite_string>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%esi
mov    %ebp,%edi
call   1030 <MYwrite_char@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <MYwrite_string+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @MYwrite_string(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = tail call signext i8 @MYwrite_char(i32 %0, i8 signext %6)
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret void
}
float min_ff(float a, float b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min_ff>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min_ff+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <min_ff+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_ff>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min_ff(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @min_ff(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
void AXC_BatteryService_onChargingStart(struct AXI_BatteryServiceFacade *bat) {}


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

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

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

LLVM IR (-O2):
%struct.AXI_BatteryServiceFacade = type opaque
define void @AXC_BatteryService_onChargingStart(%struct.AXI_BatteryServiceFacade* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void syntax(const char *name) {
  fprintf(
      stderr,
      "Syntax: %s -f <file> [-h <sample_freq>] [-g <offset_for_gnuplot>] [-o "
      "<combined_output_file>] [-v <vcd_output_file>] <gpio:name...>\n\n",
      name);
  exit(1);
}


x86 assembly (clang, -O0):
<syntax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<syntax>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [134 x i8] c"Syntax: %s -f <file> [-h <sample_freq>] [-g <offset_for_gnuplot>] [-o <combined_output_file>] [-v <vcd_output_file>] <gpio:name...>\0A\0A\00"
define void @syntax(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [134 x i8] c"Syntax: %s -f <file> [-h <sample_freq>] [-g <offset_for_gnuplot>] [-o <combined_output_file>] [-v <vcd_output_file>] <gpio:name...>\0A\0A\00"
define void @syntax(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, double *, int);
uint64_t eh_float64_to_uint64(double d) {
  uint64_t u64;
  memcpy(&u64, &d, sizeof(double));
  return u64;
}


x86 assembly (clang, -O0):
<eh_float64_to_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eh_float64_to_uint64>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @eh_float64_to_uint64(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = call i32 @memcpy(i32* %3, double* %2, i32 8)
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @eh_float64_to_uint64(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i32* %3, double* %2, i32 8)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
void stub1(long long, double);
void testClosureLLDrV(void (*closure)(long long, double), long long a1,
                      double a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureLLDrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112f <testClosureLLDrV+0x2f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLDrV>:
test   %rdi,%rdi
je     110d <testClosureLLDrV+0xd>
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testClosureLLDrV(void (i64, double)* %0, i64 %1, double %2) {
%4 = alloca void (i64, double)*
%5 = alloca i64
%6 = alloca double
store void (i64, double)* %0, void (i64, double)** %4
store i64 %1, i64* %5
store double %2, double* %6
%7 = load void (i64, double)*, void (i64, double)** %4
%8 = icmp ne void (i64, double)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load void (i64, double)*, void (i64, double)** %4
%11 = load i64, i64* %5
%12 = load double, double* %6
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @testClosureLLDrV(void (i64, double)* %0, i64 %1, double %2) {
%4 = icmp eq void (i64, double)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i64 %1, double %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
double floor(double x) {
  return (double)(x < 0.f ? ((int)x == x ? x : (((int)x) - 1)) : ((int)x));
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1160 <floor+0x60>
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    1140 <floor+0x40>
jp     1140 <floor+0x40>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1151 <floor+0x51>
cvttsd2si -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    116e <floor+0x6e>
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
jbe    1129 <floor+0x29>
ucomisd %xmm0,%xmm1
jne    111b <floor+0x1b>
jp     111b <floor+0x1b>
ret
cvttsd2si %xmm0,%eax
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %20
5: ; preds = %1
%6 = load double, double* %2
%7 = fptosi double %6 to i32
%8 = sitofp i32 %7 to double
%9 = load double, double* %2
%10 = fcmp oeq double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = load double, double* %2
br label %18
13: ; preds = %5
%14 = load double, double* %2
%15 = fptosi double %14 to i32
%16 = sub nsw i32 %15, 1
%17 = sitofp i32 %16 to double
br label %18
18: ; preds = %13, %11
%19 = phi double [ %12, %11 ], [ %17, %13 ]
br label %24
20: ; preds = %1
%21 = load double, double* %2
%22 = fptosi double %21 to i32
%23 = sitofp i32 %22 to double
br label %24
24: ; preds = %20, %18
%25 = phi double [ %19, %18 ], [ %23, %20 ]
ret double %25
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fptosi double %0 to i32
%4 = sitofp i32 %3 to double
br i1 %2, label %5, label %10
5: ; preds = %1
%6 = fcmp oeq double %4, %0
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = add nsw i32 %3, -1
%9 = sitofp i32 %8 to double
br label %10
10: ; preds = %1, %5, %7
%11 = phi double [ %9, %7 ], [ %0, %5 ], [ %4, %1 ]
ret double %11
}
/* Type definitions */
struct pagevec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __pagevec_release(struct pagevec *);
scalar_t__ pagevec_count(struct pagevec *);
void pagevec_release(struct pagevec *pvec) {
  if (pagevec_count(pvec)) {
    __pagevec_release(pvec);
  }
}


x86 assembly (clang, -O0):
<pagevec_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pagevec_count@plt>
cmp    $0x0,%rax
je     1148 <pagevec_release+0x28>
mov    -0x8(%rbp),%rdi
call   1040 <__pagevec_release@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pagevec_release>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pagevec_count@plt>
test   %rax,%rax
je     1137 <pagevec_release+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <__pagevec_release@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.pagevec = type { i32 }
define void @pagevec_release(%struct.pagevec* %0) {
%2 = alloca %struct.pagevec*
store %struct.pagevec* %0, %struct.pagevec** %2
%3 = load %struct.pagevec*, %struct.pagevec** %2
%4 = call i64 @pagevec_count(%struct.pagevec* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.pagevec*, %struct.pagevec** %2
%8 = call i32 @__pagevec_release(%struct.pagevec* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.pagevec = type { i32 }
define void @pagevec_release(%struct.pagevec* %0) {
%2 = tail call i64 @pagevec_count(%struct.pagevec* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__pagevec_release(%struct.pagevec* %0)
br label %6
6: ; preds = %4, %1
ret void
}
int system_handle(struct connection *conn) {
  int state = 500;
  printf(
      "%s %d: %s()\n",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/jammy-code/httpd/refs/heads/master/src/main.c",
      52, __func__);
  return state;
}


x86 assembly (clang, -O0):
<system_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1f4,-0xc(%rbp)
lea    0xed6(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x34,%edx
lea    0xf58(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_handle>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    $0x34,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1f4,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.connection = type opaque
@.str = [13 x i8] c"%s %d: %s()\0A\00"
@.str.1 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jammy-code/httpd/refs/heads/master/src/main.c\00"
@__func__.system_handle = [14 x i8] c"system_handle\00"
define i32 @system_handle(%struct.connection* %0) {
%2 = alloca %struct.connection*
%3 = alloca i32
store %struct.connection* %0, %struct.connection** %2
store i32 500, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.1, i64 0, i64 0), i32 52, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.system_handle, i64 0, i64 0))
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
%struct.connection = type opaque
@.str = [13 x i8] c"%s %d: %s()\0A\00"
@.str.1 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jammy-code/httpd/refs/heads/master/src/main.c\00"
@__func__.system_handle = [14 x i8] c"system_handle\00"
define i32 @system_handle(%struct.connection* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.1, i64 0, i64 0), i32 52, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.system_handle, i64 0, i64 0))
ret i32 500
}
adr0adr1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*((short *)10000000)) <=
      (*((short *)(11111111 & ~(__alignof__(short) - 1)))))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movswl (%rax),%eax
mov    $0xa98ac6,%ecx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1143 <adr0adr1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <adr0adr1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adr1>:
movzwl 0x989680,%ecx
xor    %eax,%eax
cmp    0xa98ac6,%cx
setle  %al
ret

LLVM IR (-O0):
define i32 @adr0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 10000000 to i16*)
%17 = sext i16 %16 to i32
%18 = load i16, i16* inttoptr (i64 11111110 to i16*)
%19 = sext i16 %18 to i32
%20 = icmp sle i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @adr0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 10000000 to i16*)
%8 = load i16, i16* inttoptr (i64 11111110 to i16*)
%9 = icmp sle i16 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sphget_tb2gettime_factor();
void __attribute__((constructor)) __attribute__((visibility("hidden")))
__sphgettime_init(void) {
  sphget_tb2gettime_factor();
}


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

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

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

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__sphgettime_init, i8* null }]
define hidden void @__sphgettime_init() {
%1 = tail call i32 (...) @sphget_tb2gettime_factor()
ret void
}
/* Variables and functions */
float truncf(float const);
float stdlib_base_truncf(const float x) { return truncf(x); }


x86 assembly (clang, -O0):
<stdlib_base_truncf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <truncf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_truncf>:
jmp    1030 <truncf@plt>

LLVM IR (-O0):
define float @stdlib_base_truncf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.trunc.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @stdlib_base_truncf(float %0) {
%2 = tail call float @llvm.trunc.f32(float %0)
ret float %2
}
/* Variables and functions */
char *replacer(char *, int);
char *revolver(char *, int);
int strlen(char *);
char *sirify(char *str) {
  char *trans;
  int l = strlen(str);
  trans = replacer(str, l);
  trans = revolver(trans, l);
  return trans;
}


x86 assembly (clang, -O0):
<sirify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <replacer@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <revolver@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sirify>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <replacer@plt>
mov    %rax,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <revolver@plt>

LLVM IR (-O0):
define i8* @sirify(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i8*, i8** %2
%8 = load i32, i32* %4
%9 = call i8* @replacer(i8* %7, i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i8* @revolver(i8* %10, i32 %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @sirify(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @replacer(i8* %0, i32 %2)
%4 = tail call i8* @revolver(i8* %3, i32 %2)
ret i8* %4
}
/* Variables and functions */
int random();
int determine_delay(int delay, int jitter) {
  int rjit = (jitter != 0) ? random() % (jitter * 2) : 0;
  int res = delay + (rjit - jitter);
  return res;
}


x86 assembly (clang, -O0):
<determine_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1140 <determine_delay+0x30>
mov    $0x0,%al
call   1030 <random@plt>
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
jmp    114a <determine_delay+0x3a>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <determine_delay+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determine_delay>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
test   %esi,%esi
je     112d <determine_delay+0x1d>
xor    %eax,%eax
call   1030 <random@plt>
lea    (%r14,%r14,1),%ecx
cltd
idiv   %ecx
jmp    112f <determine_delay+0x1f>
xor    %edx,%edx
sub    %r14d,%ebx
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @determine_delay(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = call i32 (...) @random()
%11 = load i32, i32* %4
%12 = mul nsw i32 %11, 2
%13 = srem i32 %10, %12
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %9
%16 = phi i32 [ %13, %9 ], [ 0, %14 ]
store i32 %16, i32* %5
%17 = load i32, i32* %3
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = sub nsw i32 %18, %19
%21 = add nsw i32 %17, %20
store i32 %21, i32* %6
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @determine_delay(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (...) @random()
%6 = shl nsw i32 %1, 1
%7 = srem i32 %5, %6
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
%10 = sub i32 %0, %1
%11 = add i32 %10, %9
ret i32 %11
}
/* Type definitions */
struct play_list {
  int dummy;
};

/* Variables and functions */
struct play_list *clear_one_play(struct play_list *);
void clear_play_list(struct play_list *list) {
  while (list)
    list = clear_one_play(list);
}


x86 assembly (clang, -O0):
<clear_play_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <clear_play_list+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <clear_one_play@plt>
mov    %rax,-0x8(%rbp)
jmp    111c <clear_play_list+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_play_list>:
push   %rax
test   %rdi,%rdi
je     112d <clear_play_list+0x1d>
mov    %rdi,%rax
nopl   0x0(%rax)
mov    %rax,%rdi
call   1030 <clear_one_play@plt>
test   %rax,%rax
jne    1120 <clear_play_list+0x10>
pop    %rax
ret

LLVM IR (-O0):
%struct.play_list = type { i32 }
define void @clear_play_list(%struct.play_list* %0) {
%2 = alloca %struct.play_list*
store %struct.play_list* %0, %struct.play_list** %2
br label %3
3: ; preds = %6, %1
%4 = load %struct.play_list*, %struct.play_list** %2
%5 = icmp ne %struct.play_list* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load %struct.play_list*, %struct.play_list** %2
%8 = call %struct.play_list* @clear_one_play(%struct.play_list* %7)
store %struct.play_list* %8, %struct.play_list** %2
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.play_list = type { i32 }
define void @clear_play_list(%struct.play_list* %0) {
%2 = icmp eq %struct.play_list* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi %struct.play_list* [ %5, %3 ], [ %0, %1 ]
%5 = tail call %struct.play_list* @clear_one_play(%struct.play_list* %4)
%6 = icmp eq %struct.play_list* %5, null
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version() {
  printf("Built with Hoedown "
         "3.0.5"
         ".\n");
}


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"Built with Hoedown 3.0.5.\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getroot(double, int, int);
int /*<<< orphan*/ plintf(char *, int /*<<< orphan*/);
main() { plintf("%g \n", getroot(.5, 0., 1.)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <getroot@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <plintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <getroot@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <plintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%g \0A\00"
define i32 @main() {
%1 = call i32 @getroot(double 5.000000e-01, i32 0, i32 1)
%2 = call i32 @plintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%g \0A\00"
define i32 @main() {
%1 = tail call i32 @getroot(double 5.000000e-01, i32 0, i32 1)
%2 = tail call i32 @plintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct bladerf {
  int dummy;
};

/* Variables and functions */
int nios_8x8_read(struct bladerf *, int, int /*<<< orphan*/,
                  int /*<<< orphan*/ *);
int nios_lms6_read(struct bladerf *dev, uint8_t addr, uint8_t *data) {
  int status = nios_8x8_read(dev, 0x00, addr, data);
  if (status == 0) {
    do {
      do {
      } while (0);
    } while (0);
  }
  return status;
}


x86 assembly (clang, -O0):
<nios_lms6_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <nios_8x8_read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    115b <nios_lms6_read+0x4b>
jmp    1147 <nios_lms6_read+0x37>
jmp    114c <nios_lms6_read+0x3c>
jmp    1151 <nios_lms6_read+0x41>
jmp    1156 <nios_lms6_read+0x46>
jmp    115b <nios_lms6_read+0x4b>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_lms6_read>:
mov    %rdx,%rcx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <nios_8x8_read@plt>

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

LLVM IR (-O2):
%struct.bladerf = type { i32 }
define i32 @nios_lms6_read(%struct.bladerf* %0, i32 %1, i32* %2) {
%4 = tail call i32 @nios_8x8_read(%struct.bladerf* %0, i32 0, i32 %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
unsigned long parxtent();
unsigned long int corextent(void) {
  unsigned long l;
  l = parxtent();
  return l << 4;
}


x86 assembly (clang, -O0):
<corextent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <parxtent@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corextent>:
push   %rax
xor    %eax,%eax
call   1030 <parxtent@plt>
shl    $0x4,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @corextent() {
%1 = alloca i64
%2 = call i64 (...) @parxtent()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = shl i64 %3, 4
ret i64 %4
}

LLVM IR (-O2):
define i64 @corextent() {
%1 = tail call i64 (...) @parxtent()
%2 = shl i64 %1, 4
ret i64 %2
}
int is_ident_digit(int c) {
  int result;
  switch (c) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    result = 1;
    break;
  default:
    result = 0;
    break;
  }
  return result;
}


x86 assembly (clang, -O0):
<is_ident_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffd0,%eax
sub    $0x9,%eax
ja     1127 <is_ident_digit+0x27>
jmp    111b <is_ident_digit+0x1b>
movl   $0x1,-0x8(%rbp)
jmp    112e <is_ident_digit+0x2e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ident_digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_ident_digit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 48, label %5
i32 49, label %5
i32 50, label %5
i32 51, label %5
i32 52, label %5
i32 53, label %5
i32 54, label %5
i32 55, label %5
i32 56, label %5
i32 57, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %7
6: ; preds = %1
store i32 0, i32* %3
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_ident_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: factor [value ...]\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"usage: factor [value ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"usage: factor [value ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct crystal {
  int dummy;
};
struct array {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
sarray_transfer_many(struct array *const *, unsigned int const *, int,
                     int /*<<< orphan*/, int, int /*<<< orphan*/,
                     int /*<<< orphan*/, unsigned int const *const,
                     unsigned int const, struct crystal *const);
void sarray_transfer_ext_(struct array *const A, const unsigned size,
                          const unsigned int *const proc,
                          const unsigned proc_stride,
                          struct crystal *const cr) {
  sarray_transfer_many(&A, &size, 1, 0, 1, 0, 0, proc, proc_stride, cr);
}


x86 assembly (clang, -O0):
<sarray_transfer_ext_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%r11
mov    -0x1c(%rbp),%r10d
mov    -0x28(%rbp),%rax
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x1,%r8d
xor    %r9d,%r9d
mov    %r8d,%edx
mov    %r9d,%ecx
movl   $0x0,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <sarray_transfer_many@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sarray_transfer_ext_>:
sub    $0x18,%rsp
mov    %r8,%rax
mov    %ecx,%r10d
mov    %rdx,%r11
mov    %rdi,0x10(%rsp)
mov    %esi,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
push   %rax
push   %r10
push   %r11
push   $0x0
call   1030 <sarray_transfer_many@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
%struct.array = type { i32 }
%struct.crystal = type { i32 }
define void @sarray_transfer_ext_(%struct.array* %0, i32 %1, i32* %2, i32 %3, %struct.crystal* %4) {
%6 = alloca %struct.array*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca %struct.crystal*
store %struct.array* %0, %struct.array** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store %struct.crystal* %4, %struct.crystal** %10
%11 = load i32*, i32** %8
%12 = load i32, i32* %9
%13 = load %struct.crystal*, %struct.crystal** %10
%14 = call i32 @sarray_transfer_many(%struct.array** %6, i32* %7, i32 1, i32 0, i32 1, i32 0, i32 0, i32* %11, i32 %12, %struct.crystal* %13)
ret void
}

LLVM IR (-O2):
%struct.array = type { i32 }
%struct.crystal = type { i32 }
define void @sarray_transfer_ext_(%struct.array* %0, i32 %1, i32* %2, i32 %3, %struct.crystal* %4) {
%6 = alloca %struct.array*
%7 = alloca i32
store %struct.array* %0, %struct.array** %6
store i32 %1, i32* %7
%8 = call i32 @sarray_transfer_many(%struct.array** %6, i32* %7, i32 1, i32 0, i32 1, i32 0, i32 0, i32* %2, i32 %3, %struct.crystal* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void putlong(FILE *file, int val) {
  putc((val >> 24) & 0xff, file);
  putc((val >> 16) & 0xff, file);
  putc((val >> 8) & 0xff, file);
  putc(val & 0xff, file);
}


x86 assembly (clang, -O0):
<putlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putlong>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%eax
shr    $0x18,%eax
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
movzbl %bl,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define void @putlong(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = tail call i32 @putc(i32 %3, i32* %0)
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = tail call i32 @putc(i32 %6, i32* %0)
%8 = lshr i32 %1, 8
%9 = and i32 %8, 255
%10 = tail call i32 @putc(i32 %9, i32* %0)
%11 = and i32 %1, 255
%12 = tail call i32 @putc(i32 %11, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doX(int *);
int /*<<< orphan*/ doY(int);
int /*<<< orphan*/ doZ(int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 2;
  int *b = &a;
  int c = 3;
  doX(&a);
  doY(a);
  b = &c;
  doZ(b);
  printf("values %d %d %d\n", a, *b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
lea    -0x8(%rbp),%rdi
call   1060 <doX@plt>
mov    -0x8(%rbp),%edi
call   1050 <doY@plt>
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <doZ@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%ecx
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2,(%rsp)
movl   $0x3,0x4(%rsp)
mov    %rsp,%rdi
call   1060 <doX@plt>
mov    (%rsp),%edi
call   1050 <doY@plt>
lea    0x4(%rsp),%rdi
call   1030 <doZ@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%ecx
lea    0xe88(%rip),%rdi
mov    %ecx,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"values %d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 3, i32* %2
%5 = call i32 @doX(i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @doY(i32 %6)
%8 = call i32 @doZ(i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %10)
ret i32 0
}
void test4() {
  printf("\t*** %s ***\n", __func__);
  small_string_test("123 , 5  ,       92    , 0, 0\n"
                    "1, 12  34, 56, \"quote , \", 66\nok");
  printf("\t*** %s: done ***\n ", __func__);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <small_string_test@plt>
lea    0xf04(%rip),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <small_string_test@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\09*** %s ***\0A\00"
@__func__.test4 = [6 x i8] c"test4\00"
@.str.1 = [63 x i8] c"123 , 5 , 92 , 0, 0\0A1, 12 34, 56, \22quote , \22, 66\0Aok\00"
@.str.2 = [20 x i8] c"\09*** %s: done ***\0A \00"
define void @test4() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test4, i64 0, i64 0))
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @small_string_test to i32 (i8*, ...)*)(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\09*** %s ***\0A\00"
@__func__.test4 = [6 x i8] c"test4\00"
@.str.1 = [63 x i8] c"123 , 5 , 92 , 0, 0\0A1, 12 34, 56, \22quote , \22, 66\0Aok\00"
@.str.2 = [20 x i8] c"\09*** %s: done ***\0A \00"
define void @test4() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test4, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @small_string_test to i32 (i8*, ...)*)(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test4, i64 0, i64 0))
ret void
}