xunge/DecIR huggingface dataset:
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int x;
  int result;
  printf("x: ");
  scanf("%d", &x);
  result = factorial(x);
  printf("factorial(%d) = %d\n", x, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <factorial@plt>
mov    0x4(%rsp),%esi
lea    0xea3(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"x: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"factorial(%d) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
void RTHeapSimpleInit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHeapSimpleInit() {
ret void
}
__attribute__((intel_ocl_bicc)) int add_inteloclbicc(int a, int b) {
  return a + b;
}


x86 assembly (clang, -O0):
<add_inteloclbicc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_inteloclbicc>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define intel_ocl_bicc i32 @add_inteloclbicc(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define intel_ocl_bicc i32 @add_inteloclbicc(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  short ascent;
};
typedef TYPE_1__ XCharStruct;

/* Variables and functions */
void set_XCharStruct_ascent(void *_p, short _v) {
  ((XCharStruct *)_p)->ascent = (short)_v;
}


x86 assembly (clang, -O0):
<set_XCharStruct_ascent>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XCharStruct_ascent>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XCharStruct_ascent(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XCharStruct_ascent(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
char *strrchr(const char *s, int c) {
  char *res;
  res = (char *)0;
  while (1) {
    if (*s == (char)c)
      res = (char *)s;
    if (*s == '\0')
      break;
    s++;
  }
  return res;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1130 <strrchr+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1145 <strrchr+0x45>
jmp    1156 <strrchr+0x56>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
movsbl %sil,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movsbl (%rdi),%edx
cmp    %edx,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %edx,%edx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %0, %2 ], [ %13, %5 ]
%7 = phi i8* [ null, %2 ], [ %11, %5 ]
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %4, %9
%11 = select i1 %10, i8* %6, i8* %7
%12 = icmp eq i8 %8, 0
%13 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %12, label %14, label %5
14: ; preds = %5
ret i8* %11
}
int cse_rtx_addr_varies_p(void *x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cse_rtx_addr_varies_p(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void version(void) {
  printf("\nPrintenv v1.0\n");
  printf("Written by J. Lysy\n\n");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\0APrintenv v1.0\0A\00"
@.str.1 = [21 x i8] c"Written by J. Lysy\0A\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [15 x i8] c"\0APrintenv v1.0\00"
@str.2 = [20 x i8] c"Written by J. Lysy\0A\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void XpmFree(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @XpmFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int pixel_get_b(unsigned int pixel) { return (pixel & 0xFF0000) >> 16; }


x86 assembly (clang, -O0):
<pixel_get_b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
shr    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_get_b>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @pixel_get_b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711680
%5 = lshr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @pixel_get_b(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ warn_error(char const *, int /*<<< orphan*/);
void warn_errno(const char *message) { warn_error(message, errno); }


x86 assembly (clang, -O0):
<warn_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <warn_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_errno>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <warn_error@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @warn_errno(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i32 @warn_error(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @warn_errno(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @warn_error(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void charptr_free(void *o) {
  if (o) {
    free(o);
  }
}


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

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

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

LLVM IR (-O2):
define void @charptr_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int numberOfDirs(char one, char two) {
  char num[1];
  num[0] = two;
  num[1] = one;
  int b = (num[0] << 8) | num[1];
  return b;
}


x86 assembly (clang, -O0):
<numberOfDirs>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movsbl -0x3(%rbp),%eax
shl    $0x8,%eax
movsbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @numberOfDirs(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca [1 x i8]
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i8, i8* %3
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = or i32 %14, %17
store i32 %18, i32* %6
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
define i32 @numberOfDirs(i8 signext %0, i8 signext %1) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ dhcp_packet(int, char *, int /*<<< orphan*/ *, char *,
                               char *, char *, char *);
void dhcp_discover(char *ipaddr, char *gwaddr, char *hardware, char *opt82,
                   char *opt60) {
  dhcp_packet(1, ipaddr, NULL, opt60, opt82, gwaddr, hardware);
}


x86 assembly (clang, -O0):
<dhcp_discover>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rax
mov    $0x1,%edi
xor    %edx,%edx
mov    %rax,(%rsp)
call   1030 <dhcp_packet@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcp_discover>:
push   %rax
mov    %rcx,%rax
mov    %rsi,%r9
mov    %rdi,%rsi
mov    %rdx,(%rsp)
mov    $0x1,%edi
xor    %edx,%edx
mov    %r8,%rcx
mov    %rax,%r8
call   1030 <dhcp_packet@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @dhcp_discover(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %10
%13 = load i8*, i8** %9
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i32 @dhcp_packet(i32 1, i8* %11, i32* null, i8* %12, i8* %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @dhcp_discover(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @dhcp_packet(i32 1, i8* %0, i32* null, i8* %4, i8* %3, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int sapi_unix_tcp_transmit(int, char *, int);
int sapi_write_syslog_msg(int syslog_sock, char *msg, int len) {
  return sapi_unix_tcp_transmit(syslog_sock, msg, len);
}


x86 assembly (clang, -O0):
<sapi_write_syslog_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <sapi_unix_tcp_transmit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sapi_write_syslog_msg>:
jmp    1030 <sapi_unix_tcp_transmit@plt>

LLVM IR (-O0):
define i32 @sapi_write_syslog_msg(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @sapi_unix_tcp_transmit(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sapi_write_syslog_msg(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @sapi_unix_tcp_transmit(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct libevent {
  int dummy;
};

/* Variables and functions */
int FD_SETSIZE;
int libevent_api_resize(struct libevent *evt, int size) {
  (void)evt;
  if (size >= FD_SETSIZE)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<libevent_api_resize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ecb(%rip),%rcx
cmp    (%rcx),%eax
jl     1129 <libevent_api_resize+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1130 <libevent_api_resize+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libevent_api_resize>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
cmp    %esi,(%rcx)
setle  %al
neg    %eax
ret

LLVM IR (-O0):
%struct.libevent = type { i32 }
@FD_SETSIZE = global i32 0
define i32 @libevent_api_resize(%struct.libevent* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.libevent*
%5 = alloca i32
store %struct.libevent* %0, %struct.libevent** %4
store i32 %1, i32* %5
%6 = load %struct.libevent*, %struct.libevent** %4
%7 = load i32, i32* %5
%8 = load i32, i32* @FD_SETSIZE
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.libevent = type { i32 }
@FD_SETSIZE = global i32 0
define i32 @libevent_api_resize(%struct.libevent* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @FD_SETSIZE
%4 = icmp sle i32 %3, %1
%5 = sext i1 %4 to i32
ret i32 %5
}
void pci_restore_pri_state(struct pci_dev *pdev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_restore_pri_state(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int stringlength(char *str) {
  int count = 0;
  while (*str++ != '\0') {
    count++;
  }
  printf("count is %d\n ", count);
  return count;
}


x86 assembly (clang, -O0):
<stringlength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <stringlength+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <stringlength+0x13>
mov    -0xc(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringlength>:
push   %rbx
cmpb   $0x0,(%rdi)
je     112d <stringlength+0x1d>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1120 <stringlength+0x10>
jmp    112f <stringlength+0x1f>
xor    %ebx,%ebx
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"count is %d\0A \00"
define i32 @stringlength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
%13 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 %12
}
void b_file_close(unsigned long handle) {
  asm volatile("call *0x00100078" : : "a"(handle));
}


x86 assembly (clang, -O0):
<b_file_close>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
call   *0x100078
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_file_close>:
mov    %rdi,%rax
call   *0x100078
ret

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

LLVM IR (-O2):
define void @b_file_close(i64 %0) {
tail call void asm sideeffect "call *0x00100078", "{ax},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int __sysapi_create_timer(long, long, int);
int sysapi_create_interval_timer(long secs, long usecs) {
  return __sysapi_create_timer(secs, usecs, 1);
}


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

x86 assembly (clang, -O2):
<sysapi_create_interval_timer>:
mov    $0x1,%edx
jmp    1030 <__sysapi_create_timer@plt>

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

LLVM IR (-O2):
define i32 @sysapi_create_interval_timer(i64 %0, i64 %1) {
%3 = tail call i32 @__sysapi_create_timer(i64 %0, i64 %1, i32 1)
ret i32 %3
}
unsigned char return_uc(unsigned char uc) { return uc; }


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

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

LLVM IR (-O0):
define zeroext i8 @return_uc(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 @return_uc(i8 returned zeroext %0) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ _debug(char *, int, int /*<<< orphan*/, char *);
int iptables_fw_auth_reachable();
int fw_set_authup(void) {
  _debug("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/GaomingPan/wifidog-gateway/refs/heads/"
         "master/src/firewall.c",
         148, LOG_DEBUG, "Marking auth server up again");
  return iptables_fw_auth_reachable();
}


x86 assembly (clang, -O0):
<fw_set_authup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
lea    0xecc(%rip),%rdi
mov    $0x94,%esi
lea    0xf56(%rip),%rcx
call   1030 <_debug@plt>
mov    $0x0,%al
call   1040 <iptables_fw_auth_reachable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_set_authup>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xf5e(%rip),%rcx
mov    $0x94,%esi
call   1030 <_debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <iptables_fw_auth_reachable@plt>

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/GaomingPan/wifidog-gateway/refs/heads/master/src/firewall.c\00"
@LOG_DEBUG = global i32 0
@.str.1 = [29 x i8] c"Marking auth server up again\00"
define i32 @fw_set_authup() {
%1 = load i32, i32* @LOG_DEBUG
%2 = call i32 @_debug(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 148, i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @iptables_fw_auth_reachable()
ret i32 %3
}

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/GaomingPan/wifidog-gateway/refs/heads/master/src/firewall.c\00"
@LOG_DEBUG = global i32 0
@.str.1 = [29 x i8] c"Marking auth server up again\00"
define i32 @fw_set_authup() {
%1 = load i32, i32* @LOG_DEBUG
%2 = tail call i32 @_debug(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 148, i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @iptables_fw_auth_reachable()
ret i32 %3
}
int test_imm_A2int16_mem(short *val) {
  return ((*val) & (0xA2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A2int16_mem>:
testb  $0xa2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A2int16_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, 162
%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_A2int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 162
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_5Auint8_reg(unsigned char val) {
  return ((val) & (-0x5A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Auint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffa6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_5Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -90
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ semV(int);
void newDbFileUnlock(void) {
  semV(8620);
  ;
}


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

x86 assembly (clang, -O2):
<newDbFileUnlock>:
mov    $0x21ac,%edi
jmp    1030 <semV@plt>

LLVM IR (-O0):
define void @newDbFileUnlock() {
%1 = call i32 @semV(i32 8620)
ret void
}

LLVM IR (-O2):
define void @newDbFileUnlock() {
%1 = tail call i32 @semV(i32 8620)
ret void
}
int anyWild(const char *string) {
  char c;
  while ((c = *string++) != 0) {
    if (c == '?' || c == '*')
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<anyWild>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1153 <anyWild+0x53>
movsbl -0x11(%rbp),%eax
cmp    $0x3f,%eax
je     1142 <anyWild+0x42>
movsbl -0x11(%rbp),%eax
cmp    $0x2a,%eax
jne    114e <anyWild+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    115a <anyWild+0x5a>
jmp    1108 <anyWild+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<anyWild>:
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
test   %cl,%cl
je     1126 <anyWild+0x26>
cmp    $0x3f,%cl
je     1125 <anyWild+0x25>
add    $0x1,%rdi
cmp    $0x2a,%cl
jne    1110 <anyWild+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @anyWild(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
switch i8 %4, label %2 [
i8 63, label %8
i8 42, label %8
]
8: ; preds = %2, %6, %6
%9 = phi i32 [ 1, %6 ], [ 1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t abs16(uint16_t val) {
  if (val == 0x8000) {
    return 0x7fff;
  }
  if (val & 0x8000) {
    val = ~val;
    return val + 1;
  }
  return val;
}


x86 assembly (clang, -O0):
<abs16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x8000,-0x8(%rbp)
jne    1120 <abs16+0x20>
movl   $0x7fff,-0x4(%rbp)
jmp    114e <abs16+0x4e>
mov    -0x8(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1148 <abs16+0x48>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114e <abs16+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs16>:
mov    %edi,%ecx
neg    %ecx
test   $0x8000,%edi
cmove  %edi,%ecx
cmp    $0x8000,%edi
mov    $0x7fff,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @abs16(i32 %0) {
%2 = icmp eq i32 %0, 32768
%3 = and i32 %0, 32768
%4 = icmp eq i32 %3, 0
%5 = sub i32 0, %0
%6 = select i1 %4, i32 %0, i32 %5
%7 = select i1 %2, i32 32767, i32 %6
ret i32 %7
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_min(float *, float *, float *);
__attribute__((always_)) struct vec2 *
psvec2_min(struct vec2 *result, struct vec2 *a, struct vec2 *b) {
  vec2_min((float *)result, (float *)a, (float *)b);
  return result;
}


x86 assembly (clang, -O0):
<psvec2_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <vec2_min@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2_min>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_min@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_min(%struct.vec2* %0, %struct.vec2* %1, %struct.vec2* %2) {
%4 = alloca %struct.vec2*
%5 = alloca %struct.vec2*
%6 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %4
store %struct.vec2* %1, %struct.vec2** %5
store %struct.vec2* %2, %struct.vec2** %6
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = load %struct.vec2*, %struct.vec2** %5
%10 = bitcast %struct.vec2* %9 to float*
%11 = load %struct.vec2*, %struct.vec2** %6
%12 = bitcast %struct.vec2* %11 to float*
%13 = call i32 @vec2_min(float* %8, float* %10, float* %12)
%14 = load %struct.vec2*, %struct.vec2** %4
ret %struct.vec2* %14
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_min(%struct.vec2* returned %0, %struct.vec2* %1, %struct.vec2* %2) {
%4 = bitcast %struct.vec2* %0 to float*
%5 = bitcast %struct.vec2* %1 to float*
%6 = bitcast %struct.vec2* %2 to float*
%7 = tail call i32 @vec2_min(float* %4, float* %5, float* %6)
ret %struct.vec2* %0
}
/* Variables and functions */
float max(float, float);
float ops(float a, float b) { return max(-a, b); }


x86 assembly (clang, -O0):
<ops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ops>:
xorps  0xee9(%rip),%xmm0
jmp    1030 <max@plt>

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

LLVM IR (-O2):
define float @ops(float %0, float %1) {
%3 = fneg float %0
%4 = tail call float @max(float %3, float %1)
ret float %4
}
void test_GOTO() {}


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

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

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

LLVM IR (-O2):
define void @test_GOTO() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENC1_DriverIRQHandler();
__attribute__((weak)) void ENC1_IRQHandler(void) { ENC1_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @ENC1_IRQHandler() {
%1 = call i32 (...) @ENC1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ENC1_IRQHandler() {
%1 = tail call i32 (...) @ENC1_DriverIRQHandler()
ret void
}
void RTAvlrFileOffsetDoWithAll(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrFileOffsetDoWithAll() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _s2priv_funab(float (*)(float *, float *), int, int, float,
                                 float, float, float, int, int, int, float,
                                 float);
void s2funyzr(float (*fyz)(float *, float *), int ny, int nz, float ymin,
              float ymax, float zmin, float zmax, int ctl, float rmin,
              float rmax) {
  _s2priv_funab(fyz, ny, nz, ymin, ymax, zmin, zmax, 1, 2, ctl, rmin, rmax);
}


x86 assembly (clang, -O0):
<s2funyzr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
movss  %xmm3,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movss  %xmm4,-0x28(%rbp)
movss  %xmm5,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm3
mov    -0x24(%rbp),%r9d
movss  -0x28(%rbp),%xmm4
movss  -0x2c(%rbp),%xmm5
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1030 <_s2priv_funab@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2funyzr>:
mov    %ecx,%r9d
mov    $0x1,%ecx
mov    $0x2,%r8d
jmp    1030 <_s2priv_funab@plt>

LLVM IR (-O0):
define void @s2funyzr(float (float*, float*)* %0, i32 %1, i32 %2, float %3, float %4, float %5, float %6, i32 %7, float %8, float %9) {
%11 = alloca float (float*, float*)*
%12 = alloca i32
%13 = alloca i32
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca i32
%19 = alloca float
%20 = alloca float
store float (float*, float*)* %0, float (float*, float*)** %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store float %3, float* %14
store float %4, float* %15
store float %5, float* %16
store float %6, float* %17
store i32 %7, i32* %18
store float %8, float* %19
store float %9, float* %20
%21 = load float (float*, float*)*, float (float*, float*)** %11
%22 = load i32, i32* %12
%23 = load i32, i32* %13
%24 = load float, float* %14
%25 = load float, float* %15
%26 = load float, float* %16
%27 = load float, float* %17
%28 = load i32, i32* %18
%29 = load float, float* %19
%30 = load float, float* %20
%31 = call i32 @_s2priv_funab(float (float*, float*)* %21, i32 %22, i32 %23, float %24, float %25, float %26, float %27, i32 1, i32 2, i32 %28, float %29, float %30)
ret void
}

LLVM IR (-O2):
define void @s2funyzr(float (float*, float*)* %0, i32 %1, i32 %2, float %3, float %4, float %5, float %6, i32 %7, float %8, float %9) {
%11 = tail call i32 @_s2priv_funab(float (float*, float*)* %0, i32 %1, i32 %2, float %3, float %4, float %5, float %6, i32 1, i32 2, i32 %7, float %8, float %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xc7() {
  Assert_real((isspace(199) == 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_isspace.c",
              1000, ("isspace should be 0 for 0xc7"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xc7>:
push   %rax
mov    $0xc7,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3e8,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xc7\00"
define void @t_isspace_0xc7() {
%1 = call i64 @isspace(i32 199)
%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 1000, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xc7\00"
define void @t_isspace_0xc7() {
%1 = tail call i64 @isspace(i32 199)
%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 1000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double clip(double x, double min, double max) {
  if (x < min) {
    return min;
  }
  if (x > max) {
    return max;
  }
  return x;
}


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <clip+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clip+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <clip+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clip+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @clip(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @clip(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)11483;
    local1 = 0UL;
    while (local1 < (unsigned short)0) {
      local1++;
    }
    output[0UL] = (state[0UL] + 255873917UL) << (unsigned short)1;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0x2cdb,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    1140 <RandomFunc+0x40>
mov    -0x14(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x14(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
add    $0xf40537d,%rax
shl    $0x1,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    %eax,%eax
add    $0xb0,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = add nsw i32 %10, 11483
%12 = trunc i32 %11 to i16
%13 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %12, i16* %13
store i16 0, i16* %6
br label %14
14: ; preds = %18, %2
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i16, i16* %6
%20 = add i16 %19, 1
store i16 %20, i16* %6
br label %14
21: ; preds = %14
%22 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%23 = load i16, i16* %22
%24 = zext i16 %23 to i64
%25 = add i64 %24, 255873917
%26 = shl i64 %25, 1
%27 = trunc i64 %26 to i16
%28 = load i16*, i16** %4
%29 = getelementptr inbounds i16, i16* %28, i64 0
store i16 %27, i16* %29
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = shl i16 %3, 1
%5 = add i16 %4, 176
store i16 %5, i16* %1
ret void
}
/* Variables and functions */
double exp(long double);
long double coshl(long double x) { return (exp(x) + exp(-x)) * 0.5; }


x86 assembly (clang, -O0):
<coshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
fldt   -0x10(%rbp)
fchs
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xead(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coshl>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  (%rsp)
call   1030 <exp@plt>
movsd  %xmm0,0x18(%rsp)
fldt   0x2c(%rsp)
fchs
fstpt  (%rsp)
call   1030 <exp@plt>
addsd  0x18(%rsp),%xmm0
mulsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
fldl   0x20(%rsp)
add    $0x38,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @coshl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call double @exp(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = fneg x86_fp80 %5
%7 = call double @exp(x86_fp80 %6)
%8 = fadd double %4, %7
%9 = fmul double %8, 5.000000e-01
%10 = fpext double %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @coshl(x86_fp80 %0) {
%2 = tail call double @exp(x86_fp80 %0)
%3 = fneg x86_fp80 %0
%4 = tail call double @exp(x86_fp80 %3)
%5 = fadd double %2, %4
%6 = fmul double %5, 5.000000e-01
%7 = fpext double %6 to x86_fp80
ret x86_fp80 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getushort(int /*<<< orphan*/ *);
double get2dot14(FILE *ttf) {
  int val = getushort(ttf);
  int mant = val & 0x3fff;
  return ((double)((val << 16) >> (16 + 14)) + (mant / 16384.0));
}


x86 assembly (clang, -O0):
<get2dot14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getushort@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3fff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
sar    $0x1e,%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get2dot14>:
push   %rax
call   1030 <getushort@plt>
movswl %ax,%ecx
and    $0x3fff,%eax
sar    $0xe,%ecx
cvtsi2sd %ecx,%xmm1
cvtsi2sd %eax,%xmm0
mulsd  0xecf(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @get2dot14(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @getushort(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 16383
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 16
%11 = ashr i32 %10, 30
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %4
%14 = sitofp i32 %13 to double
%15 = fdiv double %14, 1.638400e+04
%16 = fadd double %12, %15
ret double %16
}

LLVM IR (-O2):
define double @get2dot14(i32* %0) {
%2 = tail call i32 @getushort(i32* %0)
%3 = and i32 %2, 16383
%4 = shl i32 %2, 16
%5 = ashr i32 %4, 30
%6 = sitofp i32 %5 to double
%7 = sitofp i32 %3 to double
%8 = fmul double %7, 0x3F10000000000000
%9 = fadd double %8, %6
ret double %9
}