xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog, int retval) {
  printf("Usage %s [-n <clients> -H <hostname> -P <port> -d]\n"
         "\t-H <remothost>\tSpecifies hostname (Default: 127.0.0.1)\n"
         "\t-P <port>\tSpecifies port (Default: 4300)\n"
         "\t-d\tEnables debug mode\n",
         prog);
  exit(retval);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [173 x i8] c"Usage %s [-n <clients> -H <hostname> -P <port> -d]\0A\09-H <remothost>\09Specifies hostname (Default: 127.0.0.1)\0A\09-P <port>\09Specifies port (Default: 4300)\0A\09-d\09Enables debug mode\0A\00"
define void @usage(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 = call i32 @printf(i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [173 x i8] c"Usage %s [-n <clients> -H <hostname> -P <port> -d]\0A\09-H <remothost>\09Specifies hostname (Default: 127.0.0.1)\0A\09-P <port>\09Specifies port (Default: 4300)\0A\09-d\09Enables debug mode\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("%d", EOF);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int *);
int fib(int n) {
  int i, t, a = 0, b = 1;
  for (i = 0; i < n; i++) {
    a += b;
    swap(&a, &b);
  }
  return b;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1160 <fib+0x50>
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <swap@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <fib+0x20>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0x8(%rsp)
test   %edi,%edi
jle    117a <fib+0x6a>
mov    %edi,%ebx
movl   $0x1,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <swap@plt>
mov    0x8(%rsp),%eax
cmp    $0x1,%ebx
je     117f <fib+0x6f>
add    $0xffffffff,%ebx
lea    0xc(%rsp),%r14
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %eax,0xc(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <swap@plt>
mov    0x8(%rsp),%eax
add    $0xffffffff,%ebx
jne    1160 <fib+0x50>
jmp    117f <fib+0x6f>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %20
7: ; preds = %1
store i32 1, i32* %2
%8 = call i32 @swap(i32* %2, i32* %3)
%9 = icmp eq i32 %0, 1
%10 = load i32, i32* %3
br i1 %9, label %20, label %11
11: ; preds = %7, %11
%12 = phi i32 [ %19, %11 ], [ %10, %7 ]
%13 = phi i32 [ %17, %11 ], [ 1, %7 ]
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %12
store i32 %15, i32* %2
%16 = call i32 @swap(i32* %2, i32* %3)
%17 = add nuw nsw i32 %13, 1
%18 = icmp eq i32 %17, %0
%19 = load i32, i32* %3
br i1 %18, label %20, label %11
20: ; preds = %11, %7, %1
%21 = phi i32 [ 1, %1 ], [ %10, %7 ], [ %19, %11 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcpy(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char str1[3] = "abc";
  char str2[3] = "def";
  ft_strcpy(str2, str1);
  printf(str2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xec2(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0x7(%rbp),%rsi
call   1030 <ft_strcpy@plt>
lea    -0xa(%rbp),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x63,0xe(%rsp)
movw   $0x6261,0xc(%rsp)
movb   $0x66,0xa(%rsp)
movw   $0x6564,0x8(%rsp)
lea    0x8(%rsp),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <ft_strcpy@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str1 = [3 x i8] c"abc"
@__const.main.str2 = [3 x i8] c"def"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca [3 x i8]
store i32 0, i32* %1
%4 = bitcast [3 x i8]* %2 to i8*
%5 = bitcast [3 x i8]* %3 to i8*
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%8 = call i32 @ft_strcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [3 x i8] c"abc"
@__const.main.str2 = [3 x i8] c"def"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @ft_strcpy(i8* %4, i8* %3)
%6 = call i32 @printf(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set_value(int, int /*<<< orphan*/);
void module_spi_off(void) { gpio_set_value(6, 0); }


x86 assembly (clang, -O0):
<module_spi_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <gpio_set_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_spi_off>:
mov    $0x6,%edi
xor    %esi,%esi
jmp    1030 <gpio_set_value@plt>

LLVM IR (-O0):
define void @module_spi_off() {
%1 = call i32 @gpio_set_value(i32 6, i32 0)
ret void
}

LLVM IR (-O2):
define void @module_spi_off() {
%1 = tail call i32 @gpio_set_value(i32 6, i32 0)
ret void
}
/* Variables and functions */
int SIM_power_draincap(int, int, int);
double SIM_grp_out_cap(void) {
  return (2 * SIM_power_draincap((3 * ((0.8 * 0.0875) * 0.5)), 1, 1) +
          SIM_power_draincap((12 * ((0.8 * 0.0875) * 0.5)), 0, 2));
}


x86 assembly (clang, -O0):
<SIM_grp_out_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <SIM_power_draincap@plt>
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
xor    %esi,%esi
mov    $0x2,%edx
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_grp_out_cap>:
push   %rbx
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ebx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <SIM_power_draincap@plt>
lea    (%rax,%rbx,2),%eax
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @SIM_grp_out_cap() {
%1 = call i32 @SIM_power_draincap(i32 0, i32 1, i32 1)
%2 = mul nsw i32 2, %1
%3 = call i32 @SIM_power_draincap(i32 0, i32 0, i32 2)
%4 = add nsw i32 %2, %3
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @SIM_grp_out_cap() {
%1 = tail call i32 @SIM_power_draincap(i32 0, i32 1, i32 1)
%2 = shl nsw i32 %1, 1
%3 = tail call i32 @SIM_power_draincap(i32 0, i32 0, i32 2)
%4 = add nsw i32 %2, %3
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int strlen(char *);
int device_isValid_id(char *id) {
  int type;
  type = id[0] - 48;
  if (type < 0 || type > 2)
    return 0;
  if (strlen(id) != 9)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<device_isValid_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     113d <device_isValid_id+0x2d>
cmpl   $0x2,-0x14(%rbp)
jle    1149 <device_isValid_id+0x39>
movl   $0x0,-0x4(%rbp)
jmp    116e <device_isValid_id+0x5e>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x9,%eax
je     1167 <device_isValid_id+0x57>
movl   $0x0,-0x4(%rbp)
jmp    116e <device_isValid_id+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<device_isValid_id>:
push   %rax
mov    (%rdi),%cl
add    $0xcd,%cl
xor    %eax,%eax
cmp    $0xfd,%cl
jb     112c <device_isValid_id+0x1c>
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @device_isValid_id(i8* %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -51
%4 = icmp ult i8 %3, -3
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i32 @strlen(i8* %0)
%7 = icmp eq i32 %6, 9
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void dacon() {
  *((volatile uint32_t *)(0x400c8000 + 0x044)) |= (1 << 17);
  *((volatile uint32_t *)(0x40004000 + 0x000)) = 0x50010;
  *((volatile uint32_t *)(0x40004000 + 0x008)) = 1;
  *((volatile uint32_t *)(0x40004000 + 0x00c)) = 1;
}


x86 assembly (clang, -O0):
<dacon>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400c8044,%eax
mov    (%rax),%ecx
or     $0x20000,%ecx
mov    $0x400c8044,%eax
mov    %ecx,(%rax)
mov    $0x40004000,%eax
movl   $0x50010,(%rax)
mov    $0x40004008,%eax
movl   $0x1,(%rax)
mov    $0x4000400c,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dacon>:
orl    $0x20000,0x400c8044
movl   $0x50010,0x40004000
movl   $0x1,0x40004008
movl   $0x1,0x4000400c
ret

LLVM IR (-O0):
define void @dacon() {
%1 = load volatile i32, i32* inttoptr (i64 1074561092 to i32*)
%2 = or i32 %1, 131072
store volatile i32 %2, i32* inttoptr (i64 1074561092 to i32*)
store volatile i32 327696, i32* inttoptr (i64 1073758208 to i32*)
store volatile i32 1, i32* inttoptr (i64 1073758216 to i32*)
store volatile i32 1, i32* inttoptr (i64 1073758220 to i32*)
ret void
}

LLVM IR (-O2):
define void @dacon() {
%1 = load volatile i32, i32* inttoptr (i64 1074561092 to i32*)
%2 = or i32 %1, 131072
store volatile i32 %2, i32* inttoptr (i64 1074561092 to i32*)
store volatile i32 327696, i32* inttoptr (i64 1073758208 to i32*)
store volatile i32 1, i32* inttoptr (i64 1073758216 to i32*)
store volatile i32 1, i32* inttoptr (i64 1073758220 to i32*)
ret void
}
void foo318(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo318(i32 %0) {
ret void
}
unsigned xrop3_137_0_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;
  unsigned stk3;
  unsigned stk4;
  stk4 = ~S;
  stk3 = T & stk4;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_137_0_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    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_137_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rdi,%rax,1),%ecx
shl    $0x8,%esi
not    %eax
and    %esi,%eax
or     $0xff,%eax
xor    %ecx,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_137_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, 255
%11 = xor i32 %5, %10
%12 = xor i32 %11, -1
ret i32 %12
}
/* Type definitions */
struct buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bufprintf(struct buf *, char *, unsigned int, unsigned int,
                             unsigned int);
int rndr_footnote_ref(struct buf *ob, unsigned int num, void *opaque) {
  bufprintf(
      ob, "<sup id=\"fnref%d\"><a href=\"#fn%d\" rel=\"footnote\">%d</a></sup>",
      num, num, num);
  return 1;
}


x86 assembly (clang, -O0):
<rndr_footnote_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xec8(%rip),%rsi
call   1030 <bufprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndr_footnote_ref>:
push   %rax
mov    %esi,%ecx
lea    0xee6(%rip),%rsi
mov    %ecx,%edx
mov    %ecx,%r8d
call   1030 <bufprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.buf = type { i32 }
@.str = [62 x i8] c"<sup id=\22fnref%d\22><a href=\22#fn%d\22 rel=\22footnote\22>%d</a></sup>\00"
define i32 @rndr_footnote_ref(%struct.buf* %0, i32 %1, i8* %2) {
%4 = alloca %struct.buf*
%5 = alloca i32
%6 = alloca i8*
store %struct.buf* %0, %struct.buf** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.buf*, %struct.buf** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %5
%11 = call i32 @bufprintf(%struct.buf* %7, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 1
}

LLVM IR (-O2):
%struct.buf = type { i32 }
@.str = [62 x i8] c"<sup id=\22fnref%d\22><a href=\22#fn%d\22 rel=\22footnote\22>%d</a></sup>\00"
define i32 @rndr_footnote_ref(%struct.buf* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @bufprintf(%struct.buf* %0, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1, i32 %1)
ret i32 1
}
void change_g(double *g) {
  *g += 0.1;
  return;
}


x86 assembly (clang, -O0):
<change_g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_g>:
movsd  (%rdi),%xmm0
addsd  0xef4(%rip),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @change_g(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = fadd double %4, 1.000000e-01
store double %5, double* %3
ret void
}

LLVM IR (-O2):
define void @change_g(double* nocapture %0) {
%2 = load double, double* %0
%3 = fadd double %2, 1.000000e-01
store double %3, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ warn(char *);
void unbootable(void) {
  warn("The system is unbootable !\n"
       "\t Run LILO again to correct this.");
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"The system is unbootable !\0A\09 Run LILO again to correct this.\00"
define void @unbootable() {
%1 = call i32 @warn(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"The system is unbootable !\0A\09 Run LILO again to correct this.\00"
define void @unbootable() {
%1 = tail call i32 @warn(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void output(int *array, size_t len) {
  int i;
  for (i = 0; i < len; i++) {
    printf("%2i ", array[i]);
  }
  puts("");
  return;
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116a <output+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <output+0x17>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1155 <output+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <output+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%2i \00"
define void @output(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ strncasecmp(char *, char *, int);
int main() {
  char buf[8];
  buf[0] = 0xFF;
  return strncasecmp(buf, "AAAA", 4) == 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xff,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0xff,(%rsp)
lea    0xee4(%rip),%rsi
mov    %rsp,%rdi
mov    $0x4,%edx
call   1030 <strncasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"AAAA\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
store i8 -1, i8* %3
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%5 = call i64 @strncasecmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"AAAA\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
store i8 -1, i8* %2
%3 = call i64 @strncasecmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void ui_begin_update(void) {}


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

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

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

LLVM IR (-O2):
define void @ui_begin_update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int drv_LW_ABP_list(void) {
  printf("Logic Way ABP driver");
  return 0;
}


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

x86 assembly (clang, -O2):
<drv_LW_ABP_list>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Logic Way ABP driver\00"
define i32 @drv_LW_ABP_list() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Logic Way ABP driver\00"
define i32 @drv_LW_ABP_list() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func(int);
int *malloc(int);
int main() {
  int avar = 9;
  int *p = malloc(1);
  func(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 1)
%2 = tail call i32 @func(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void pass(void) {
  char s[] = "passed.\n";
  write(1, s, sizeof(s) - 1);
  exit(0);
}


x86 assembly (clang, -O0):
<pass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x9(%rbp),%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pass>:
sub    $0x18,%rsp
movabs $0xa2e646573736170,%rax
64 2e 0a
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@__const.pass.s = [9 x i8] c"passed.\0A\00"
define void @pass() {
%1 = alloca [9 x i8]
%2 = bitcast [9 x i8]* %1 to i8*
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = call i32 @write(i32 1, i8* %3, i32 8)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@__const.pass.s = [9 x i8] c"passed.\0A\00"
define void @pass() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 1, i8* %2, i32 8)
%4 = tail call i32 @exit(i32 0)
unreachable
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/absyndump.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/absyndump.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/absyndump.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  register unsigned long lesp asm("esp");
  unsigned long llesp asm("esp");
  register unsigned long lsp asm("sp");
  printf("%lx\n", lesp);
  printf("%lx\n", llesp);
  printf("%lx\n", lsp);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lx\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 undef)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 undef)
ret i32 0
}
int test_imm_ADint16_mem(short *val) {
  return ((*val) & (-0xAD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ADint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff53,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ADint16_mem>:
movzwl (%rdi),%eax
test   $0xff53,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ADint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -173
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
_Complex float test_catanhf(_Complex float x) { return __builtin_catanhf(x); }


x86 assembly (clang, -O0):
<test_catanhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <catanhf@plt>
movlpd %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_catanhf>:
jmp    1030 <catanhf@plt>

LLVM IR (-O0):
define <2 x float> @test_catanhf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%12 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
store float %8, float* %11
store float %10, float* %12
%13 = bitcast { float, float }* %4 to <2 x float>*
%14 = load <2 x float>, <2 x float>* %13
%15 = call <2 x float> @catanhf(<2 x float> %14)
%16 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %15, <2 x float>* %16
%17 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%20 = load float, float* %19
%21 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%22 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %18, float* %21
store float %20, float* %22
%23 = bitcast { float, float }* %2 to <2 x float>*
%24 = load <2 x float>, <2 x float>* %23
ret <2 x float> %24
}

LLVM IR (-O2):
define <2 x float> @test_catanhf(<2 x float> %0) {
%2 = tail call <2 x float> @catanhf(<2 x float> %0)
ret <2 x float> %2
}
void nop_include_path(char *path) { (void)path; }


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

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

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

LLVM IR (-O2):
define void @nop_include_path(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_equal(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                                int);
int /*<<< orphan*/ sieve_num_primes(int /*<<< orphan*/ *);
void __ctest_sieve_num_primes_returns_0_given_NULL_run() {
  assert_equal(0, sieve_num_primes(NULL),
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/kjmj/c-sieve/refs/heads/"
               "master/src/test/test_sieve.c",
               70);
}


x86 assembly (clang, -O0):
<__ctest_sieve_num_primes_returns_0_given_NULL_run>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <sieve_num_primes@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xec8(%rip),%rdx
mov    $0x46,%ecx
call   1040 <assert_equal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ctest_sieve_num_primes_returns_0_given_NULL_run>:
push   %rax
xor    %edi,%edi
call   1030 <sieve_num_primes@plt>
lea    0xed1(%rip),%rdx
xor    %edi,%edi
mov    %eax,%esi
mov    $0x46,%ecx
pop    %rax
jmp    1040 <assert_equal@plt>

LLVM IR (-O0):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kjmj/c-sieve/refs/heads/master/src/test/test_sieve.c\00"
define void @__ctest_sieve_num_primes_returns_0_given_NULL_run() {
%1 = call i32 @sieve_num_primes(i32* null)
%2 = call i32 @assert_equal(i32 0, i32 %1, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 70)
ret void
}

LLVM IR (-O2):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kjmj/c-sieve/refs/heads/master/src/test/test_sieve.c\00"
define void @__ctest_sieve_num_primes_returns_0_given_NULL_run() {
%1 = tail call i32 @sieve_num_primes(i32* null)
%2 = tail call i32 @assert_equal(i32 0, i32 %1, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 70)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ start_file(int /*<<< orphan*/ *);
int tga_test();
int stbi_tga_test_file(FILE *f) {
  int r, n = ftell(f);
  start_file(f);
  r = tga_test();
  fseek(f, n, SEEK_SET);
  return r;
}


x86 assembly (clang, -O0):
<stbi_tga_test_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <start_file@plt>
mov    $0x0,%al
call   1040 <tga_test@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    0x2e67(%rip),%rax
mov    (%rax),%edx
call   1060 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi_tga_test_file>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1050 <ftell@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <start_file@plt>
xor    %eax,%eax
call   1040 <tga_test@plt>
mov    %eax,%ebp
mov    0x2e79(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1060 <fseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @stbi_tga_test_file(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @ftell(i32* %5)
store i32 %6, i32* %4
%7 = load i32*, i32** %2
%8 = call i32 @start_file(i32* %7)
%9 = call i32 (...) @tga_test()
store i32 %9, i32* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* %4
%12 = load i32, i32* @SEEK_SET
%13 = call i32 @fseek(i32* %10, i32 %11, i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @stbi_tga_test_file(i32* %0) {
%2 = tail call i32 @ftell(i32* %0)
%3 = tail call i32 @start_file(i32* %0)
%4 = tail call i32 (...) @tga_test()
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 %2, i32 %5)
ret i32 %4
}
/* Type definitions */
typedef int u32Reg;

/* Variables and functions */
unsigned short RIU_READ_2BYTE(int);
unsigned short SC_R2BYTEMSK(unsigned int u32Reg, unsigned short u16mask) {
  return (RIU_READ_2BYTE((0x130000 + ((u32Reg)&0xFFFF)) << 1) & (u16mask));
}


x86 assembly (clang, -O0):
<SC_R2BYTEMSK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
add    $0x130000,%edi
shl    $0x1,%edi
call   1030 <RIU_READ_2BYTE@plt>
movzwl %ax,%eax
movzwl -0x6(%rbp),%ecx
and    %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SC_R2BYTEMSK>:
push   %rbx
mov    %esi,%ebx
movzwl %di,%eax
lea    (%rax,%rax,1),%edi
add    $0x260000,%edi
call   1030 <RIU_READ_2BYTE@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @SC_R2BYTEMSK(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 65535
%7 = add i32 1245184, %6
%8 = shl i32 %7, 1
%9 = call zeroext i16 @RIU_READ_2BYTE(i32 %8)
%10 = zext i16 %9 to i32
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @SC_R2BYTEMSK(i32 %0, i16 zeroext %1) {
%3 = shl i32 %0, 1
%4 = and i32 %3, 131070
%5 = or i32 %4, 2490368
%6 = tail call zeroext i16 @RIU_READ_2BYTE(i32 %5)
%7 = and i16 %6, %1
ret i16 %7
}
void val_delete_itemfunc(void *v) { (void)v; }


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

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

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

LLVM IR (-O2):
define void @val_delete_itemfunc(i8* nocapture %0) {
ret void
}
double sum_or_substract(double number1, double number2) {
  double result;
  if ((number1 > 0.0 && number2 < number1) || (number1 + number2 < 25.0)) {
    result = number1 + number2;
  } else {
    result = number2 - number1;
  }
  return result;
}


x86 assembly (clang, -O0):
<sum_or_substract>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1134 <sum_or_substract+0x34>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1150 <sum_or_substract+0x50>
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xeba(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1164 <sum_or_substract+0x64>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1173 <sum_or_substract+0x73>
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_or_substract>:
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
movapd %xmm2,%xmm4
cmpltsd 0xee3(%rip),%xmm4
movapd %xmm4,%xmm5
andpd  %xmm2,%xmm5
andnpd %xmm3,%xmm4
orpd   %xmm5,%xmm4
xorpd  %xmm3,%xmm3
cmpltsd %xmm0,%xmm3
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm4,%xmm1
orpd   %xmm1,%xmm2
andpd  %xmm3,%xmm2
andnpd %xmm4,%xmm3
orpd   %xmm3,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @sum_or_substract(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fcmp olt double %9, %10
br i1 %11, label %17, label %12
12: ; preds = %8, %2
%13 = load double, double* %3
%14 = load double, double* %4
%15 = fadd double %13, %14
%16 = fcmp olt double %15, 2.500000e+01
br i1 %16, label %17, label %21
17: ; preds = %12, %8
%18 = load double, double* %3
%19 = load double, double* %4
%20 = fadd double %18, %19
store double %20, double* %5
br label %25
21: ; preds = %12
%22 = load double, double* %4
%23 = load double, double* %3
%24 = fsub double %22, %23
store double %24, double* %5
br label %25
25: ; preds = %21, %17
%26 = load double, double* %5
ret double %26
}

LLVM IR (-O2):
define double @sum_or_substract(double %0, double %1) {
%3 = fcmp ogt double %0, 0.000000e+00
%4 = fcmp olt double %1, %0
%5 = and i1 %3, %4
%6 = fadd double %0, %1
%7 = fcmp olt double %6, 2.500000e+01
%8 = or i1 %5, %7
%9 = fsub double %1, %0
%10 = select i1 %8, double %6, double %9
ret double %10
}
/* Variables and functions */
unsigned char *rd_24section(char *);
int /*<<< orphan*/ set_HasGDS(unsigned char *);
int /*<<< orphan*/ set_PDSGridType(unsigned char *, int);
unsigned char *rd_GDS(unsigned char *pds, char *filename, int grid_type) {
  if (pds) {
    set_PDSGridType(pds, grid_type);
    set_HasGDS(pds);
  }
  return rd_24section(filename);
}


x86 assembly (clang, -O0):
<rd_GDS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <rd_GDS+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <set_PDSGridType@plt>
mov    -0x8(%rbp),%rdi
call   1040 <set_HasGDS@plt>
mov    -0x10(%rbp),%rdi
call   1030 <rd_24section@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_GDS>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %rdi,%rdi
je     114e <rd_GDS+0x1e>
mov    %rdi,%rbx
mov    %edx,%esi
call   1050 <set_PDSGridType@plt>
mov    %rbx,%rdi
call   1040 <set_HasGDS@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <rd_24section@plt>

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

LLVM IR (-O2):
define i8* @rd_GDS(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @set_PDSGridType(i8* %0, i32 %2)
%7 = tail call i32 @set_HasGDS(i8* %0)
br label %8
8: ; preds = %5, %3
%9 = tail call i8* @rd_24section(i8* %1)
ret i8* %9
}
unsigned char explicit_unsigned_char_to_signed_char(unsigned char src) {
  return (unsigned char)src;
}


x86 assembly (clang, -O0):
<explicit_unsigned_char_to_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @explicit_unsigned_char_to_signed_char(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @explicit_unsigned_char_to_signed_char(i8 returned zeroext %0) {
ret i8 %0
}