xunge/DecIR huggingface dataset:
unsigned int HSMMCSDIsIntClockStable(unsigned int baseAddr,
                                     unsigned int retry) {
  volatile unsigned int status = 0;
  do {
    status =
        ((*((volatile unsigned int *)(baseAddr + (0x22C)))) & (0x00000002u)) >>
        (0x00000001u);
    if ((status == 1) || (retry == 0)) {
      break;
    }
  } while (retry--);
  return status;
}


x86 assembly (clang, -O0):
<HSMMCSDIsIntClockStable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x22c,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x2,%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x1,%eax
je     113c <HSMMCSDIsIntClockStable+0x3c>
cmpl   $0x0,-0x8(%rbp)
jne    1141 <HSMMCSDIsIntClockStable+0x41>
jmp    115a <HSMMCSDIsIntClockStable+0x5a>
jmp    1146 <HSMMCSDIsIntClockStable+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jne    1111 <HSMMCSDIsIntClockStable+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSMMCSDIsIntClockStable>:
movl   $0x0,-0x4(%rsp)
add    $0x22c,%edi
xchg   %ax,%ax
mov    (%rdi),%eax
shr    %eax
and    $0x1,%eax
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%ecx
sub    $0x1,%esi
setb   %al
cmp    $0x1,%ecx
je     112e <HSMMCSDIsIntClockStable+0x2e>
test   %al,%al
je     1110 <HSMMCSDIsIntClockStable+0x10>
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @HSMMCSDIsIntClockStable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store volatile i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %3
%8 = add i32 %7, 556
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 2
%13 = lshr i32 %12, 1
store volatile i32 %13, i32* %5
%14 = load volatile i32, i32* %5
%15 = icmp eq i32 %14, 1
br i1 %15, label %19, label %16
16: ; preds = %6
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16, %6
br label %25
20: ; preds = %16
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add i32 %22, -1
store i32 %23, i32* %4
%24 = icmp ne i32 %22, 0
br i1 %24, label %6, label %25
25: ; preds = %21, %19
%26 = load volatile i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @HSMMCSDIsIntClockStable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = add i32 %0, 556
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
br label %8
8: ; preds = %8, %2
%9 = phi i32 [ %1, %2 ], [ %17, %8 ]
%10 = load volatile i32, i32* %7
%11 = lshr i32 %10, 1
%12 = and i32 %11, 1
store volatile i32 %12, i32* %3
%13 = load volatile i32, i32* %3
%14 = icmp eq i32 %13, 1
%15 = icmp eq i32 %9, 0
%16 = select i1 %14, i1 true, i1 %15
%17 = add i32 %9, -1
br i1 %16, label %18, label %8
18: ; preds = %8
%19 = load volatile i32, i32* %3
ret i32 %19
}
/* Variables and functions */
char *memccpy(char *, char const *, int /*<<< orphan*/, size_t);
char *stpncpy(char *dest, const char *src, size_t n) {
  char *x = memccpy(dest, src, 0, n);
  if (x) {
    return x - 1;
  } else
    return dest + n;
}


x86 assembly (clang, -O0):
<stpncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rcx
xor    %edx,%edx
call   1030 <memccpy@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1157 <stpncpy+0x47>
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <stpncpy+0x53>
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpncpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
xor    %edx,%edx
mov    %r14,%rcx
call   1030 <memccpy@plt>
lea    -0x1(%rax),%rcx
add    %r14,%rbx
test   %rax,%rax
cmovne %rcx,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @stpncpy(i8* %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @memccpy(i8* %0, i8* %1, i32 0, i64 %2)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 -1
%7 = getelementptr inbounds i8, i8* %0, i64 %2
%8 = select i1 %5, i8* %7, i8* %6
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int HAL_core_subsystem_version(char *patchstr, int bufLen) {
  strcpy(patchstr, "1.00");
  return 5;
}


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

x86 assembly (clang, -O2):
<HAL_core_subsystem_version>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcpy@plt>
mov    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"1.00\00"
define i32 @HAL_core_subsystem_version(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 @strcpy(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 5
}

LLVM IR (-O2):
@.str = [5 x i8] c"1.00\00"
define i32 @HAL_core_subsystem_version(i8* %0, i32 %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 5
}
/* Variables and functions */
void _Locale_final() {}


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

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

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

LLVM IR (-O2):
define void @_Locale_final() {
ret void
}
int remark(s)
char *s;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @remark(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printf_help() { printf("usage:myls pathname [-option]\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"usage:myls pathname [-option]\0A\00"
define void @printf_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"usage:myls pathname [-option]\00"
define void @printf_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
int sum(int n1, int n2) { return n1 + n2; }


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

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

LLVM IR (-O0):
define i32 @sum(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 i32 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ err_msg(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int listen(int, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int Listen(int sockfd) {
  int ret;
  if ((ret = listen(sockfd, 5)) == -1) {
    err_msg("error listening socket: %s", strerror(errno));
    exit(EXIT_FAILURE);
  }
  return ret;
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x5,%esi
call   1030 <listen@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    118e <Listen+0x4e>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1040 <err_msg@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
mov    $0x5,%esi
call   1030 <listen@plt>
cmp    $0xffffffff,%eax
je     1152 <Listen+0x12>
pop    %rcx
ret
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
call   1040 <err_msg@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"error listening socket: %s\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @Listen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @listen(i32 %4, i32 5)
store i32 %5, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @err_msg(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [27 x i8] c"error listening socket: %s\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @Listen(i32 %0) {
%2 = tail call i32 @listen(i32 %0, i32 5)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @err_msg(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret i32 %2
}
__attribute__((always_)) int put(char p1) {
  int ret;
  asm volatile("int $0x80" : "=a"(ret) : "0"(0), "c"(p1));
  return ret;
}


x86 assembly (clang, -O0):
<put>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
xor    %eax,%eax
int    $0x80
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<put>:
mov    %edi,%ecx
xor    %eax,%eax
int    $0x80
ret

LLVM IR (-O0):
define i32 @put(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 asm sideeffect "int $$0x80", "={ax},0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 0, i8 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @put(i8 signext %0) {
%2 = tail call i32 asm sideeffect "int $$0x80", "={ax},0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 0, i8 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ outofmemory();
scalar_t__ realloc(void *, size_t);
void *MyRealloc(void *oldptr, size_t newsize) {
  void *ptr;
  ptr = (void *)realloc(oldptr, newsize);
  if (!ptr)
    outofmemory();
  return (ptr);
}


x86 assembly (clang, -O0):
<MyRealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <MyRealloc+0x33>
mov    $0x0,%al
call   1030 <outofmemory@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyRealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <MyRealloc+0x15>
xor    %eax,%eax
call   1030 <outofmemory@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @MyRealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i64 @realloc(i8* %6, i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 (...) @outofmemory()
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @MyRealloc(i8* %0, i64 %1) {
%3 = tail call i64 @realloc(i8* %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @outofmemory()
br label %7
7: ; preds = %5, %2
%8 = inttoptr i64 %3 to i8*
ret i8* %8
}
/* Variables and functions */
int min_ii(int, int);
int min_iii(int a, int b, int c) { return min_ii(min_ii(a, b), c); }


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

x86 assembly (clang, -O2):
<min_iii>:
push   %rbx
mov    %edx,%ebx
call   1030 <min_ii@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <min_ii@plt>

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

LLVM IR (-O2):
define i32 @min_iii(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @min_ii(i32 %0, i32 %1)
%5 = tail call i32 @min_ii(i32 %4, i32 %2)
ret i32 %5
}
void loop_stabilize(void) {}


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

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

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

LLVM IR (-O2):
define void @loop_stabilize() {
ret void
}
void rdr2i_(dx, dy) int *dx, *dy;
{ rdr2((float)*dx, (float)*dy); }


x86 assembly (clang, -O0):
<rdr2i_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <rdr2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdr2i_>:
cvtsi2ssl (%rdi),%xmm0
cvtsi2ssl (%rsi),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
jmp    1030 <rdr2@plt>

LLVM IR (-O0):
define void @rdr2i_(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* %5
%7 = sitofp i32 %6 to float
%8 = fpext float %7 to double
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to float
%12 = fpext float %11 to double
%13 = call i32 (double, double, ...) bitcast (i32 (...)* @rdr2 to i32 (double, double, ...)*)(double %8, double %12)
ret void
}

LLVM IR (-O2):
define void @rdr2i_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = sitofp i32 %3 to float
%5 = fpext float %4 to double
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = fpext float %7 to double
%9 = tail call i32 (double, double, ...) bitcast (i32 (...)* @rdr2 to i32 (double, double, ...)*)(double %5, double %8)
ret void
}
/* Type definitions */
struct sl_pp_token_info {
  int dummy;
};
struct sl_pp_context {
  int dummy;
};

/* Variables and functions */
int _parse_else(struct sl_pp_context *);
int sl_pp_process_else(struct sl_pp_context *context,
                       const struct sl_pp_token_info *input, unsigned int first,
                       unsigned int last) {
  return _parse_else(context);
}


x86 assembly (clang, -O0):
<sl_pp_process_else>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_parse_else@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl_pp_process_else>:
jmp    1030 <_parse_else@plt>

LLVM IR (-O0):
%struct.sl_pp_context = type { i32 }
%struct.sl_pp_token_info = type { i32 }
define i32 @sl_pp_process_else(%struct.sl_pp_context* %0, %struct.sl_pp_token_info* %1, i32 %2, i32 %3) {
%5 = alloca %struct.sl_pp_context*
%6 = alloca %struct.sl_pp_token_info*
%7 = alloca i32
%8 = alloca i32
store %struct.sl_pp_context* %0, %struct.sl_pp_context** %5
store %struct.sl_pp_token_info* %1, %struct.sl_pp_token_info** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.sl_pp_context*, %struct.sl_pp_context** %5
%10 = call i32 @_parse_else(%struct.sl_pp_context* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sl_pp_context = type { i32 }
%struct.sl_pp_token_info = type { i32 }
define i32 @sl_pp_process_else(%struct.sl_pp_context* %0, %struct.sl_pp_token_info* nocapture readnone %1, i32 %2, i32 %3) {
%5 = tail call i32 @_parse_else(%struct.sl_pp_context* %0)
ret i32 %5
}
__attribute__((sysv_abi)) const char *bar(const char *s) { return s; }


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

x86 assembly (clang, -O2):
<bar>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @bar(i8* readnone returned %0) {
ret i8* %0
}
void RTHandleTableLookupWithCtx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHandleTableLookupWithCtx() {
ret void
}
void cold(void) { return; }


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

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

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

LLVM IR (-O2):
define void @cold() {
ret void
}
/* Variables and functions */
int test(int);
int main(void) {
  int flag;
  test(test(test(test(test(1) | (1 << 2)) ^ (1 << 2)) ^ 1 | (1 << 3)) ^
           (1 << 3) |
       (1 << 1));
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <test@plt>
or     $0x4,%eax
mov    %eax,%edi
call   1030 <test@plt>
xor    $0x4,%eax
mov    %eax,%edi
call   1030 <test@plt>
or     $0x8,%eax
xor    $0x1,%eax
mov    %eax,%edi
call   1030 <test@plt>
or     $0x2,%eax
xor    $0x8,%eax
mov    %eax,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @test(i32 1)
%4 = or i32 %3, 4
%5 = call i32 @test(i32 %4)
%6 = xor i32 %5, 4
%7 = call i32 @test(i32 %6)
%8 = xor i32 %7, 1
%9 = or i32 %8, 8
%10 = call i32 @test(i32 %9)
%11 = xor i32 %10, 8
%12 = or i32 %11, 2
%13 = call i32 @test(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 1)
%2 = or i32 %1, 4
%3 = tail call i32 @test(i32 %2)
%4 = xor i32 %3, 4
%5 = tail call i32 @test(i32 %4)
%6 = or i32 %5, 8
%7 = xor i32 %6, 1
%8 = tail call i32 @test(i32 %7)
%9 = or i32 %8, 2
%10 = xor i32 %9, 8
%11 = tail call i32 @test(i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ swap_le64(long long *, long long *);
void swap_le64_num(long long *s, long long *d, int n) {
  int i;
  for (i = 0; i < n; i++, s++, d++)
    swap_le64(s, d);
}


x86 assembly (clang, -O0):
<swap_le64_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1169 <swap_le64_num+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <swap_le64@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112a <swap_le64_num+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_le64_num>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1149 <swap_le64_num+0x39>
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <swap_le64@plt>
add    $0x8,%rbp
add    $0x8,%rbx
add    $0xffffffff,%r14d
jne    1130 <swap_le64_num+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @swap_le64_num(i64* %0, i64* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ 0, %3 ]
%7 = phi i64* [ %11, %5 ], [ %0, %3 ]
%8 = phi i64* [ %12, %5 ], [ %1, %3 ]
%9 = tail call i32 @swap_le64(i64* %7, i64* %8)
%10 = add nuw nsw i32 %6, 1
%11 = getelementptr inbounds i64, i64* %7, i64 1
%12 = getelementptr inbounds i64, i64* %8, i64 1
%13 = icmp eq i32 %10, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret void
}
void null_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @null_exit() {
ret void
}
int test_imm_26uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x26 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_26uint64_midword_reg>:
test   $0x260000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_26uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 2490368
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct mgsl_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ usc_DmaCmd(struct mgsl_struct *, unsigned short);
int /*<<< orphan*/ usc_RTCmd(struct mgsl_struct *, unsigned short);
int /*<<< orphan*/ usc_loopmode_send_done(struct mgsl_struct *);
void usc_loopmode_cancel_transmit(struct mgsl_struct *info) {
  {
    usc_RTCmd(info, (unsigned short)20480);
    usc_DmaCmd(info, (unsigned short)4096);
    usc_loopmode_send_done(info);
    return;
  }
}


x86 assembly (clang, -O0):
<usc_loopmode_cancel_transmit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5000,%esi
call   1030 <usc_RTCmd@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1000,%esi
call   1050 <usc_DmaCmd@plt>
mov    -0x8(%rbp),%rdi
call   1040 <usc_loopmode_send_done@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usc_loopmode_cancel_transmit>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5000,%esi
call   1030 <usc_RTCmd@plt>
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1050 <usc_DmaCmd@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <usc_loopmode_send_done@plt>

LLVM IR (-O0):
%struct.mgsl_struct = type { i32 }
define void @usc_loopmode_cancel_transmit(%struct.mgsl_struct* %0) {
%2 = alloca %struct.mgsl_struct*
store %struct.mgsl_struct* %0, %struct.mgsl_struct** %2
%3 = load %struct.mgsl_struct*, %struct.mgsl_struct** %2
%4 = call i32 @usc_RTCmd(%struct.mgsl_struct* %3, i16 zeroext 20480)
%5 = load %struct.mgsl_struct*, %struct.mgsl_struct** %2
%6 = call i32 @usc_DmaCmd(%struct.mgsl_struct* %5, i16 zeroext 4096)
%7 = load %struct.mgsl_struct*, %struct.mgsl_struct** %2
%8 = call i32 @usc_loopmode_send_done(%struct.mgsl_struct* %7)
ret void
}

LLVM IR (-O2):
%struct.mgsl_struct = type { i32 }
define void @usc_loopmode_cancel_transmit(%struct.mgsl_struct* %0) {
%2 = tail call i32 @usc_RTCmd(%struct.mgsl_struct* %0, i16 zeroext 20480)
%3 = tail call i32 @usc_DmaCmd(%struct.mgsl_struct* %0, i16 zeroext 4096)
%4 = tail call i32 @usc_loopmode_send_done(%struct.mgsl_struct* %0)
ret void
}
char *GbkToUtf8ForWindows(void *VM_ARG, char *gbkstr) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @GbkToUtf8ForWindows(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
int readjpeg(const char *name, int *xres, int *yres, unsigned char **imgdata) {
  return 2;
}


x86 assembly (clang, -O0):
<readjpeg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @readjpeg(i8* %0, i32* %1, i32* %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8**
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8** %3, i8*** %8
ret i32 2
}

LLVM IR (-O2):
define i32 @readjpeg(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i8** nocapture readnone %3) {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ find_nth_time(int /*<<< orphan*/ *, int, int);
time_t median_time(time_t *array, int n_elements) {
  return find_nth_time(array, n_elements, (n_elements - 1) / 2);
}


x86 assembly (clang, -O0):
<median_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <find_nth_time@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_time>:
lea    -0x1(%rsi),%eax
shr    $0x1f,%eax
lea    (%rsi,%rax,1),%edx
add    $0xffffffff,%edx
sar    %edx
jmp    1030 <find_nth_time@plt>

LLVM IR (-O0):
define i32 @median_time(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 2
%10 = call i32 @find_nth_time(i32* %5, i32 %6, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @median_time(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = tail call i32 @find_nth_time(i32* %0, i32 %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
char *strrchr(char const *, char);
char const *file_basename(char const *path) {
  char const *p = strrchr(path, '/');
  if (p)
    return p + 1;
  else
    return path;
}


x86 assembly (clang, -O0):
<file_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <file_basename+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <file_basename+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @file_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
signed long signedlong_ignoring_unsignedshort(signed long x, unsigned short y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlong_ignoring_unsignedshort>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlong_ignoring_unsignedshort(i64 %0, i16 zeroext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlong_ignoring_unsignedshort(i64 returned %0, i16 zeroext %1) {
ret i64 %0
}
/* Variables and functions */
scalar_t__ malloc(int);
void test(char *s) { s = (char *)malloc(100); }


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

x86 assembly (clang, -O2):
<test>:
mov    $0x64,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @malloc(i32 100)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
ret void
}

LLVM IR (-O2):
define void @test(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 100)
ret void
}
int declare_fun_2(int x, int y) { return x + y; }


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

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

LLVM IR (-O0):
define i32 @declare_fun_2(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 i32 @declare_fun_2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int remove(char *);
int delete_file(char *file_name) {
  int ret;
  ret = remove(file_name);
  if (ret == 0) {
    printf("File deleted successfully");
  } else {
    printf("Error: unable to delete the file");
  }
  return ret;
}


x86 assembly (clang, -O0):
<delete_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1153 <delete_file+0x33>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
jmp    115f <delete_file+0x3f>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_file>:
push   %rbx
call   1030 <remove@plt>
mov    %eax,%ebx
test   %eax,%eax
lea    0xecf(%rip),%rax
lea    0xee2(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"File deleted successfully\00"
@.str.1 = [33 x i8] c"Error: unable to delete the file\00"
define i32 @delete_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @remove(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [26 x i8] c"File deleted successfully\00"
@.str.1 = [33 x i8] c"Error: unable to delete the file\00"
define i32 @delete_file(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _IO(char, int);
int ioctl(int, int /*<<< orphan*/);
int beaglelogic_stop(int fd) { return ioctl(fd, _IO('k', 0x2A)); }


x86 assembly (clang, -O0):
<beaglelogic_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x6b,%edi
mov    $0x2a,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beaglelogic_stop>:
push   %rbx
mov    %edi,%ebx
mov    $0x6b,%edi
mov    $0x2a,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @beaglelogic_stop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 signext 107, i32 42)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @beaglelogic_stop(i32 %0) {
%2 = tail call i32 @_IO(i8 signext 107, i32 42)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xe7() {
  Assert_real((isxdigit(231) == 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_isxdigit.c",
              1160, ("isxdigit should be 0 for 0xe7"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe7\00"
define void @t_isxdigit_0xe7() {
%1 = tail call i64 @isxdigit(i32 231)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x4c() {
  Assert_real((ispunct(76) == 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_ispunct.c",
              385, ("ispunct should be 0 for L"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x4c>:
push   %rax
mov    $0x4c,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x181,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for L\00"
define void @t_ispunct_0x4c() {
%1 = call i64 @ispunct(i32 76)
%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 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for L\00"
define void @t_ispunct_0x4c() {
%1 = tail call i64 @ispunct(i32 76)
%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 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f442(int *);
int f443(int *p) { return f442(p); }


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

x86 assembly (clang, -O2):
<f443>:
jmp    1030 <f442@plt>

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

LLVM IR (-O2):
define i32 @f443(i32* %0) {
%2 = tail call i32 @f442(i32* %0)
ret i32 %2
}
/* Variables and functions */
size_t pmalloc_size(void *ptr) {
  void *realptr = (char *)ptr - (sizeof(size_t));
  size_t size = *((size_t *)realptr);
  if (size & (sizeof(long) - 1))
    size += sizeof(long) - (size & (sizeof(long) - 1));
  return size + (sizeof(size_t));
}


x86 assembly (clang, -O0):
<pmalloc_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x7,%rax
cmp    $0x0,%rax
je     1149 <pmalloc_size+0x49>
mov    -0x18(%rbp),%rcx
and    $0x7,%rcx
mov    $0x8,%eax
sub    %rcx,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmalloc_size>:
mov    -0x8(%rdi),%rax
mov    %eax,%ecx
and    $0x7,%ecx
mov    $0x8,%edx
sub    %rcx,%rdx
test   %rcx,%rcx
cmove  %rcx,%rdx
add    %rdx,%rax
add    $0x8,%rax
ret

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

LLVM IR (-O2):
define i64 @pmalloc_size(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
%5 = and i64 %4, 7
%6 = icmp eq i64 %5, 0
%7 = sub nuw nsw i64 8, %5
%8 = select i1 %6, i64 0, i64 %7
%9 = add i64 %4, 8
%10 = add i64 %9, %8
ret i64 %10
}
/* Variables and functions */
scalar_t__ arglen(char *, char *, int, int);
int argcount(char *src, char *sep, int opt) {
  int count = 0;
  while (arglen(src, sep, count, opt) >= 0)
    count++;
  return (count);
}


x86 assembly (clang, -O0):
<argcount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <arglen@plt>
cmp    $0x0,%rax
jl     1155 <argcount+0x45>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <argcount+0x1a>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argcount>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
mov    $0xffffffff,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <arglen@plt>
test   %rax,%rax
jns    1130 <argcount+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @argcount(i8* %0, i8* %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ 0, %3 ], [ %8, %4 ]
%6 = tail call i64 @arglen(i8* %0, i8* %1, i32 %5, i32 %2)
%7 = icmp sgt i64 %6, -1
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %4, label %9
9: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int a = 1, b = -3;
  f(a, &b);
  printf("a=%d b=%d\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0xfffffffd,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <f@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xfffffffd,0x4(%rsp)
ff
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
call   1030 <f@plt>
mov    0x4(%rsp),%edx
lea    0xebd(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"a=%d b=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -3, i32* %1
%3 = call i32 @f(i32 1, i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  int w = ~(int)0;
  if (w != 0x7fffffff)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x7fffffff,-0x8(%rbp)
je     113a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 2147483647
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int do_rmmod(int, char **);
int main(int argc, char *argv[]) { return do_rmmod(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <do_rmmod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <do_rmmod@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @do_rmmod(i32 %0, i8** %1)
ret i32 %3
}