xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xc3() {
  Assert_real((isprint(195) == 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_isprint.c",
              980, ("isprint should be 0 for 0xc3"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xc3>:
push   %rax
mov    $0xc3,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3d4,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xc3\00"
define void @t_isprint_0xc3() {
%1 = call i64 @isprint(i32 195)
%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 980, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xc3\00"
define void @t_isprint_0xc3() {
%1 = tail call i64 @isprint(i32 195)
%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 980, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned char negative(signed char b) {
  unsigned long long x = b;
  x >>= 63;
  return (unsigned char)x;
}


x86 assembly (clang, -O0):
<negative>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbq -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x3f,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<negative>:
mov    %edi,%eax
shr    $0x7,%al
ret

LLVM IR (-O0):
define zeroext i8 @negative(i8 signext %0) {
%2 = alloca i8
%3 = alloca i64
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = lshr i64 %6, 63
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @negative(i8 signext %0) {
%2 = lshr i8 %0, 7
ret i8 %2
}
/* Variables and functions */
int __cvmx_nand_get_column_bits(int);
int __cvmx_nand_get_row_bits(int);
int __cvmx_nand_get_address_cycles(int chip) {
  int address_bits = ((__cvmx_nand_get_column_bits(chip) + 7) >> 3) << 3;
  address_bits += ((__cvmx_nand_get_row_bits(chip) + 7) >> 3) << 3;
  return (address_bits + 7) >> 3;
}


x86 assembly (clang, -O0):
<__cvmx_nand_get_address_cycles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__cvmx_nand_get_column_bits@plt>
add    $0x7,%eax
sar    $0x3,%eax
shl    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <__cvmx_nand_get_row_bits@plt>
add    $0x7,%eax
sar    $0x3,%eax
shl    $0x3,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x7,%eax
sar    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cvmx_nand_get_address_cycles>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <__cvmx_nand_get_column_bits@plt>
mov    %eax,%ebp
add    $0x7,%ebp
and    $0xfffffff8,%ebp
mov    %ebx,%edi
call   1040 <__cvmx_nand_get_row_bits@plt>
add    $0x7,%eax
and    $0xfffffff8,%eax
add    %ebp,%eax
sar    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__cvmx_nand_get_address_cycles(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @__cvmx_nand_get_column_bits(i32 %4)
%6 = add nsw i32 %5, 7
%7 = ashr i32 %6, 3
%8 = shl i32 %7, 3
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = call i32 @__cvmx_nand_get_row_bits(i32 %9)
%11 = add nsw i32 %10, 7
%12 = ashr i32 %11, 3
%13 = shl i32 %12, 3
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 7
%18 = ashr i32 %17, 3
ret i32 %18
}

LLVM IR (-O2):
define i32 @__cvmx_nand_get_address_cycles(i32 %0) {
%2 = tail call i32 @__cvmx_nand_get_column_bits(i32 %0)
%3 = add nsw i32 %2, 7
%4 = and i32 %3, -8
%5 = tail call i32 @__cvmx_nand_get_row_bits(i32 %0)
%6 = add nsw i32 %5, 7
%7 = and i32 %6, -8
%8 = add nsw i32 %7, %4
%9 = ashr exact i32 %8, 3
ret i32 %9
}
/* Variables and functions */
double strtod(char *, int /*<<< orphan*/ *);
double todouble(char *s) { return strtod(s, NULL); }


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

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

LLVM IR (-O0):
define double @todouble(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @strtod(i8* %3, i32* null)
ret double %4
}

LLVM IR (-O2):
define double @todouble(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i32* null)
ret double %2
}
/* Type definitions */
struct ybp_binlog_parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ybp_binlog_parser *);
void ybp_dispose_binlog_parser(struct ybp_binlog_parser *p) {
  if (p != NULL)
    free(p);
}


x86 assembly (clang, -O0):
<ybp_dispose_binlog_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ybp_dispose_binlog_parser+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ybp_dispose_binlog_parser>:
test   %rdi,%rdi
je     111a <ybp_dispose_binlog_parser+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.ybp_binlog_parser = type { i32 }
define void @ybp_dispose_binlog_parser(%struct.ybp_binlog_parser* %0) {
%2 = icmp eq %struct.ybp_binlog_parser* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.ybp_binlog_parser* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkY() {
  blinkdash();
  blinkdot();
  blinkdash();
  blinkdash();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkY>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
movsd  0xea8(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkY>:
push   %rax
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
movsd  0xeab(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkY() {
%1 = call i32 (...) @blinkdash()
%2 = call i32 (...) @blinkdot()
%3 = call i32 (...) @blinkdash()
%4 = call i32 (...) @blinkdash()
%5 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkY() {
%1 = tail call i32 (...) @blinkdash()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 (...) @blinkdash()
%4 = tail call i32 (...) @blinkdash()
%5 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
/* Variables and functions */
char *ft_strchr(char *, char);
int /*<<< orphan*/ ft_strclr(char *);
int /*<<< orphan*/ ft_strcpy(char *, char *);
int ft_check_line(char *buff) {
  char *str;
  if ((str = ft_strchr(buff, '\n'))) {
    ft_strcpy(buff, (str + 1));
    return (1);
  }
  ft_strclr(buff);
  return (0);
}


x86 assembly (clang, -O0):
<ft_check_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <ft_strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1175 <ft_check_line+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1030 <ft_strcpy@plt>
movl   $0x1,-0x4(%rbp)
jmp    1185 <ft_check_line+0x55>
mov    -0x10(%rbp),%rdi
call   1040 <ft_strclr@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_check_line>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1050 <ft_strchr@plt>
test   %rax,%rax
je     1159 <ft_check_line+0x29>
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <ft_strcpy@plt>
mov    $0x1,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <ft_strclr@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_check_line(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @ft_strchr(i8* %5, i8 signext 10)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = call i32 @ft_strcpy(i8* %9, i8* %11)
store i32 1, i32* %2
br label %16
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call i32 @ft_strclr(i8* %14)
store i32 0, i32* %2
br label %16
16: ; preds = %13, %8
%17 = load i32, i32* %2
ret i32 %17
}

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

/* Variables and functions */
int /*<<< orphan*/ __builtin_sub_overflow_p(int /*<<< orphan*/,
                                            int /*<<< orphan*/,
                                            int /*<<< orphan*/);
uint32_t __hsail_borrow_u32(uint32_t a, uint32_t b) {
  return __builtin_sub_overflow_p(a, b, a);
}


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

x86 assembly (clang, -O2):
<__hsail_borrow_u32>:
mov    %edi,%edx
jmp    1030 <__builtin_sub_overflow_p@plt>

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

LLVM IR (-O2):
define i32 @__hsail_borrow_u32(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_sub_overflow_p(i32 %0, i32 %1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int sprintf(char *, char *, int);
int f2(char *s) { return sprintf(s, "%d", 123); }


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

x86 assembly (clang, -O2):
<f2>:
lea    0xee9(%rip),%rsi
mov    $0x7b,%edx
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @f2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 123)
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @f2(i8* nocapture writeonly %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 123)
ret i32 %2
}
OP(ed, ae) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
int libmesh_C_isnan_longdouble(long double a) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @libmesh_C_isnan_longdouble(x86_fp80 %0) {
ret i32 0
}
void __arch_adjust_zones(int node, unsigned long *zone_size,
                         unsigned long *zhole_size) {
  if (node != 0)
    return;
  zone_size[1] = zone_size[0] - 1024;
  zone_size[0] = 1024;
  zhole_size[1] = zhole_size[0];
  zhole_size[0] = 0;
}


x86 assembly (clang, -O0):
<__arch_adjust_zones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111e <__arch_adjust_zones+0x1e>
jmp    1159 <__arch_adjust_zones+0x59>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
sub    $0x400,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
movq   $0x400,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__arch_adjust_zones>:
test   %edi,%edi
je     1105 <__arch_adjust_zones+0x5>
ret
mov    $0xfffffffffffffc00,%rax
add    (%rsi),%rax
mov    %rax,0x8(%rsi)
movq   $0x400,(%rsi)
mov    (%rdx),%rax
mov    %rax,0x8(%rdx)
movq   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define void @__arch_adjust_zones(i32 %0, i64* nocapture %1, i64* nocapture %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = load i64, i64* %1
%7 = add i64 %6, -1024
%8 = getelementptr inbounds i64, i64* %1, i64 1
store i64 %7, i64* %8
store i64 1024, i64* %1
%9 = load i64, i64* %2
%10 = getelementptr inbounds i64, i64* %2, i64 1
store i64 %9, i64* %10
store i64 0, i64* %2
br label %11
11: ; preds = %3, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void signals(int sig) { exit(sig); }


x86 assembly (clang, -O0):
<signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @signals(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @signals(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
double math_angle_to_game_angle(double);
double game_angle_to_math_angle(double angle) {
  return math_angle_to_game_angle(angle);
}


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

x86 assembly (clang, -O2):
<game_angle_to_math_angle>:
jmp    1030 <math_angle_to_game_angle@plt>

LLVM IR (-O0):
define double @game_angle_to_math_angle(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @math_angle_to_game_angle(double %3)
ret double %4
}

LLVM IR (-O2):
define double @game_angle_to_math_angle(double %0) {
%2 = tail call double @math_angle_to_game_angle(double %0)
ret double %2
}
int test_imm_FAuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xFA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FAuint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xfa,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FAuint64_highword_reg>:
movabs $0xfa00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FAuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 250
%6 = icmp ne i64 %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_FAuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1073741824000
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x2d() {
  Assert_real((isodigit(45) == 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_isodigit.c",
              230, ("isodigit should be 0 for -"));
}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @refresh_code_window() {
ret i32 1
}

LLVM IR (-O2):
define i32 @refresh_code_window() {
ret i32 1
}
int main() {
  int res = 0;
  for (int i = 0; i < 10; i++) {
    if (__builtin_expect(i % 2, 0)) {
      res += i;
    }
  }
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1157 <main+0x57>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
cmp    $0x0,%rax
je     1144 <main+0x44>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 25
}
int get_no_dither(void) { return 0x80; }


x86 assembly (clang, -O0):
<get_no_dither>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_no_dither() {
ret i32 128
}

LLVM IR (-O2):
define i32 @get_no_dither() {
ret i32 128
}
/* Variables and functions */
int foo(int, int);
int main(int argc, char *argv[]) { return 1 == foo(argc, argc + 1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
call   1030 <foo@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x1(%rdi),%esi
call   1030 <foo@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = call i32 @foo(i32 %6, i32 %8)
%10 = icmp eq i32 1, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, 1
%4 = tail call i32 @foo(i32 %0, i32 %3)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
void foo177(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo177(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430Usart1P__Usart__clrTxIntr();
void Msp430UartP__0__Usart__clrTxIntr(void) {
  HplMsp430Usart1P__Usart__clrTxIntr();
}


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

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

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

LLVM IR (-O2):
define void @Msp430UartP__0__Usart__clrTxIntr() {
%1 = tail call i32 (...) @HplMsp430Usart1P__Usart__clrTxIntr()
ret void
}
void lcm_suspend(void) {}


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

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

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

LLVM IR (-O2):
define void @lcm_suspend() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ z80_ed_45_retn();
void z80_ed_5d_retn(void) { z80_ed_45_retn(); }


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

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

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

LLVM IR (-O2):
define void @z80_ed_5d_retn() {
%1 = tail call i32 (...) @z80_ed_45_retn()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int main(void) {
  void *alloc = malloc(1024);
  free(alloc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1024)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @free(i8* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%2 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_bytes(uint8_t *bytes, uint16_t byteslen) {
  int i;
  for (i = 0; i < byteslen; i++) {
    printf("%02x", bytes[i]);
  }
}


x86 assembly (clang, -O0):
<print_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print_bytes+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_bytes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bytes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_bytes+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_bytes+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print_bytes(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
unsigned xrop3_159_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_159_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_159_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
mov    %ecx,%eax
xor    $0xff,%eax
and    %edx,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_159_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_159_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = and i32 %6, %7
%9 = or i32 %8, %4
%10 = xor i32 %9, -1
%11 = or i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ native_safe_halt();
void arch_safe_halt(void) { native_safe_halt(); }


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

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

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

LLVM IR (-O2):
define void @arch_safe_halt() {
%1 = tail call i32 (...) @native_safe_halt()
ret void
}
/* Variables and functions */
void *thread_func(void *foo) { return (NULL); }


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

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

LLVM IR (-O0):
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_func(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ report_error_and_die(char *);
void *realloc_or_die(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (!p)
    report_error_and_die("failed to realloc");
  return p;
}


x86 assembly (clang, -O0):
<realloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <realloc_or_die+0x38>
lea    0xead(%rip),%rdi
call   1030 <report_error_and_die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_or_die>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <realloc_or_die+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <report_error_and_die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"failed to realloc\00"
define noalias i8* @realloc_or_die(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @report_error_and_die(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_ContentDirectory_UpdateObject(struct UPnPService *Service,
                                                   int ErrorCode, void *User) {
  printf(
      "RND Invoke Response: ContentDirectory/UpdateObject[ErrorCode:%d]()\r\n",
      ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_ContentDirectory_UpdateObject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [69 x i8] c"RND Invoke Response: ContentDirectory/UpdateObject[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_UpdateObject(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [69 x i8] c"RND Invoke Response: ContentDirectory/UpdateObject[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_UpdateObject(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int getnpar(int /*<<< orphan*/, char *, char *, char **);
int getparstringarray(char *name, char **ptr) {
  return getnpar(0, name, "a", ptr);
}


x86 assembly (clang, -O0):
<getparstringarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
xor    %edi,%edi
lea    0xecf(%rip),%rdx
call   1030 <getnpar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getparstringarray>:
mov    %rsi,%rcx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdx
xor    %edi,%edi
jmp    1030 <getnpar@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define i32 @getparstringarray(i8* %0, i8** %1) {
%3 = tail call i32 @getnpar(i32 0, i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ starbar();
int main(void) {
  starbar();
  printf("%s\n", "GIGATHINK, INC. ");
  printf("%s\n", "101 Megabuck Plaza");
  printf("%s\n", "Megapolis, CA 94904");
  starbar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <starbar@plt>
lea    0xec3(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <starbar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <starbar@plt>
lea    0xed1(%rip),%rbx
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <starbar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [17 x i8] c"GIGATHINK, INC. \00"
@.str.2 = [19 x i8] c"101 Megabuck Plaza\00"
@.str.3 = [20 x i8] c"Megapolis, CA 94904\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @starbar()
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (...) @starbar()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [17 x i8] c"GIGATHINK, INC. \00"
@.str.2 = [19 x i8] c"101 Megabuck Plaza\00"
@.str.3 = [20 x i8] c"Megapolis, CA 94904\00"
define i32 @main() {
%1 = tail call i32 (...) @starbar()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (...) @starbar()
ret i32 0
}
/* Variables and functions */
size_t oui_append_4o(unsigned char *cp, const unsigned long data) {
  *cp = (data >> 24) & 0xff;
  *(cp + 1) = (data >> 16) & 0xff;
  *(cp + 2) = (data >> 8) & 0xff;
  *(cp + 3) = data & 0xff;
  return 4;
}


x86 assembly (clang, -O0):
<oui_append_4o>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oui_append_4o>:
bswap  %esi
mov    %esi,(%rdi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i64 @oui_append_4o(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = lshr i64 %5, 24
%7 = and i64 %6, 255
%8 = trunc i64 %7 to i8
%9 = load i8*, i8** %3
store i8 %8, i8* %9
%10 = load i64, i64* %4
%11 = lshr i64 %10, 16
%12 = and i64 %11, 255
%13 = trunc i64 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i64, i64* %4
%17 = lshr i64 %16, 8
%18 = and i64 %17, 255
%19 = trunc i64 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i64, i64* %4
%23 = and i64 %22, 255
%24 = trunc i64 %23 to i8
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
ret i64 4
}

LLVM IR (-O2):
define i64 @oui_append_4o(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
store i8 %4, i8* %0
%5 = lshr i64 %1, 16
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i64 %1, 8
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i64 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret i64 4
}
int __attribute__((noipa)) fn1(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @fn1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @fn1() {
ret i32 1
}
cmp(a, b) {
  if (!a && !b)
    return 0;
  if (a % 10 != b % 10)
    return a % 10 - b % 10;
  return cmp(a / 10, b / 10);
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113e <cmp+0x2e>
cmpl   $0x0,-0xc(%rbp)
jne    113e <cmp+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    11ae <cmp+0x9e>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x10(%rbp),%edx
cmp    %eax,%edx
je     118c <cmp+0x7c>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x14(%rbp),%edx
sub    %eax,%edx
mov    %edx,-0x4(%rbp)
jmp    11ae <cmp+0x9e>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <cmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    %esi,%eax
or     %edi,%eax
je     1149 <cmp+0x49>
movslq %edi,%rax
imul   $0x66666667,%rax,%rdi
mov    %rdi,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rdi
add    %ecx,%edi
lea    (%rdi,%rdi,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movslq %esi,%rcx
imul   $0x66666667,%rcx,%rsi
mov    %rsi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rsi
add    %edx,%esi
lea    (%rsi,%rsi,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
sub    %ecx,%eax
je     1100 <cmp>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cmp(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* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %8
store i32 0, i32* %3
br label %30
12: ; preds = %8, %2
%13 = load i32, i32* %4
%14 = srem i32 %13, 10
%15 = load i32, i32* %5
%16 = srem i32 %15, 10
%17 = icmp ne i32 %14, %16
br i1 %17, label %18, label %24
18: ; preds = %12
%19 = load i32, i32* %4
%20 = srem i32 %19, 10
%21 = load i32, i32* %5
%22 = srem i32 %21, 10
%23 = sub nsw i32 %20, %22
store i32 %23, i32* %3
br label %30
24: ; preds = %12
%25 = load i32, i32* %4
%26 = sdiv i32 %25, 10
%27 = load i32, i32* %5
%28 = sdiv i32 %27, 10
%29 = call i32 @cmp(i32 %26, i32 %28)
store i32 %29, i32* %3
br label %30
30: ; preds = %24, %18, %11
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @cmp(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %15
%6 = phi i32 [ %11, %15 ], [ %1, %2 ]
%7 = phi i32 [ %9, %15 ], [ %0, %2 ]
%8 = srem i32 %7, 10
%9 = sdiv i32 %7, 10
%10 = srem i32 %6, 10
%11 = sdiv i32 %6, 10
%12 = icmp eq i32 %8, %10
br i1 %12, label %15, label %13
13: ; preds = %5
%14 = sub nsw i32 %8, %10
br label %18
15: ; preds = %5
%16 = or i32 %11, %9
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %15, %2, %13
%19 = phi i32 [ %14, %13 ], [ 0, %2 ], [ 0, %15 ]
ret i32 %19
}
unsigned short int f61(unsigned short int x, int y) {
  return (x << ((-y) & (8 * sizeof(unsigned short) - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f61>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
movslq %ecx,%rcx
and    $0xf,%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f61>:
mov    %esi,%ecx
neg    %cl
and    $0xf,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f61(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = sext i32 %8 to i64
%10 = and i64 %9, 15
%11 = trunc i64 %10 to i32
%12 = shl i32 %6, %11
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = load i32, i32* %4
%16 = ashr i32 %14, %15
%17 = xor i32 %12, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f61(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub nsw i32 0, %1
%5 = and i32 %4, 15
%6 = shl nuw nsw i32 %3, %5
%7 = lshr i32 %3, %1
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}