xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int in6_teredo_ipv4(struct in6_addr const *);
int in6_teredo_port(struct in6_addr const *);
int in6_matches_teredo_client(const struct in6_addr *ip6, uint32_t ip,
                              uint16_t port) {
  return !((ip ^ in6_teredo_ipv4(ip6)) || (port ^ in6_teredo_port(ip6)));
}


x86 assembly (clang, -O0):
<in6_matches_teredo_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <in6_teredo_ipv4@plt>
mov    -0x18(%rbp),%ecx
xor    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    1173 <in6_matches_teredo_client+0x53>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <in6_teredo_port@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
xor    %ecx,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in6_matches_teredo_client>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <in6_teredo_ipv4@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebp,%ecx
jne    114b <in6_matches_teredo_client+0x2b>
mov    %rbx,%rdi
call   1030 <in6_teredo_port@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %r14d,%ecx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i32 @in6_matches_teredo_client(%struct.in6_addr* %0, i32 %1, i32 %2) {
%4 = alloca %struct.in6_addr*
%5 = alloca i32
%6 = alloca i32
store %struct.in6_addr* %0, %struct.in6_addr** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load %struct.in6_addr*, %struct.in6_addr** %4
%9 = call i32 @in6_teredo_ipv4(%struct.in6_addr* %8)
%10 = xor i32 %7, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %3
%13 = load i32, i32* %6
%14 = load %struct.in6_addr*, %struct.in6_addr** %4
%15 = call i32 @in6_teredo_port(%struct.in6_addr* %14)
%16 = xor i32 %13, %15
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %12, %3
%19 = phi i1 [ true, %3 ], [ %17, %12 ]
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i32 @in6_matches_teredo_client(%struct.in6_addr* %0, i32 %1, i32 %2) {
%4 = tail call i32 @in6_teredo_ipv4(%struct.in6_addr* %0)
%5 = icmp eq i32 %4, %1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @in6_teredo_port(%struct.in6_addr* %0)
%8 = icmp eq i32 %7, %2
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int open(char const *, int);
__attribute__((__weak__, __always___)) int
softboundcets_open(const char *pathname, int flags) {
  return open(pathname, flags);
}


x86 assembly (clang, -O0):
<softboundcets_open>:
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 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_open>:
jmp    1030 <open@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_open(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 @open(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @softboundcets_open(i8* %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
ret i32 %3
}
int count_bits(unsigned long int x) {
  int i = 0;
  while (x != 0) {
    if (x & 1UL)
      i++;
    x >>= 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<count_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <count_bits+0x46>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1135 <count_bits+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <count_bits+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bits>:
xor    %eax,%eax
test   %rdi,%rdi
je     1123 <count_bits+0x23>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <count_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_bits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %7, %4
%9 = lshr i64 %5, 1
%10 = icmp ult i64 %5, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
int ProcessCommand(char *, char *);
int ReadModelNumber(char ret[]) {
  int err = ProcessCommand(ret, "CR5\r");
  return (err);
}


x86 assembly (clang, -O0):
<ReadModelNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <ProcessCommand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"CR5\0D\00"
define i32 @ReadModelNumber(i8* %0) {
%2 = tail call i32 @ProcessCommand(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *findfont(char *name) {
  char *font;
  if (name[0] == '\000' || strcmp(name, "default") == 0)
    font = "Times-Roman";
  else
    font = name;
  return font;
}


x86 assembly (clang, -O0):
<findfont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1146 <findfont+0x36>
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1156 <findfont+0x46>
lea    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    115e <findfont+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findfont>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1135 <findfont+0x25>
mov    %rdi,%rbx
lea    0xee0(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
lea    0xed9(%rip),%rax
cmovne %rbx,%rax
pop    %rbx
ret
lea    0xecc(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"default\00"
@.str.1 = [12 x i8] c"Times-Roman\00"
define i8* @findfont(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %16
14: ; preds = %9
%15 = load i8*, i8** %2
store i8* %15, i8** %3
br label %16
16: ; preds = %14, %13
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [8 x i8] c"default\00"
@.str.1 = [12 x i8] c"Times-Roman\00"
define i8* @findfont(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0
br label %8
8: ; preds = %4, %1
%9 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %1 ], [ %7, %4 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ print_helloworld();
void print_helloworld_threetimes() {
  for (int i = 0; i <= 2; i++) {
    print_helloworld();
  }
}


x86 assembly (clang, -O0):
<print_helloworld_threetimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jg     113e <print_helloworld_threetimes+0x2e>
mov    $0x0,%al
call   1030 <print_helloworld@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <print_helloworld_threetimes+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_helloworld_threetimes>:
push   %rax
xor    %eax,%eax
call   1030 <print_helloworld@plt>
xor    %eax,%eax
call   1030 <print_helloworld@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <print_helloworld@plt>

LLVM IR (-O0):
define void @print_helloworld_threetimes() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 2
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @print_helloworld()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @print_helloworld_threetimes() {
%1 = tail call i32 (...) @print_helloworld()
%2 = tail call i32 (...) @print_helloworld()
%3 = tail call i32 (...) @print_helloworld()
ret void
}
int test_imm_42uint16_reg(unsigned short val) {
  return ((val) & (0x42 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_42uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x42,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_42uint16_reg>:
test   $0x42,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_42uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 66
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_42uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 66
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void SG_PageFlt(long *maj, long *min) {}


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

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

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

LLVM IR (-O2):
define void @SG_PageFlt(i64* nocapture %0, i64* nocapture %1) {
ret void
}
void print(const char *s) {
  while (*s) {
    __asm__ __volatile__("int $0x10" : : "a"(0x0E00 | *s), "b"(0x000F));
    s++;
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113a <print+0x3a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
or     $0xe00,%eax
mov    $0xf,%ebx
int    $0x10
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1109 <print+0x9>
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1125 <print+0x25>
add    $0x1,%rdi
mov    $0xf,%ebx
movsbl %al,%eax
or     $0xe00,%eax
int    $0x10
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <print+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = or i32 3584, %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = or i32 %7, 3584
tail call void asm sideeffect "int $$0x10", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %8, i32 15)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int select_fd(int, double, int);
int sock_poll(int fd, double timeout, int wait_for, void *arg) {
  return select_fd(fd, timeout, wait_for);
}


x86 assembly (clang, -O0):
<sock_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%esi
call   1030 <select_fd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_poll>:
jmp    1030 <select_fd@plt>

LLVM IR (-O0):
define i32 @sock_poll(i32 %0, double %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store double %1, double* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load double, double* %6
%11 = load i32, i32* %7
%12 = call i32 @select_fd(i32 %9, double %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @sock_poll(i32 %0, double %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @select_fd(i32 %0, double %1, i32 %2)
ret i32 %5
}
int gcd(int a, int b) {
  while (a != b) {
    if (a > b)
      a -= b;
    else
      b -= a;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1142 <gcd+0x42>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1132 <gcd+0x32>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <gcd+0x3d>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
cmp    %esi,%edi
je     1127 <gcd+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %eax,%esi
mov    $0x0,%edx
cmovl  %esi,%edx
mov    %eax,%edi
cmovl  %ecx,%edi
sub    %edx,%eax
sub    %edi,%esi
cmp    %esi,%eax
jne    1110 <gcd+0x10>
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = icmp slt i32 %5, %6
%8 = select i1 %7, i32 %5, i32 0
%9 = sub nsw i32 %6, %8
%10 = select i1 %7, i32 0, i32 %6
%11 = sub nsw i32 %5, %10
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ %0, %2 ], [ %9, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
main() {
  int c;
  for (c = 0; c <= 255; c++) {
    putchar(c);
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1156 <main+0x46>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %bl,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = trunc i32 %2 to i8
%4 = tail call i32 @putchar(i8 signext %3)
%5 = tail call i32 @putchar(i8 signext 10)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 256
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
char *init_dvb_string(int, char *);
char *init_dvb_string_utf8(char *text) { return init_dvb_string(0x10, text); }


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

x86 assembly (clang, -O2):
<init_dvb_string_utf8>:
mov    %rdi,%rsi
mov    $0x10,%edi
jmp    1030 <init_dvb_string@plt>

LLVM IR (-O0):
define i8* @init_dvb_string_utf8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @init_dvb_string(i32 16, i8* %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @init_dvb_string_utf8(i8* %0) {
%2 = tail call i8* @init_dvb_string(i32 16, i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char str[] = "12345";
  str[0] = '\0';
  printf("[%s]\n", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x34333231,(%rsp)
movw   $0x35,0x4(%rsp)
movb   $0x0,(%rsp)
lea    0xedc(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [6 x i8] c"12345\00"
@.str = [6 x i8] c"[%s]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
store i8 0, i8* %4
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [6 x i8] c"12345\00"
@.str = [6 x i8] c"[%s]\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct tkt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tkt *);
void destroy_tkt(struct tkt *l) { free(l); }


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

x86 assembly (clang, -O2):
<destroy_tkt>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.tkt = type { i32 }
define void @destroy_tkt(%struct.tkt* nocapture %0) {
%2 = tail call i32 @free(%struct.tkt* %0)
ret void
}
int very_long_function(int a) { return very_long_function(a) / 4; }


x86 assembly (clang, -O0):
<very_long_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <very_long_function@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<very_long_function>:
push   %rax
call   1030 <very_long_function@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @very_long_function(i32 %0) {
%2 = tail call i32 @very_long_function(i32 %0)
%3 = sdiv i32 %2, 4
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x31() {
  Assert_real((isgraph(49)),
              "/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_isgraph.c",
              250, ("isgraph should be 1 for 1"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xfa,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x31>:
push   %rax
mov    $0x31,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xfa,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for 1\00"
define void @t_isgraph_0x31() {
%1 = call i32 @isgraph(i32 49)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([26 x i8], [26 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for 1\00"
define void @t_isgraph_0x31() {
%1 = tail call i32 @isgraph(i32 49)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int SIGALRM;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ handler_func();
void sig_alarm_handler(int signum) {
  assert(signum == SIGALRM);
  handler_func();
}


x86 assembly (clang, -O0):
<sig_alarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x0,%al
call   1040 <handler_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_alarm_handler>:
push   %rax
mov    0x2ec0(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <handler_func@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @sig_alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGALRM
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 (...) @handler_func()
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @sig_alarm_handler(i32 %0) {
%2 = load i32, i32* @SIGALRM
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 (...) @handler_func()
ret void
}
void delay(unsigned int count) {
  volatile unsigned int i;
  for (i = 0; i < count; i++) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    112d <delay+0x2d>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jae    111f <delay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load volatile i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load volatile i32, i32* %3
%11 = add i32 %10, 1
store volatile i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp ult i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp ult i32 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
int get_returnvalue(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_returnvalue() {
ret i32 0
}
void ePaper_spi_detach() {}


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

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

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

LLVM IR (-O2):
define void @ePaper_spi_detach() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Menus_ActivateByName(char *);
void CG_ShowTeamMenu(void) { Menus_ActivateByName("teamMenu"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"teamMenu\00"
define void @CG_ShowTeamMenu() {
%1 = call i32 @Menus_ActivateByName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"teamMenu\00"
define void @CG_ShowTeamMenu() {
%1 = tail call i32 @Menus_ActivateByName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
void imx_ssi_ac97_warm_reset(struct snd_ac97 *ac97) {}


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

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

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

LLVM IR (-O2):
%struct.snd_ac97 = type opaque
define void @imx_ssi_ac97_warm_reset(%struct.snd_ac97* nocapture %0) {
ret void
}
void execute() {}


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

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

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

LLVM IR (-O2):
define void @execute() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_list_append_front();
int /*<<< orphan*/ test_list_contains();
int /*<<< orphan*/ test_list_delete();
void test_list() {
  test_list_append_front();
  test_list_delete();
  test_list_contains();
}


x86 assembly (clang, -O0):
<test_list>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_list_append_front@plt>
mov    $0x0,%al
call   1030 <test_list_delete@plt>
mov    $0x0,%al
call   1040 <test_list_contains@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list>:
push   %rax
xor    %eax,%eax
call   1050 <test_list_append_front@plt>
xor    %eax,%eax
call   1030 <test_list_delete@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_list_contains@plt>

LLVM IR (-O0):
define void @test_list() {
%1 = call i32 (...) @test_list_append_front()
%2 = call i32 (...) @test_list_delete()
%3 = call i32 (...) @test_list_contains()
ret void
}

LLVM IR (-O2):
define void @test_list() {
%1 = tail call i32 (...) @test_list_append_front()
%2 = tail call i32 (...) @test_list_delete()
%3 = tail call i32 (...) @test_list_contains()
ret void
}
/* Variables and functions */
int main(int c, char **p) { return 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void ff_hevc_put_hevc_uni_epel_h64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h64_10_sse4() {
ret void
}
int isInSkiMap(int x, int y, int N) {
  if (x >= 0 && x < N && y >= 0 && y < N) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isInSkiMap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1145 <isInSkiMap+0x45>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1145 <isInSkiMap+0x45>
cmpl   $0x0,-0xc(%rbp)
jl     1145 <isInSkiMap+0x45>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1145 <isInSkiMap+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <isInSkiMap+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInSkiMap>:
test   %edi,%edi
js     1116 <isInSkiMap+0x16>
cmp    %edx,%esi
jge    1116 <isInSkiMap+0x16>
test   %esi,%esi
js     1116 <isInSkiMap+0x16>
mov    $0x1,%eax
cmp    %edx,%edi
jge    1116 <isInSkiMap+0x16>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isInSkiMap(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 sge i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i32, i32* %6
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 1, i32* %4
br label %23
22: ; preds = %17, %14, %10, %3
store i32 0, i32* %4
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @isInSkiMap(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, -1
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = icmp slt i32 %0, %2
%7 = icmp sgt i32 %1, -1
%8 = and i1 %7, %6
%9 = icmp slt i32 %1, %2
%10 = and i1 %9, %8
br i1 %10, label %12, label %11
11: ; preds = %5, %3
br label %12
12: ; preds = %5, %11
%13 = phi i32 [ 0, %11 ], [ 1, %5 ]
ret i32 %13
}
/* Variables and functions */
size_t list_meter_float(const void *el) {
  if (el) {
  }
  return sizeof(float);
}


x86 assembly (clang, -O0):
<list_meter_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <list_meter_float+0x18>
jmp    1118 <list_meter_float+0x18>
mov    $0x4,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @list_meter_float(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret i64 4
}

LLVM IR (-O2):
define i64 @list_meter_float(i8* nocapture readnone %0) {
ret i64 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_handler(int s) { printf("Receive signal with number %d\n", s); }


x86 assembly (clang, -O0):
<test_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Receive signal with number %d\0A\00"
define void @test_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Receive signal with number %d\0A\00"
define void @test_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int string_atoi(const char *str) {
  if (!*str)
    return 0;
  return *str - '0' + 10 * string_atoi(str - 1);
}


x86 assembly (clang, -O0):
<string_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1135 <string_atoi+0x25>
movl   $0x0,-0x4(%rbp)
jmp    115c <string_atoi+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xffffffffffffffff,%rdi
call   1030 <string_atoi@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_atoi>:
push   %rbx
movsbl (%rdi),%ebx
test   %ebx,%ebx
je     112c <string_atoi+0x1c>
add    $0xffffffffffffffff,%rdi
call   1030 <string_atoi@plt>
lea    (%rax,%rax,4),%eax
lea    (%rbx,%rax,2),%eax
add    $0xffffffd0,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @string_atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1, %6
%5 = phi i32 [ %12, %6 ], [ 0, %1 ]
ret i32 %5
6: ; preds = %1
%7 = sext i8 %2 to i32
%8 = add nsw i32 %7, -48
%9 = getelementptr inbounds i8, i8* %0, i64 -1
%10 = tail call i32 @string_atoi(i8* %9)
%11 = mul nsw i32 %10, 10
%12 = add nsw i32 %8, %11
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int system(char *);
int gnuplot(const char *gnucommand) {
  char syscommand[1024];
  sprintf(syscommand, "echo \"%s\" | gnuplot -persist", gnucommand);
  return system(syscommand);
}


x86 assembly (clang, -O0):
<gnuplot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <system@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnuplot>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"echo \22%s\22 | gnuplot -persist\00"
define i32 @gnuplot(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [29 x i8] c"echo \22%s\22 | gnuplot -persist\00"
define i32 @gnuplot(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ d_d(double);
int /*<<< orphan*/ d_i(int);
int /*<<< orphan*/ i_d(double);
int /*<<< orphan*/ i_i(int);
int /*<<< orphan*/ v_d(double);
int /*<<< orphan*/ v_i(int);
int main(void) {
  v_i(3);
  i_i(4);
  d_i(5);
  v_d(6.0);
  i_d(7.0);
  d_d(8.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <v_i@plt>
mov    $0x4,%edi
call   1080 <i_i@plt>
mov    $0x5,%edi
call   1060 <d_i@plt>
movsd  0xe7b(%rip),%xmm0
call   1070 <v_d@plt>
movsd  0xe66(%rip),%xmm0
call   1050 <i_d@plt>
movsd  0xe51(%rip),%xmm0
call   1030 <d_d@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <v_i@plt>
mov    $0x4,%edi
call   1080 <i_i@plt>
mov    $0x5,%edi
call   1060 <d_i@plt>
movsd  0xe79(%rip),%xmm0
call   1070 <v_d@plt>
movsd  0xe74(%rip),%xmm0
call   1050 <i_d@plt>
movsd  0xe6f(%rip),%xmm0
call   1030 <d_d@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @v_i(i32 3)
%3 = call i32 @i_i(i32 4)
%4 = call i32 @d_i(i32 5)
%5 = call i32 @v_d(double 6.000000e+00)
%6 = call i32 @i_d(double 7.000000e+00)
%7 = call i32 @d_d(double 8.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @v_i(i32 3)
%2 = tail call i32 @i_i(i32 4)
%3 = tail call i32 @d_i(i32 5)
%4 = tail call i32 @v_d(double 6.000000e+00)
%5 = tail call i32 @i_d(double 7.000000e+00)
%6 = tail call i32 @d_d(double 8.000000e+00)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int ts_packet_get_scrambled(int /*<<< orphan*/ *);
int ts_packet_is_scrambled(uint8_t *ts_packet) {
  return ts_packet_get_scrambled(ts_packet) > 1;
}


x86 assembly (clang, -O0):
<ts_packet_is_scrambled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ts_packet_get_scrambled@plt>
cmp    $0x1,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_packet_is_scrambled>:
push   %rax
call   1030 <ts_packet_get_scrambled@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ts_packet_is_scrambled(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ts_packet_get_scrambled(i32* %3)
%5 = icmp sgt i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ts_packet_is_scrambled(i32* %0) {
%2 = tail call i32 @ts_packet_get_scrambled(i32* %0)
%3 = icmp sgt i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
adrreg0regx1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[10000000]) = (p1[x1]); }


x86 assembly (clang, -O0):
<adrreg0regx1_set>:
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    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x18(%rbp),%rax
mov    %cx,0x1312d00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0regx1_set>:
movslq %ecx,%rax
movzwl (%r9,%rax,2),%eax
mov    %ax,0x1312d00(%r8)
01
ret

LLVM IR (-O0):
define i32 @adrreg0regx1_set(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** %13
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* %16, i64 %18
%20 = load i16, i16* %19
%21 = load i16*, i16** %12
%22 = getelementptr inbounds i16, i16* %21, i64 10000000
store i16 %20, i16* %22
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @adrreg0regx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load i16, i16* %8
%10 = getelementptr inbounds i16, i16* %4, i64 10000000
store i16 %9, i16* %10
ret i32 undef
}
int is_ufun(x)
int x;
{
  if ((x / 20000000) == 24)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<is_ufun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x1312d00,%ecx
cltd
idiv   %ecx
cmp    $0x18,%eax
jne    1127 <is_ufun+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_ufun+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ufun>:
add    $0xe363c800,%edi
xor    %eax,%eax
cmp    $0x1312d00,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_ufun(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 20000000
%6 = icmp eq i32 %5, 24
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_ufun(i32 %0) {
%2 = add i32 %0, -480000000
%3 = icmp ult i32 %2, 20000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int ferror(FILE *stream) { return EOF; }


x86 assembly (clang, -O0):
<ferror>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @ferror(i32* nocapture readnone %0) {
%2 = load i32, i32* @EOF
ret i32 %2
}
unsigned char inb(unsigned short port) {
  unsigned char v;
  asm volatile("inb %w1, %0\n" : "=Ral"(v) : "Nd"(port));
  return v;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w}, $0\0A", "=R{ax}l,N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w}, $0\0A", "=R{ax}l,N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
struct rc_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rc_t *);
void rc_free(struct rc_t *R) { free(R); }


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

x86 assembly (clang, -O2):
<rc_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.rc_t = type { i32 }
define void @rc_free(%struct.rc_t* nocapture %0) {
%2 = tail call i32 @free(%struct.rc_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_byte_arrays(unsigned char *, unsigned int,
                                     unsigned char *, unsigned int, char *);
void check_byte_array(unsigned char *expected, unsigned int expected_len,
                      unsigned char *actual, unsigned int actual_len) {
  check_byte_arrays(actual, actual_len, expected, expected_len, "");
}


x86 assembly (clang, -O0):
<check_byte_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xec5(%rip),%r8
call   1030 <check_byte_arrays@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_byte_array>:
mov    %esi,%r9d
mov    %rdi,%rax
lea    0xee3(%rip),%r8
mov    %rdx,%rdi
mov    %ecx,%esi
mov    %rax,%rdx
mov    %r9d,%ecx
jmp    1030 <check_byte_arrays@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @check_byte_array(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i32, i32* %8
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @check_byte_arrays(i8* %9, i32 %10, i8* %11, i32 %12, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @check_byte_array(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @check_byte_arrays(i8* %2, i32 %3, i8* %0, i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}