xunge/DecIR huggingface dataset:
int local(char *alfabeto, char letra) {
  int i = 0;
  for (i = 0; i < 62; i++) {
    if (alfabeto[i] == letra)
      return i;
  }
}


x86 assembly (clang, -O0):
<local>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3e,-0x18(%rbp)
jge    115c <local+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <local+0x49>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <local+0x5c>
jmp    114e <local+0x4e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <local+0x1c>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<local>:
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %sil,-0x1(%rdi,%rax,1)
je     112d <local+0x2d>
cmp    %sil,(%rdi,%rax,1)
je     1131 <local+0x31>
add    $0x2,%rax
cmp    $0x3f,%rax
jne    1110 <local+0x10>
mov    $0x3e,%eax
ret
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i32 @local(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %13, %2
%4 = phi i64 [ 0, %2 ], [ %14, %13 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
br i1 %7, label %16, label %8
8: ; preds = %3
%9 = or i64 %4, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %1
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = add nuw nsw i64 %4, 2
%15 = icmp eq i64 %14, 62
br i1 %15, label %19, label %3
16: ; preds = %8, %3
%17 = phi i64 [ %4, %3 ], [ %9, %8 ]
%18 = trunc i64 %17 to i32
br label %19
19: ; preds = %13, %16
%20 = phi i32 [ %18, %16 ], [ 62, %13 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ RFM22BStatusHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void RFM22BStatusUpdated() { UAVObjUpdated(RFM22BStatusHandle()); }


x86 assembly (clang, -O0):
<RFM22BStatusUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RFM22BStatusHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RFM22BStatusUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <RFM22BStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @RFM22BStatusUpdated() {
%1 = call i32 (...) @RFM22BStatusHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RFM22BStatusUpdated() {
%1 = tail call i32 (...) @RFM22BStatusHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t CondSwapFromBus64(uint64_t d) { return d; }


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

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

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

LLVM IR (-O2):
define i32 @CondSwapFromBus64(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ NID_commonName;
int set_cn(int /*<<< orphan*/ *, int /*<<< orphan*/, char *, int /*<<< orphan*/,
           char const *, int /*<<< orphan*/);
int set_cn2(X509 *crt, const char *name) {
  return set_cn(crt, NID_commonName, "dummy value", NID_commonName, name, 0);
}


x86 assembly (clang, -O0):
<set_cn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%r8
lea    0xebf(%rip),%rdx
xor    %r9d,%r9d
call   1030 <set_cn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cn2>:
mov    %rsi,%r8
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
lea    0xedd(%rip),%rdx
mov    %ecx,%esi
xor    %r9d,%r9d
jmp    1030 <set_cn@plt>

LLVM IR (-O0):
@NID_commonName = global i32 0
@.str = [12 x i8] c"dummy value\00"
define i32 @set_cn2(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @NID_commonName
%7 = load i32, i32* @NID_commonName
%8 = load i8*, i8** %4
%9 = call i32 @set_cn(i32* %5, i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i32 0)
ret i32 %9
}

LLVM IR (-O2):
@NID_commonName = global i32 0
@.str = [12 x i8] c"dummy value\00"
define i32 @set_cn2(i32* %0, i8* %1) {
%3 = load i32, i32* @NID_commonName
%4 = tail call i32 @set_cn(i32* %0, i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %1, i32 0)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
time_t calculateTimeLimit(int nMaxMS) {
  if (0 == nMaxMS) {
    return time(NULL) + 1;
  } else if (0 < nMaxMS) {
    return time(NULL) + ((nMaxMS + 1999u) / 1000u);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<calculateTimeLimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jne    113c <calculateTimeLimit+0x2c>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1181 <calculateTimeLimit+0x71>
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jge    1179 <calculateTimeLimit+0x69>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x7cf,%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1181 <calculateTimeLimit+0x71>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateTimeLimit>:
push   %rbx
test   %edi,%edi
je     1139 <calculateTimeLimit+0x29>
jle    1146 <calculateTimeLimit+0x36>
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <time@plt>
mov    %rax,%rcx
add    $0x7cf,%ebx
imul   $0x10624dd3,%rbx,%rax
shr    $0x26,%rax
add    %rcx,%rax
pop    %rbx
ret
xor    %edi,%edi
call   1030 <time@plt>
add    $0x1,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @calculateTimeLimit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i64 @time(i32* null)
%5 = add nsw i64 %4, 1
br label %14
6: ; preds = %1
%7 = icmp sgt i32 %0, 0
br i1 %7, label %8, label %14
8: ; preds = %6
%9 = tail call i64 @time(i32* null)
%10 = add nuw i32 %0, 1999
%11 = udiv i32 %10, 1000
%12 = zext i32 %11 to i64
%13 = add nsw i64 %9, %12
br label %14
14: ; preds = %6, %8, %3
%15 = phi i64 [ %5, %3 ], [ %13, %8 ], [ 0, %6 ]
ret i64 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
int /*<<< orphan*/ __wcstol_internal(int /*<<< orphan*/ const *,
                                     int /*<<< orphan*/ **, int,
                                     int /*<<< orphan*/);
intmax_t wcstoimax(const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
                   int base) {
  return __wcstol_internal(nptr, endptr, base, 0);
}


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

x86 assembly (clang, -O2):
<wcstoimax>:
xor    %ecx,%ecx
jmp    1030 <__wcstol_internal@plt>

LLVM IR (-O0):
define i32 @wcstoimax(i32* noalias %0, i32** noalias %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 = load i32, i32* %6
%10 = call i32 @__wcstol_internal(i32* %7, i32** %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @wcstoimax(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = tail call i32 @__wcstol_internal(i32* %0, i32** %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
unsigned short bswap_16(unsigned short);
unsigned short nvram_swap_short(unsigned short length) {
  return bswap_16(length);
}


x86 assembly (clang, -O0):
<nvram_swap_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <bswap_16@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_swap_short>:
jmp    1030 <bswap_16@plt>

LLVM IR (-O0):
define zeroext i16 @nvram_swap_short(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @bswap_16(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @nvram_swap_short(i16 zeroext %0) {
%2 = tail call zeroext i16 @bswap_16(i16 zeroext %0)
ret i16 %2
}
/* Variables and functions */
int vm_main();
int main() { return vm_main(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @vm_main()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @vm_main()
ret i32 %1
}
_sgn(v) double v;
{
  if (v > 0)
    return (1);
  if (v < 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<_sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1127 <_sgn+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1148 <_sgn+0x48>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1141 <_sgn+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <_sgn+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sgn>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_sgn(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 -1, i32* %2
br label %12
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @_sgn(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *checked_realloc(void *buf, size_t size) {
  buf = realloc(buf, size);
  if (!buf) {
    fprintf(stderr, "Out of memory\n");
    exit(1);
  }
  return buf;
}


x86 assembly (clang, -O0):
<checked_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117b <checked_realloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_realloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <checked_realloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @checked_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define noalias i8* @checked_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
int strtol(char const *, char **, int);
uint8_t parse_pci_id8(const char **rem, const char *str) {
  uint64_t id;
  char *end;
  id = strtol(str, &end, 16);
  if (id > 255)
    end = NULL;
  if (rem)
    *rem = end;
  return id;
}


x86 assembly (clang, -O0):
<parse_pci_id8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xff,-0x14(%rbp)
jle    114a <parse_pci_id8+0x3a>
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <parse_pci_id8+0x50>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_pci_id8>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
mov    $0x10,%edx
call   1030 <strtol@plt>
cmp    $0x100,%eax
jl     113d <parse_pci_id8+0x2d>
movq   $0x0,0x8(%rsp)
test   %rbx,%rbx
je     114a <parse_pci_id8+0x3a>
mov    0x8(%rsp),%rcx
mov    %rcx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @parse_pci_id8(i8** writeonly %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtol(i8* %1, i8** %3, i32 16)
%6 = icmp sgt i32 %5, 255
br i1 %6, label %7, label %8
7: ; preds = %2
store i8* null, i8** %3
br label %8
8: ; preds = %7, %2
%9 = icmp eq i8** %0, null
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = load i8*, i8** %3
store i8* %11, i8** %0
br label %12
12: ; preds = %10, %8
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int zhash_int_equals(const void *_a, const void *_b) {
  assert(_a != NULL);
  assert(_b != NULL);
  int a = *((int *)_a);
  int b = *((int *)_b);
  return a == b;
}


x86 assembly (clang, -O0):
<zhash_int_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zhash_int_equals>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%ecx
xor    %eax,%eax
cmp    (%r14),%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @zhash_int_equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %3
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
store i32 %17, i32* %5
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
store i32 %20, i32* %6
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = icmp eq i32 %21, %22
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @zhash_int_equals(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = bitcast i8* %0 to i32*
%10 = load i32, i32* %9
%11 = bitcast i8* %1 to i32*
%12 = load i32, i32* %11
%13 = icmp eq i32 %10, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int /*<<< orphan*/ toupper(int);
int main() {
  int ch;
  while ((ch = getchar()) != EOF) {
    putchar(toupper(ch));
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%eax
je     117c <main+0x3c>
mov    -0x8(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    114f <main+0xf>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e99(%rip),%rbx
cmp    (%rbx),%eax
je     1179 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1160 <main+0x20>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @toupper(i32 %8)
%10 = call i32 @putchar(i32 %9)
br label %3
11: ; preds = %3
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @toupper(i32 %5)
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
%12 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long long CLOCKS_PER_SEC;
double back_clock_secs(long long delta) { return delta / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<back_clock_secs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ed5(%rip),%rcx
cqto
idivq  (%rcx)
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_clock_secs>:
mov    %rdi,%rax
mov    0x2ede(%rip),%rcx
mov    (%rcx),%rcx
mov    %rdi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1124 <back_clock_secs+0x24>
cqto
idiv   %rcx
cvtsi2sd %rax,%xmm0
ret
xor    %edx,%edx
div    %ecx
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define double @back_clock_secs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @CLOCKS_PER_SEC
%5 = sdiv i64 %3, %4
%6 = sitofp i64 %5 to double
ret double %6
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define double @back_clock_secs(i64 %0) {
%2 = load i64, i64* @CLOCKS_PER_SEC
%3 = sdiv i64 %0, %2
%4 = sitofp i64 %3 to double
ret double %4
}
int main(void) {
  void (*foo)(void) = getfunc("Hello World!");
  foo();
  return bar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <getfunc@plt>
cltq
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <getfunc@plt>
cltq
call   *%rax
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca void ()*
store i32 0, i32* %1
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @getfunc to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to void ()*
store void ()* %5, void ()** %2
%6 = load void ()*, void ()** %2
%7 = call i32 (...) @bar()
ret i32 %7
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getfunc to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to void ()*
tail call void %3()
%4 = tail call i32 (...) @bar()
ret i32 %4
}
/* Type definitions */
struct CONSOLE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cons_putchar(struct CONSOLE *, char, int);
void cons_putstr1(struct CONSOLE *cons, char *s, int l) {
  int i;
  for (i = 0; i < l; i++) {
    cons_putchar(cons, s[i], 1);
  }
  return;
}


x86 assembly (clang, -O0):
<cons_putstr1>:
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    115e <cons_putstr1+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    $0x1,%edx
movsbl (%rax,%rcx,1),%esi
call   1030 <cons_putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <cons_putstr1+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cons_putstr1>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    114b <cons_putstr1+0x3b>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
mov    $0x1,%edx
call   1030 <cons_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <cons_putstr1+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.CONSOLE = type { i32 }
define void @cons_putstr1(%struct.CONSOLE* %0, i8* %1, i32 %2) {
%4 = alloca %struct.CONSOLE*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.CONSOLE* %0, %struct.CONSOLE** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %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 %struct.CONSOLE*, %struct.CONSOLE** %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @cons_putchar(%struct.CONSOLE* %13, i8 signext %18, i32 1)
br label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
%struct.CONSOLE = type { i32 }
define void @cons_putstr1(%struct.CONSOLE* %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @cons_putchar(%struct.CONSOLE* %0, i8 signext %10, i32 1)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
int last_empty(char **grid, int nrows, int x) {
  return (grid[nrows - 1][x] == ' ');
}


x86 assembly (clang, -O0):
<last_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_empty>:
movslq %esi,%rax
mov    -0x8(%rdi,%rax,8),%rcx
movslq %edx,%rdx
xor    %eax,%eax
cmpb   $0x20,(%rcx,%rdx,1)
sete   %al
ret

LLVM IR (-O0):
define i32 @last_empty(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %7, i64 %10
%12 = load i8*, i8** %11
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 32
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @last_empty(i8** nocapture %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 32
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int __tolower_impl(int);
int tolower(int c) { return __tolower_impl(c); }


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

x86 assembly (clang, -O2):
<tolower>:
jmp    1030 <__tolower_impl@plt>

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i32 @__tolower_impl(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_add_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_mod(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void f(mpz_t res, mpz_t r, mpz_t x, mpz_t n) {
  mpz_mul(res, x, r);
  mpz_mod(res, res, n);
  mpz_add_ui(res, res, 1);
  mpz_mod(res, res, n);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <mpz_mul@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <mpz_mod@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1030 <mpz_add_ui@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <mpz_mod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %esi,%eax
mov    %edi,%ebp
mov    %edx,%esi
mov    %eax,%edx
call   1040 <mpz_mul@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1050 <mpz_mod@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    $0x1,%edx
call   1030 <mpz_add_ui@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mpz_mod@plt>

LLVM IR (-O0):
define void @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = call i32 @mpz_mul(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %8
%16 = call i32 @mpz_mod(i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %5
%18 = load i32, i32* %5
%19 = call i32 @mpz_add_ui(i32 %17, i32 %18, i32 1)
%20 = load i32, i32* %5
%21 = load i32, i32* %5
%22 = load i32, i32* %8
%23 = call i32 @mpz_mod(i32 %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @mpz_mul(i32 %0, i32 %2, i32 %1)
%6 = tail call i32 @mpz_mod(i32 %0, i32 %0, i32 %3)
%7 = tail call i32 @mpz_add_ui(i32 %0, i32 %0, i32 1)
%8 = tail call i32 @mpz_mod(i32 %0, i32 %0, i32 %3)
ret void
}
int token_num(int c) {
  switch (c) {
  case '\n':
    return 1;
  case ' ':
    return 2;
  case '-':
    return 3;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<token_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xa,%eax
je     113d <token_num+0x3d>
jmp    111b <token_num+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     1149 <token_num+0x49>
jmp    112c <token_num+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1155 <token_num+0x55>
jmp    1161 <token_num+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1168 <token_num+0x68>
movl   $0x2,-0x4(%rbp)
jmp    1168 <token_num+0x68>
movl   $0x3,-0x4(%rbp)
jmp    1168 <token_num+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_num>:
cmp    $0xa,%edi
je     1115 <token_num+0x15>
cmp    $0x2d,%edi
je     111b <token_num+0x1b>
cmp    $0x20,%edi
jne    1121 <token_num+0x21>
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret
mov    $0x3,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @token_num(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 10, label %5
i32 32, label %6
i32 45, label %7
]
5: ; preds = %1
store i32 1, i32* %2
br label %9
6: ; preds = %1
store i32 2, i32* %2
br label %9
7: ; preds = %1
store i32 3, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @token_num(i32 %0) {
switch i32 %0, label %4 [
i32 10, label %5
i32 32, label %2
i32 45, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i32 [ 0, %4 ], [ 3, %3 ], [ 2, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ extern_func1_14(int, char *, unsigned long);
void extern_func1_13(int a, char *b, unsigned long c) {
  extern_func1_14(a, b, c);
}


x86 assembly (clang, -O0):
<extern_func1_13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <extern_func1_14@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extern_func1_13>:
jmp    1030 <extern_func1_14@plt>

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

LLVM IR (-O2):
define void @extern_func1_13(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @extern_func1_14(i32 %0, i8* %1, i64 %2)
ret void
}
void SysCtlBackupAccessDisable(void) {
  (*((volatile unsigned long *)(0x40007000))) &= ~0x00000100;
}


x86 assembly (clang, -O0):
<SysCtlBackupAccessDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40007000,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffeff,%rcx
mov    $0x40007000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlBackupAccessDisable>:
andq   $0xfffffffffffffeff,0x40007000
40 ff fe ff ff
ret

LLVM IR (-O0):
define void @SysCtlBackupAccessDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1073770496 to i64*)
%2 = and i64 %1, -257
store volatile i64 %2, i64* inttoptr (i64 1073770496 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlBackupAccessDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1073770496 to i64*)
%2 = and i64 %1, -257
store volatile i64 %2, i64* inttoptr (i64 1073770496 to i64*)
ret void
}
char *ft_strcpy(char *dst, const char *src) {
  char *str;
  str = dst;
  while (*src)
    *str++ = *src++;
  *str = 0;
  return (dst);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <ft_strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1114 <ft_strcpy+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <ft_strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <ft_strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ override_redirect;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
int get_XWindowAttributes_override_redirect(void *_p) {
  return (int)((XWindowAttributes *)_p)->override_redirect;
}


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

x86 assembly (clang, -O2):
<get_XWindowAttributes_override_redirect>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowAttributes_override_redirect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XWindowAttributes_override_redirect(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int PROT_READ;
int PROT_WRITE;
void *mmap(int /*<<< orphan*/, int, int, int /*<<< orphan*/, int,
           int /*<<< orphan*/);
void *msvd_map_registers(int fd) {
  return mmap(0, 0x20000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
}


x86 assembly (clang, -O0):
<msvd_map_registers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%edx
mov    0x2ea5(%rip),%rax
or     (%rax),%edx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
mov    -0x4(%rbp),%r8d
xor    %r9d,%r9d
mov    $0x20000,%esi
mov    %r9d,%edi
call   1030 <mmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msvd_map_registers>:
mov    %edi,%r8d
mov    0x2ede(%rip),%rax
mov    0x2eaf(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x20000,%esi
xor    %r9d,%r9d
jmp    1030 <mmap@plt>

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
define i8* @msvd_map_registers(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PROT_READ
%4 = load i32, i32* @PROT_WRITE
%5 = or i32 %3, %4
%6 = load i32, i32* @MAP_SHARED
%7 = load i32, i32* %2
%8 = call i8* @mmap(i32 0, i32 131072, i32 %5, i32 %6, i32 %7, i32 0)
ret i8* %8
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
define i8* @msvd_map_registers(i32 %0) {
%2 = load i32, i32* @PROT_READ
%3 = load i32, i32* @PROT_WRITE
%4 = or i32 %3, %2
%5 = load i32, i32* @MAP_SHARED
%6 = tail call i8* @mmap(i32 0, i32 131072, i32 %4, i32 %5, i32 %0, i32 0)
ret i8* %6
}
void local_begin(void) {}


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

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

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

LLVM IR (-O2):
define void @local_begin() {
ret void
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void send_grap(struct ship *ship, long a) { Write(32, ship, a, 0, 0, 0); }


x86 assembly (clang, -O0):
<send_grap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x20,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_grap>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x20,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_grap(%struct.ship* %0, i64 %1) {
%3 = alloca %struct.ship*
%4 = alloca i64
store %struct.ship* %0, %struct.ship** %3
store i64 %1, i64* %4
%5 = load %struct.ship*, %struct.ship** %3
%6 = load i64, i64* %4
%7 = call i32 @Write(i32 32, %struct.ship* %5, i64 %6, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_grap(%struct.ship* %0, i64 %1) {
%3 = tail call i32 @Write(i32 32, %struct.ship* %0, i64 %1, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t min(uint32_t a, uint32_t b) { return (a > b) ? b : a; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @min(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 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
br label %12
10: ; preds = %2
%11 = load i64, i64* %3
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
void ff_hevc_put_hevc_bi_qpel_v4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v4_8_sse4() {
ret void
}
void printchar(char **str, int c) {
  extern int outbyte(int c);
  if (str) {
    **str = c;
    ++(*str);
  } else
    (void)outbyte(c);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <printchar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <outbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define void @printchar(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %18
15: ; preds = %2
%16 = load i32, i32* %4
%17 = call i32 @outbyte(i32 %16)
br label %18
18: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @outbyte(i32 %1)
br label %11
11: ; preds = %9, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int yyparse();
int main(int argc, char **argv) {
  printf("> ");
  return yyparse();
}


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)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <yyparse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <yyparse@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @yyparse()
ret i32 %4
}
func1_abc() {}


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

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

LLVM IR (-O0):
define i32 @func1_abc() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func1_abc() {
ret i32 undef
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
scalar_t__ strlen(char *);
scalar_t__ strncmp(char *, int /*<<< orphan*/, scalar_t__);
int is_event_device(const struct dirent *dir) {
  return strncmp("event", dir->d_name, strlen("event") - 1) == 0;
}


x86 assembly (clang, -O0):
<is_event_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xec4(%rip),%rdi
call   1040 <strlen@plt>
mov    -0xc(%rbp),%esi
mov    %rax,%rdx
sub    $0x1,%rdx
lea    0xeae(%rip),%rdi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_event_device>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [6 x i8] c"event\00"
define i32 @is_event_device(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i64 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = sub nsw i64 %6, 1
%8 = call i64 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [6 x i8] c"event\00"
define i32 @is_event_device(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i64 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i64 4)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}