xunge/DecIR huggingface dataset:
/* Variables and functions */
int write(int, unsigned char *, int);
int SendRawPacket(int rawsock, unsigned char *pkt, int pkt_len) {
  int sent = 0;
  if ((sent = write(rawsock, pkt, pkt_len)) != pkt_len) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<SendRawPacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmp    -0x14(%rbp),%eax
je     1150 <SendRawPacket+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1157 <SendRawPacket+0x47>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendRawPacket>:
push   %rbx
mov    %edx,%ebx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @SendRawPacket(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, %2
%6 = zext i1 %5 to i32
ret i32 %6
}
void App_Fault_ISR(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<App_Fault_ISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <App_Fault_ISR+0x9>
jmp    1109 <App_Fault_ISR+0x9>

x86 assembly (clang, -O2):
<App_Fault_ISR>:
jmp    1100 <App_Fault_ISR>

LLVM IR (-O0):
define void @App_Fault_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @App_Fault_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}
void do_translate(vert, horiz) float vert, horiz;
{
  printf("%f %f translate\n", vert, horiz);
  debug("changing translation");
}


x86 assembly (clang, -O0):
<do_translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm1,-0x10(%rbp)
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xea0(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_translate>:
push   %rax
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0xec8(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <debug@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%f %f translate\0A\00"
@.str.1 = [21 x i8] c"changing translation\00"
define void @do_translate(double %0, double %1) {
%3 = alloca float
%4 = alloca float
%5 = fptrunc double %0 to float
%6 = fptrunc double %1 to float
store float %5, float* %3
store float %6, float* %4
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = load float, float* %4
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %8, double %10)
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @debug to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%f %f translate\0A\00"
@.str.1 = [21 x i8] c"changing translation\00"
define void @do_translate(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = fpext float %3 to double
%6 = fpext float %4 to double
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %5, double %6)
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  pid_t pid = getpid();
  printf("Hello from %d\n", pid);
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello from %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @getpid()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello from %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
char *BF_options() { return ("blowfish(ptr2)"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"blowfish(ptr2)\00"
define i8* @BF_options() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"blowfish(ptr2)\00"
define i8* @BF_options() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ environment();
int query_name();
int /*<<< orphan*/ set_heart_beat(int /*<<< orphan*/);
int /*<<< orphan*/ tell_room(int /*<<< orphan*/, char *);
void net_dead() {
  set_heart_beat(0);
  tell_room(environment(), query_name() + " is link-dead.\n");
}


x86 assembly (clang, -O0):
<net_dead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <set_heart_beat@plt>
mov    $0x0,%al
call   1040 <environment@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <query_name@plt>
mov    -0x4(%rbp),%edi
cltq
lea    0xe94(%rip),%rsi
add    %rax,%rsi
call   1030 <tell_room@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_dead>:
push   %rbx
xor    %edi,%edi
call   1050 <set_heart_beat@plt>
xor    %eax,%eax
call   1040 <environment@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <query_name@plt>
cltq
lea    0xe9f(%rip),%rsi
add    %rax,%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tell_room@plt>

LLVM IR (-O0):
@.str = [16 x i8] c" is link-dead.\0A\00"
define void @net_dead() {
%1 = call i32 @set_heart_beat(i32 0)
%2 = call i32 (...) @environment()
%3 = call i32 (...) @query_name()
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %4
%6 = call i32 @tell_room(i32 %2, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c" is link-dead.\0A\00"
define void @net_dead() {
%1 = tail call i32 @set_heart_beat(i32 0)
%2 = tail call i32 (...) @environment()
%3 = tail call i32 (...) @query_name()
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [16 x i8], [16 x i8]* @.str, i64 0, i64 %4
%6 = tail call i32 @tell_room(i32 %2, i8* %5)
ret void
}
int msm_clock_require_tcxo(unsigned long *reason, int nbits) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_clock_require_tcxo(i64* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int rand();
int rdm_num(int min, int max) {
  if (max <= 0) {
    return 0;
  } else {
    return min + (rand() % (max - min + 1));
  }
}


x86 assembly (clang, -O0):
<rdm_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1134 <rdm_num+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1155 <rdm_num+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdm_num>:
test   %esi,%esi
jle    1135 <rdm_num+0x25>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebx,%ebp
add    $0x1,%ebp
cltd
idiv   %ebp
mov    %edx,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rdm_num(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 sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %18
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 (...) @rand()
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %14, 1
%16 = srem i32 %11, %15
%17 = add nsw i32 %10, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %9, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @rdm_num(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 (...) @rand()
%6 = sub i32 1, %0
%7 = add i32 %6, %1
%8 = srem i32 %5, %7
%9 = add nsw i32 %8, %0
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 0, %2 ]
ret i32 %11
}
void bwb_Timer_Off(void) {
  bwx_DEBUG(__FUNCTION__);
  ClrEvent(0X40);
}


x86 assembly (clang, -O0):
<bwb_Timer_Off>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <bwx_DEBUG@plt>
mov    $0x40,%edi
mov    $0x0,%al
call   1030 <ClrEvent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_Timer_Off>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <bwx_DEBUG@plt>
mov    $0x40,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <ClrEvent@plt>

LLVM IR (-O0):
@__FUNCTION__.bwb_Timer_Off = [14 x i8] c"bwb_Timer_Off\00"
define void @bwb_Timer_Off() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.bwb_Timer_Off, i64 0, i64 0))
%2 = call i32 (i32, ...) bitcast (i32 (...)* @ClrEvent to i32 (i32, ...)*)(i32 64)
ret void
}

LLVM IR (-O2):
@__FUNCTION__.bwb_Timer_Off = [14 x i8] c"bwb_Timer_Off\00"
define void @bwb_Timer_Off() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.bwb_Timer_Off, i64 0, i64 0))
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @ClrEvent to i32 (i32, ...)*)(i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int month;
  scanf("%d", &month);
  printf("%d\n", (month + 1) == 13 ? 1 : month + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0xd,%eax
jne    115b <main+0x3b>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <main+0x44>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0x1,%eax
cmp    $0xd,%eax
mov    $0x1,%esi
cmovne %eax,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
%6 = icmp eq i32 %5, 13
%7 = select i1 %6, i32 1, i32 %5
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
int add_digits(int num) { return (num - 1) % 9 + 1; }


x86 assembly (clang, -O0):
<add_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_digits>:
add    $0xffffffff,%edi
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @add_digits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = srem i32 %4, 9
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @add_digits(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = srem i32 %2, 9
%4 = add nsw i32 %3, 1
ret i32 %4
}
int inreg(int channel, int reg) {
  int val;
  val = *((volatile unsigned char *)0x08104000 + (channel * 0x2000) +
          (reg * 0x4));
  return val;
}


x86 assembly (clang, -O0):
<inreg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xd,%eax
movslq %eax,%rcx
mov    $0x8104000,%eax
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inreg>:
movslq %edi,%rax
shl    $0xd,%rax
movslq %esi,%rcx
movzbl 0x8104000(%rax,%rcx,4),%eax
08
ret

LLVM IR (-O0):
define i32 @inreg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 8192
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* inttoptr (i64 135282688 to i8*), i64 %8
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load volatile i8, i8* %13
%15 = zext i8 %14 to i32
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @inreg(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 13
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* inttoptr (i64 135282688 to i8*), i64 %4
%6 = shl nsw i32 %1, 2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load volatile i8, i8* %8
%10 = zext i8 %9 to i32
ret i32 %10
}
int __isspace_ascii(int ch) { return (unsigned int)(ch - 9) < 5u || ch == ' '; }


x86 assembly (clang, -O0):
<__isspace_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x9,%ecx
mov    $0x1,%al
cmp    $0x5,%ecx
mov    %al,-0x5(%rbp)
jb     1125 <__isspace_ascii+0x25>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isspace_ascii>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @__isspace_ascii(i32 %0) {
%2 = add nsw i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void constPointer() {
  int a = 4;
  const int b = 5;
  int const *cpb1 = &b;
  const int *cpb2 = &b;
  int *const pc = &a;
  const int *const cpca = &a;
  const int *const cpcab = &b;
}


x86 assembly (clang, -O0):
<constPointer>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @constPointer() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
store i32 4, i32* %1
store i32 5, i32* %2
store i32* %2, i32** %3
store i32* %2, i32** %4
store i32* %1, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
ret void
}

LLVM IR (-O2):
define void @constPointer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void testTortureExecute(void) {
  foo(64);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
mov    $0x40,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @foo(i32 64)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @foo(i32 64)
ret void
}
void mul_d(double *source1, double *source2, double *target) {
  *target = (*source1) * (*source2);
}


x86 assembly (clang, -O0):
<mul_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_d>:
movsd  (%rdi),%xmm0
mulsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @mul_d(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = load double*, double** %5
%10 = load double, double* %9
%11 = fmul double %8, %10
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @mul_d(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fmul double %4, %5
store double %6, double* %2
ret void
}
int ab8500_fg_inst_curr_started(struct ab8500_fg *di) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ab8500_fg = type opaque
define i32 @ab8500_fg_inst_curr_started(%struct.ab8500_fg* nocapture readnone %0) {
ret i32 0
}
int cmp_bits(const unsigned char *a, const unsigned char *b, unsigned int pos) {
  unsigned int ofs;
  unsigned char bit_a, bit_b;
  ofs = pos >> 3;
  pos = ~pos & 7;
  bit_a = (a[ofs] >> pos) & 1;
  bit_b = (b[ofs] >> pos) & 1;
  return bit_a - bit_b;
}


x86 assembly (clang, -O0):
<cmp_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
and    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_bits>:
mov    %edx,%ecx
mov    %edx,%edx
shr    $0x3,%rdx
movzbl (%rdi,%rdx,1),%eax
not    %cl
and    $0x7,%cl
shr    %cl,%eax
movzbl (%rsi,%rdx,1),%edx
shr    %cl,%edx
and    $0x1,%eax
and    $0x1,%edx
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_bits(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%10 = load i32, i32* %6
%11 = lshr i32 %10, 3
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = xor i32 %12, -1
%14 = and i32 %13, 7
store i32 %14, i32* %6
%15 = load i8*, i8** %4
%16 = load i32, i32* %7
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = load i32, i32* %6
%22 = ashr i32 %20, %21
%23 = and i32 %22, 1
%24 = trunc i32 %23 to i8
store i8 %24, i8* %8
%25 = load i8*, i8** %5
%26 = load i32, i32* %7
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = load i32, i32* %6
%32 = ashr i32 %30, %31
%33 = and i32 %32, 1
%34 = trunc i32 %33 to i8
store i8 %34, i8* %9
%35 = load i8, i8* %8
%36 = zext i8 %35 to i32
%37 = load i8, i8* %9
%38 = zext i8 %37 to i32
%39 = sub nsw i32 %36, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @cmp_bits(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = lshr i32 %2, 3
%5 = and i32 %2, 7
%6 = xor i32 %5, 7
%7 = zext i32 %4 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = lshr i32 %10, %6
%12 = and i32 %11, 1
%13 = getelementptr inbounds i8, i8* %1, i64 %7
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = lshr i32 %15, %6
%17 = and i32 %16, 1
%18 = sub nsw i32 %12, %17
ret i32 %18
}
void foo310() {}


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

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

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

LLVM IR (-O2):
define void @foo310() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void strcpy_no_null_Bad() {
  char src[5] = "test";
  src[4] = 'a';
  char dst[10];
  strcpy(dst, src);
}


x86 assembly (clang, -O0):
<strcpy_no_null_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x1(%rbp)
movb   $0x61,-0x1(%rbp)
lea    -0xf(%rbp),%rdi
lea    -0x5(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_no_null_Bad>:
sub    $0x18,%rsp
movl   $0x74736574,0x8(%rsp)
74
movb   $0x61,0xc(%rsp)
lea    0xe(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <strcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.strcpy_no_null_Bad.src = [5 x i8] c"test\00"
define void @strcpy_no_null_Bad() {
%1 = alloca [5 x i8]
%2 = alloca [10 x i8]
%3 = bitcast [5 x i8]* %1 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 4
store i8 97, i8* %4
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @strcpy_no_null_Bad() {
%1 = alloca [5 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = bitcast [5 x i8]* %1 to i32*
store i32 1953719668, i32* %4
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 4
store i8 97, i8* %5
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char buf[32];
  strcpy(buf, "some text");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xee5(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"some text\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"some text\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xf3() {
  Assert_real((isascii(243) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              1220, ("isascii should be 0 for 0xf3"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xf3\00"
define void @t_isascii_0xf3() {
%1 = tail call i64 @isascii(i32 243)
%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 1220, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test(int a, int b, int c) {
  if (a != 10 && a != 12)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     112c <test+0x2c>
cmpl   $0xc,-0x8(%rbp)
je     112c <test+0x2c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <test+0x32>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
cmp    $0xc,%edi
je     110c <test+0xc>
mov    %esi,%eax
cmp    $0xa,%edi
jne    110e <test+0xe>
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i32 %2) {
switch i32 %0, label %5 [
i32 12, label %4
i32 10, label %4
]
4: ; preds = %3, %3
br label %5
5: ; preds = %3, %4
%6 = phi i32 [ %2, %4 ], [ %1, %3 ]
ret i32 %6
}
void mycopy() {
  int i;
  extern char line[], longest[];
  i = 0;
  while ((longest[i] = line[i]) != '\0')
    ++i;
}


x86 assembly (clang, -O0):
<mycopy>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2ed2(%rip),%rax
mov    (%rax,%rcx,1),%al
movslq -0x4(%rbp),%rdx
mov    0x2eb4(%rip),%rcx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1141 <mycopy+0x41>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <mycopy+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycopy>:
xor    %eax,%eax
mov    0x2edf(%rip),%rsi
mov    0x2ec8(%rip),%rdx
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdx,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <mycopy+0x10>
ret

LLVM IR (-O0):
@line = external global [0 x i8]
@longest = external global [0 x i8]
define void @mycopy() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @line, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [0 x i8], [0 x i8]* @longest, i64 0, i64 %8
store i8 %6, i8* %9
%10 = sext i8 %6 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@line = external global [0 x i8]
@longest = external global [0 x i8]
define void @mycopy() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ %7, %1 ], [ 0, %0 ]
%3 = getelementptr inbounds [0 x i8], [0 x i8]* @line, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @longest, i64 0, i64 %2
store i8 %4, i8* %5
%6 = icmp eq i8 %4, 0
%7 = add nuw i64 %2, 1
br i1 %6, label %8, label %1
8: ; preds = %1
ret void
}
/* Variables and functions */
int fun();
int /*<<< orphan*/ printf(char *, int);
int main() {
  for (fun(); fun(); fun())
    printf("%d \n", fun());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fun@plt>
mov    $0x0,%al
call   1030 <fun@plt>
cmp    $0x0,%eax
je     1167 <main+0x47>
mov    $0x0,%al
call   1030 <fun@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <fun@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <fun@plt>
xor    %eax,%eax
call   1030 <fun@plt>
test   %eax,%eax
je     1163 <main+0x43>
lea    0xec6(%rip),%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <fun@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <fun@plt>
xor    %eax,%eax
call   1030 <fun@plt>
test   %eax,%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fun()
%2 = tail call i32 (...) @fun()
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @fun()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @fun()
%8 = tail call i32 (...) @fun()
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_container_to_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(266, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_quaddobl_container_to_target_solutions>:
mov    $0x10a,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_quaddobl_container_to_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 266, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage:\tnrf24-btle-decoder [-t nrf|btle] [-d 1|2|8] [-l len] \n\n"
          "Important - this program input is a 2M samples per second bitstream "
          "generated by rtl_fm or equivalent\n"
          "            e.g. rtl_fm.exe -f 428m -s 2000k | "
          "nrf24-btle-decoder.exe -n -s 3\n\n"
          "\t[-t packet_type (nrf or btle). defaults to nrf.] \n"
          "\t[-d downsample_rate (1 for 2mbps , 2 for 1mbps, 8 for 256kbps), "
          "default to 2]\n"
          "\t    using packet type btle implies -d 2\n"
          "\t[-l len (1-32). Set a fixed packet length] \n");
  exit(1);
}


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>
mov    $0x1,%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>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [460 x i8] c"Usage:\09nrf24-btle-decoder [-t nrf|btle] [-d 1|2|8] [-l len] \0A\0AImportant - this program input is a 2M samples per second bitstream generated by rtl_fm or equivalent\0A e.g. rtl_fm.exe -f 428m -s 2000k | nrf24-btle-decoder.exe -n -s 3\0A\0A\09[-t packet_type (nrf or btle). defaults to nrf.] \0A\09[-d downsample_rate (1 for 2mbps , 2 for 1mbps, 8 for 256kbps), default to 2]\0A\09 using packet type btle implies -d 2\0A\09[-l len (1-32). Set a fixed packet length] \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([460 x i8], [460 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [460 x i8] c"Usage:\09nrf24-btle-decoder [-t nrf|btle] [-d 1|2|8] [-l len] \0A\0AImportant - this program input is a 2M samples per second bitstream generated by rtl_fm or equivalent\0A e.g. rtl_fm.exe -f 428m -s 2000k | nrf24-btle-decoder.exe -n -s 3\0A\0A\09[-t packet_type (nrf or btle). defaults to nrf.] \0A\09[-d downsample_rate (1 for 2mbps , 2 for 1mbps, 8 for 256kbps), default to 2]\0A\09 using packet type btle implies -d 2\0A\09[-l len (1-32). Set a fixed packet length] \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([460 x i8], [460 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void usr_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @usr_terminate() {
ret void
}
/* Variables and functions */
size_t cwk_path_output_sized(char *, size_t, size_t, char *, int);
size_t cwk_path_output_current(char *buffer, size_t buffer_size,
                               size_t position) {
  return cwk_path_output_sized(buffer, buffer_size, position, ".", 1);
}


x86 assembly (clang, -O0):
<cwk_path_output_current>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec9(%rip),%rcx
mov    $0x1,%r8d
call   1030 <cwk_path_output_sized@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwk_path_output_current>:
lea    0xee9(%rip),%rcx
mov    $0x1,%r8d
jmp    1030 <cwk_path_output_sized@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i64 @cwk_path_output_current(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i64 @cwk_path_output_sized(i8* %7, i64 %8, i64 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i64 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i64 @cwk_path_output_current(i8* %0, i64 %1, i64 %2) {
%4 = tail call i64 @cwk_path_output_sized(i8* %0, i64 %1, i64 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i64 %4
}
unsigned reduce(unsigned x) {
  unsigned p = 0xE1 << 1;
  unsigned y = 0;
  for (; x; x >>= 1, p <<= 1)
    if (x & 1)
      y ^= p;
  return y;
}


x86 assembly (clang, -O0):
<reduce>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1c2,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1153 <reduce+0x53>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1137 <reduce+0x37>
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113c <reduce+0x3c>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <reduce+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduce>:
test   %edi,%edi
je     1127 <reduce+0x27>
mov    $0x1c2,%ecx
xor    %eax,%eax
mov    %edi,%edx
nopl   (%rax)
mov    %edi,%esi
and    $0x1,%esi
neg    %esi
and    %ecx,%esi
xor    %esi,%eax
shr    %edx
add    %ecx,%ecx
cmp    $0x1,%edi
mov    %edx,%edi
ja     1110 <reduce+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @reduce(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 450, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = xor i32 %14, %13
store i32 %15, i32* %4
br label %16
16: ; preds = %12, %8
br label %17
17: ; preds = %16
%18 = load i32, i32* %2
%19 = lshr i32 %18, 1
store i32 %19, i32* %2
%20 = load i32, i32* %3
%21 = shl i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %5
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @reduce(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %12, %3 ], [ 450, %1 ]
%6 = phi i32 [ %11, %3 ], [ %0, %1 ]
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 0, i32 %5
%10 = xor i32 %9, %4
%11 = lshr i32 %6, 1
%12 = shl i32 %5, 1
%13 = icmp ult i32 %6, 2
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %15
}
/* Variables and functions */
unsigned int __bextri_u32(unsigned int, int);
unsigned int test__bextri_u32(unsigned int a) { return __bextri_u32(a, 1); }


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

x86 assembly (clang, -O2):
<test__bextri_u32>:
mov    $0x1,%esi
jmp    1030 <__bextri_u32@plt>

LLVM IR (-O0):
define i32 @test__bextri_u32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__bextri_u32(i32 %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @test__bextri_u32(i32 %0) {
%2 = tail call i32 @__bextri_u32(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ set_escdelay(int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdscr;
void init(void) {
  set_escdelay(25);
  setlocale(LC_CTYPE, "");
  initscr();
  curs_set(0);
  cbreak();
  noecho();
  keypad(stdscr, TRUE);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
call   1030 <set_escdelay@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
call   1070 <setlocale@plt>
mov    $0x0,%al
call   1060 <initscr@plt>
xor    %edi,%edi
call   1090 <curs_set@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    $0x0,%al
call   1080 <noecho@plt>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
mov    0x2e19(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    $0x19,%edi
call   1030 <set_escdelay@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe75(%rip),%rsi
call   1070 <setlocale@plt>
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %edi,%edi
call   1090 <curs_set@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
mov    0x2e1c(%rip),%rax
mov    (%rax),%esi
pop    %rax
jmp    1050 <keypad@plt>

LLVM IR (-O0):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
@stdscr = global i32 0
@TRUE = global i32 0
define void @init() {
%1 = call i32 @set_escdelay(i32 25)
%2 = load i32, i32* @LC_CTYPE
%3 = call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @initscr()
%5 = call i32 @curs_set(i32 0)
%6 = call i32 (...) @cbreak()
%7 = call i32 (...) @noecho()
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = call i32 @keypad(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
@stdscr = global i32 0
@TRUE = global i32 0
define void @init() {
%1 = tail call i32 @set_escdelay(i32 25)
%2 = load i32, i32* @LC_CTYPE
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @initscr()
%5 = tail call i32 @curs_set(i32 0)
%6 = tail call i32 (...) @cbreak()
%7 = tail call i32 (...) @noecho()
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = tail call i32 @keypad(i32 %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRF2_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRF2_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRF2_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int cli_disconn(int fd) { close(fd); }


x86 assembly (clang, -O0):
<cli_disconn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_disconn>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @cli_disconn(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @close(i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @cli_disconn(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 undef
}
int __isblank(int ch) { return (ch == ' ' || ch == '\t'); }


x86 assembly (clang, -O0):
<__isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <__isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @__isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}