xunge/DecIR huggingface dataset:
unsigned long cycles0(void) {
  unsigned int hi, lo;
  __asm__ volatile("cpuid\n\t"
                   "rdtsc\n\t"
                   "mov %%edx, %0\n\t"
                   "mov %%eax, %1\n\t"
                   : "=r"(hi), "=r"(lo)::"%rax", "%rbx", "%rcx", "%rdx");
  return ((unsigned long long)lo) | (((unsigned long long)hi) << 32);
}


x86 assembly (clang, -O0):
<cycles0>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
cpuid
rdtsc
mov    %edx,%esi
mov    %eax,%edi
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycles0>:
push   %rbx
cpuid
rdtsc
mov    %edx,%esi
mov    %eax,%edi
mov    %edi,%eax
shl    $0x20,%rsi
or     %rax,%rsi
mov    %rsi,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @cycles0() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "cpuid\0A\09rdtsc\0A\09mov %edx, $0\0A\09mov %eax, $1\0A\09", "=r,=r,~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %1
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @cycles0() {
%1 = tail call { i32, i32 } asm sideeffect "cpuid\0A\09rdtsc\0A\09mov %edx, $0\0A\09mov %eax, $1\0A\09", "=r,=r,~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %3 to i64
%5 = zext i32 %2 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
void XESetCloseDisplay() {}


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

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

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

LLVM IR (-O2):
define void @XESetCloseDisplay() {
ret void
}
void hostmonitor_host_current_temp() {}


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

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

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

LLVM IR (-O2):
define void @hostmonitor_host_current_temp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hola a todos\0nada"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Hola a todos\00nada\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Hola a todos\00nada\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
int log_2(int n) {
  int res;
  for (res = 0; n >= 2; res++)
    n = n >> 1;
  return res;
}


x86 assembly (clang, -O0):
<log_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jl     112f <log_2+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <log_2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <log_2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <log_2+0x10>
ret

LLVM IR (-O0):
define i32 @log_2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 2
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = ashr i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @log_2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ OutputGetTachoCount(unsigned char, int *);
int MotorBlockTachoCount(unsigned char Output) {
  int Result = 0;
  OutputGetTachoCount(Output, &Result);
  return Result;
}


x86 assembly (clang, -O0):
<MotorBlockTachoCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
movzbl -0x1(%rbp),%edi
call   1030 <OutputGetTachoCount@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MotorBlockTachoCount>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <OutputGetTachoCount@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @MotorBlockTachoCount(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = call i32 @OutputGetTachoCount(i8 zeroext %4, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @MotorBlockTachoCount(i8 zeroext %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @OutputGetTachoCount(i8 zeroext %0, i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
char *longestPalindromeLCSDP(char *);
char *longestPalindromeLCSDPOP(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", longestPalindromeLCSDP("banana"));
  printf("%s\n", longestPalindromeLCSDPOP("banana"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <longestPalindromeLCSDP@plt>
mov    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1050 <printf@plt>
lea    0xea3(%rip),%rdi
call   1040 <longestPalindromeLCSDPOP@plt>
mov    %rax,%rsi
lea    0xe90(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec9(%rip),%r14
mov    %r14,%rdi
call   1030 <longestPalindromeLCSDP@plt>
lea    0xeb6(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <longestPalindromeLCSDPOP@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"banana\00"
define i32 @main() {
%1 = tail call i8* @longestPalindromeLCSDP(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* @longestPalindromeLCSDPOP(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
unsigned int fn6(unsigned int x) { return (x & 1) + x; }


x86 assembly (clang, -O0):
<fn6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn6>:
mov    %edi,%eax
and    $0x1,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = load i32, i32* %2
%6 = add i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @fn6(i32 %0) {
%2 = and i32 %0, 1
%3 = add i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_start_unary() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_call_start_unary>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_call_start_unary>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_start_unary() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_start_unary() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
char *getEnumSlidSat(int value) {
  switch (value) {
  case 0:
    return "SLID_UNSAT";
  case 1:
    return "SLID_SAT";
  default:
    return "SLID_UNDEF";
  }
}


x86 assembly (clang, -O0):
<getEnumSlidSat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <getEnumSlidSat+0x2b>
jmp    111a <getEnumSlidSat+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <getEnumSlidSat+0x3b>
jmp    114b <getEnumSlidSat+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <getEnumSlidSat+0x56>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <getEnumSlidSat+0x56>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEnumSlidSat>:
cmp    $0x1,%edi
lea    0xf01(%rip),%rax
lea    0xf03(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"SLID_UNSAT\00"
@.str.1 = [9 x i8] c"SLID_SAT\00"
@.str.2 = [11 x i8] c"SLID_UNDEF\00"
define i8* @getEnumSlidSat(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"SLID_UNSAT\00"
@.str.1 = [9 x i8] c"SLID_SAT\00"
@.str.2 = [11 x i8] c"SLID_UNDEF\00"
define i8* @getEnumSlidSat(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void tcp_fin(struct Ferret *ferret, struct NetFrame *frame) {
  ferret = (ferret);
  frame = (frame);
}


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

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

LLVM IR (-O0):
%struct.Ferret = type opaque
%struct.NetFrame = type opaque
define void @tcp_fin(%struct.Ferret* %0, %struct.NetFrame* %1) {
%3 = alloca %struct.Ferret*
%4 = alloca %struct.NetFrame*
store %struct.Ferret* %0, %struct.Ferret** %3
store %struct.NetFrame* %1, %struct.NetFrame** %4
%5 = load %struct.Ferret*, %struct.Ferret** %3
store %struct.Ferret* %5, %struct.Ferret** %3
%6 = load %struct.NetFrame*, %struct.NetFrame** %4
store %struct.NetFrame* %6, %struct.NetFrame** %4
ret void
}

LLVM IR (-O2):
%struct.Ferret = type opaque
%struct.NetFrame = type opaque
define void @tcp_fin(%struct.Ferret* nocapture %0, %struct.NetFrame* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
extern void bzero(char *a, int c) { memset(a, 0, c); }


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

x86 assembly (clang, -O2):
<bzero>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bzero(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 = load i32, i32* %4
%7 = call i32 @memset(i8* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @bzero(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
void glClearBufferiv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glClearBufferiv() {
ret void
}
void minuscula(char *ltr) {
  if ((ltr[0] >= 65) && (ltr[0] <= 90))
    ltr[0] += 32;
}


x86 assembly (clang, -O0):
<minuscula>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1134 <minuscula+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1134 <minuscula+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<minuscula>:
mov    (%rdi),%al
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     110e <minuscula+0xe>
add    $0x20,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @minuscula(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %21
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 90
br i1 %13, label %14, label %21
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = add nsw i32 %18, 32
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
br label %21
21: ; preds = %14, %8, %1
ret void
}

LLVM IR (-O2):
define void @minuscula(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nuw nsw i8 %2, 32
store i8 %6, i8* %0
br label %7
7: ; preds = %5, %1
ret void
}
void av_hwaccel_next() {}


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

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

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

LLVM IR (-O2):
define void @av_hwaccel_next() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writestr(int, char *);
void usage(void) { writestr(2, "usage: ls [-1aAdf] [DIR ...] [FILE ...]\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
call   1030 <writestr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <writestr@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"usage: ls [-1aAdf] [DIR ...] [FILE ...]\0A\00"
define void @usage() {
%1 = call i32 @writestr(i32 2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"usage: ls [-1aAdf] [DIR ...] [FILE ...]\0A\00"
define void @usage() {
%1 = tail call i32 @writestr(i32 2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EAGAIN;
int EINTR;
int EWOULDBLOCK;
bool udp_error_is_recoverable(int error) {
  return (error == -EAGAIN || error == -EINTR || error == -EWOULDBLOCK);
}


x86 assembly (clang, -O0):
<udp_error_is_recoverable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %edx,%edx
mov    0x2eb5(%rip),%rax
sub    (%rax),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
je     1153 <udp_error_is_recoverable+0x53>
mov    -0x4(%rbp),%ecx
xor    %edx,%edx
mov    0x2eaa(%rip),%rax
sub    (%rax),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
je     1153 <udp_error_is_recoverable+0x53>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
mov    0x2e97(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_error_is_recoverable>:
mov    0x2ec1(%rip),%rcx
mov    $0x1,%eax
mov    (%rcx),%ecx
add    %edi,%ecx
je     112d <udp_error_is_recoverable+0x2d>
mov    0x2ebf(%rip),%rcx
mov    (%rcx),%ecx
add    %edi,%ecx
je     112d <udp_error_is_recoverable+0x2d>
mov    0x2eba(%rip),%rcx
xor    %eax,%eax
add    (%rcx),%edi
sete   %al
ret

LLVM IR (-O0):
@EAGAIN = global i32 0
@EINTR = global i32 0
@EWOULDBLOCK = global i32 0
define i32 @udp_error_is_recoverable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EAGAIN
%5 = sub nsw i32 0, %4
%6 = icmp eq i32 %3, %5
br i1 %6, label %17, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = load i32, i32* @EINTR
%10 = sub nsw i32 0, %9
%11 = icmp eq i32 %8, %10
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = load i32, i32* @EWOULDBLOCK
%15 = sub nsw i32 0, %14
%16 = icmp eq i32 %13, %15
br label %17
17: ; preds = %12, %7, %1
%18 = phi i1 [ true, %7 ], [ true, %1 ], [ %16, %12 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
@EAGAIN = global i32 0
@EINTR = global i32 0
@EWOULDBLOCK = global i32 0
define i32 @udp_error_is_recoverable(i32 %0) {
%2 = load i32, i32* @EAGAIN
%3 = sub nsw i32 0, %2
%4 = icmp eq i32 %3, %0
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* @EINTR
%7 = sub nsw i32 0, %6
%8 = icmp eq i32 %7, %0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = load i32, i32* @EWOULDBLOCK
%11 = sub nsw i32 0, %10
%12 = icmp eq i32 %11, %0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %9, %5, %1
%15 = phi i32 [ 1, %5 ], [ 1, %1 ], [ %13, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xb1() {
  Assert_real((isprint(177) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              890, ("isprint should be 0 for 0xb1"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xb1>:
push   %rax
mov    $0xb1,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x37a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb1\00"
define void @t_isprint_0xb1() {
%1 = call i64 @isprint(i32 177)
%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 890, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb1\00"
define void @t_isprint_0xb1() {
%1 = tail call i64 @isprint(i32 177)
%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 890, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void bra(p, a) struct h8_opcode *p;
char *a;
{ printf("if (%s) npc += ((char )b1)>>1;\n", a); }


x86 assembly (clang, -O0):
<bra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.h8_opcode = type opaque
@.str = [32 x i8] c"if (%s) npc += ((char )b1)>>1;\0A\00"
define void @bra(%struct.h8_opcode* %0, i8* %1) {
%3 = alloca %struct.h8_opcode*
%4 = alloca i8*
store %struct.h8_opcode* %0, %struct.h8_opcode** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
%struct.h8_opcode = type opaque
@.str = [32 x i8] c"if (%s) npc += ((char )b1)>>1;\0A\00"
define void @bra(%struct.h8_opcode* nocapture readnone %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcd2_bin(long *, long);
long bcd2_cmp(long *low1, long *high1, long comp) {
  long temp = 0;
  bcd2_bin(&temp, *high1);
  if (temp > 214)
    return (1);
  bcd2_bin(&temp, *low1);
  return (temp - comp);
}


x86 assembly (clang, -O0):
<bcd2_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    -0x28(%rbp),%rdi
call   1030 <bcd2_bin@plt>
cmpq   $0xd6,-0x28(%rbp)
jle    1157 <bcd2_cmp+0x47>
movq   $0x1,-0x8(%rbp)
jmp    1173 <bcd2_cmp+0x63>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    -0x28(%rbp),%rdi
call   1030 <bcd2_bin@plt>
mov    -0x28(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd2_cmp>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    (%rsi),%rsi
mov    %rsp,%rdi
call   1030 <bcd2_bin@plt>
mov    $0x1,%eax
cmpq   $0xd6,(%rsp)
jg     114e <bcd2_cmp+0x3e>
mov    (%rbx),%rsi
mov    %rsp,%rdi
call   1030 <bcd2_bin@plt>
mov    (%rsp),%rax
sub    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @bcd2_cmp(i64* nocapture %0, i64* nocapture %1, i64 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%6 = load i64, i64* %1
%7 = call i32 @bcd2_bin(i64* %4, i64 %6)
%8 = load i64, i64* %4
%9 = icmp sgt i64 %8, 214
br i1 %9, label %15, label %10
10: ; preds = %3
%11 = load i64, i64* %0
%12 = call i32 @bcd2_bin(i64* %4, i64 %11)
%13 = load i64, i64* %4
%14 = sub nsw i64 %13, %2
br label %15
15: ; preds = %3, %10
%16 = phi i64 [ %14, %10 ], [ 1, %3 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ enter();
void picosat_enter(void) { enter(); }


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

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

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

LLVM IR (-O2):
define void @picosat_enter() {
%1 = tail call i32 (...) @enter()
ret void
}
/* Variables and functions */
void stb_fixpath(char *path) {
  for (; *path; ++path)
    if (*path == '\\')
      *path = '/';
}


x86 assembly (clang, -O0):
<stb_fixpath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <stb_fixpath+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    112c <stb_fixpath+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x2f,(%rax)
jmp    1131 <stb_fixpath+0x31>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <stb_fixpath+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_fixpath>:
jmp    1117 <stb_fixpath+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x2f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x5c,%al
je     1110 <stb_fixpath+0x10>
test   %al,%al
jne    1113 <stb_fixpath+0x13>
ret

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

LLVM IR (-O2):
define void @stb_fixpath(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 92, label %5
]
5: ; preds = %2
store i8 47, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_spaces(unsigned int n) {
  while (n-- > 0)
    putchar(' ');
}


x86 assembly (clang, -O0):
<print_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jbe    113e <print_spaces+0x2e>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    111b <print_spaces+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_spaces>:
push   %rbx
test   %edi,%edi
je     112f <print_spaces+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_spaces+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @print_spaces(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ugt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @putchar(i8 signext 32)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @print_spaces(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 32)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void RTFileOpenV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileOpenV() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DSA;
typedef int /*<<< orphan*/ BN_MONT_CTX;
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_mod_exp2_mont(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, BIGNUM *a2,
                BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) {
  return BN_mod_exp2_mont(rr, a1, p1, a2, p2, m, ctx, in_mont);
}


x86 assembly (clang, -O0):
<dsa_mod_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r10
mov    0x20(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <BN_mod_exp2_mont@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsa_mod_exp>:
sub    $0x18,%rsp
mov    %r9,%rax
mov    %rsi,%rdi
mov    0x20(%rsp),%r9
movups 0x28(%rsp),%xmm0
movups %xmm0,(%rsp)
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %rax,%r8
call   1030 <BN_mod_exp2_mont@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @dsa_mod_exp(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8) {
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
store i32* %0, i32** %10
store i32* %1, i32** %11
store i32* %2, i32** %12
store i32* %3, i32** %13
store i32* %4, i32** %14
store i32* %5, i32** %15
store i32* %6, i32** %16
store i32* %7, i32** %17
store i32* %8, i32** %18
%19 = load i32*, i32** %11
%20 = load i32*, i32** %12
%21 = load i32*, i32** %13
%22 = load i32*, i32** %14
%23 = load i32*, i32** %15
%24 = load i32*, i32** %16
%25 = load i32*, i32** %17
%26 = load i32*, i32** %18
%27 = call i32 @BN_mod_exp2_mont(i32* %19, i32* %20, i32* %21, i32* %22, i32* %23, i32* %24, i32* %25, i32* %26)
ret i32 %27
}

LLVM IR (-O2):
define i32 @dsa_mod_exp(i32* nocapture readnone %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8) {
%10 = tail call i32 @BN_mod_exp2_mont(i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8)
ret i32 %10
}
int ffsll(i)
long long int i;
{
  unsigned long long int x = i & -i;
  if (x <= 0xffffffff)
    return ffs(i);
  else
    return 32 + ffs(i >> 32);
}


x86 assembly (clang, -O0):
<ffsll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    $0xffffffff,%eax
cmp    %rax,-0x18(%rbp)
ja     114f <ffsll+0x3f>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <ffs@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <ffsll+0x54>
mov    -0x10(%rbp),%rdi
sar    $0x20,%rdi
mov    $0x0,%al
call   1030 <ffs@plt>
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsll>:
mov    %rdi,%rax
neg    %rax
and    %rdi,%rax
shr    $0x20,%rax
jne    1126 <ffsll+0x16>
xor    %eax,%eax
jmp    1030 <ffs@plt>
push   %rax
sar    $0x20,%rdi
xor    %eax,%eax
call   1030 <ffs@plt>
add    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ffsll(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = sub nsw i64 0, %6
%8 = and i64 %5, %7
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = icmp ule i64 %9, 4294967295
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i64, i64* %3
%13 = call i32 (i64, ...) bitcast (i32 (...)* @ffs to i32 (i64, ...)*)(i64 %12)
store i32 %13, i32* %2
br label %19
14: ; preds = %1
%15 = load i64, i64* %3
%16 = ashr i64 %15, 32
%17 = call i32 (i64, ...) bitcast (i32 (...)* @ffs to i32 (i64, ...)*)(i64 %16)
%18 = add nsw i32 32, %17
store i32 %18, i32* %2
br label %19
19: ; preds = %14, %11
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @ffsll(i64 %0) {
%2 = sub nsw i64 0, %0
%3 = and i64 %2, %0
%4 = icmp ult i64 %3, 4294967296
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i64, ...) bitcast (i32 (...)* @ffs to i32 (i64, ...)*)(i64 %0)
br label %11
7: ; preds = %1
%8 = ashr i64 %0, 32
%9 = tail call i32 (i64, ...) bitcast (i32 (...)* @ffs to i32 (i64, ...)*)(i64 %8)
%10 = add nsw i32 %9, 32
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ %6, %5 ], [ %10, %7 ]
ret i32 %12
}
int m_readchk(fd)
int fd;
{ return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @m_readchk(i32 %0) {
ret i32 -1
}
int worker_stub(void *data) {
  (void)data;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @worker_stub(i8* nocapture readnone %0) {
ret i32 0
}
int audioRecStop() { return 0; }


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

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

LLVM IR (-O0):
define i32 @audioRecStop() {
ret i32 0
}

LLVM IR (-O2):
define i32 @audioRecStop() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ hd44780_ll_instruction_read();
uint8_t hd44780_read_busy_flag_and_address(void) {
  return (hd44780_ll_instruction_read());
}


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

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

LLVM IR (-O0):
define i32 @hd44780_read_busy_flag_and_address() {
%1 = call i32 (...) @hd44780_ll_instruction_read()
ret i32 %1
}

LLVM IR (-O2):
define i32 @hd44780_read_busy_flag_and_address() {
%1 = tail call i32 (...) @hd44780_ll_instruction_read()
ret i32 %1
}
/* Type definitions */
struct cl_pool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cl_pool_block_free(struct cl_pool *p, void **block) {
  while (block) {
    void *b = block;
    block = *block;
    free(b);
  }
}


x86 assembly (clang, -O0):
<cl_pool_block_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <cl_pool_block_free+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1120 <cl_pool_block_free+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_pool_block_free>:
push   %rbx
test   %rsi,%rsi
je     1130 <cl_pool_block_free+0x20>
mov    %rsi,%rdi
nopl   0x0(%rax)
mov    (%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
test   %rbx,%rbx
jne    1120 <cl_pool_block_free+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.cl_pool = type { i32 }
define void @cl_pool_block_free(%struct.cl_pool* %0, i8** %1) {
%3 = alloca %struct.cl_pool*
%4 = alloca i8**
%5 = alloca i8*
store %struct.cl_pool* %0, %struct.cl_pool** %3
store i8** %1, i8*** %4
br label %6
6: ; preds = %9, %2
%7 = load i8**, i8*** %4
%8 = icmp ne i8** %7, null
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i8**, i8*** %4
%11 = bitcast i8** %10 to i8*
store i8* %11, i8** %5
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = bitcast i8* %13 to i8**
store i8** %14, i8*** %4
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.cl_pool = type { i32 }
define void @cl_pool_block_free(%struct.cl_pool* nocapture readnone %0, i8** %1) {
%3 = icmp eq i8** %1, null
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i8** [ %8, %4 ], [ %1, %2 ]
%6 = bitcast i8** %5 to i8*
%7 = bitcast i8** %5 to i8***
%8 = load i8**, i8*** %7
%9 = tail call i32 @free(i8* %6)
%10 = icmp eq i8** %8, null
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
long reset_reason_val(void) {
  extern long reset_reason;
  return reset_reason;
}


x86 assembly (clang, -O0):
<reset_reason_val>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_reason_val>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@reset_reason = external global i64
define i64 @reset_reason_val() {
%1 = load i64, i64* @reset_reason
ret i64 %1
}

LLVM IR (-O2):
@reset_reason = external global i64
define i64 @reset_reason_val() {
%1 = load i64, i64* @reset_reason
ret i64 %1
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int EINVAL;
int raise(int);
int kill(pid_t pid, int sig) {
  if (pid > 0)
    return -EINVAL;
  return raise(sig);
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    113d <kill+0x2d>
xor    %eax,%eax
mov    0x2ead(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <kill+0x38>
mov    -0x14(%rbp),%edi
call   1030 <raise@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
test   %rdi,%rdi
jle    1121 <kill+0x11>
mov    0x2ec4(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret
mov    %esi,%edi
jmp    1030 <raise@plt>

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @kill(i64 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i64, i64* %4
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
store i32 %10, i32* %3
br label %14
11: ; preds = %2
%12 = load i32, i32* %5
%13 = call i32 @raise(i32 %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @kill(i64 %0, i32 %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
br label %9
7: ; preds = %2
%8 = tail call i32 @raise(i32 %1)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int __gpio_to_irq(int);
int test_gpio_to_irq(void) {
  int i, j;
  i = 0;
  j = 0;
  i = __gpio_to_irq(0);
  if (0 == i) {
    return (-1);
  }
  j = __gpio_to_irq(1);
  if (0 == i) {
    return (-1);
  }
  if (1 == (j - i)) {
    return (0);
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<test_gpio_to_irq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %edi,%edi
call   1030 <__gpio_to_irq@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1147 <test_gpio_to_irq+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <test_gpio_to_irq+0x81>
mov    $0x1,%edi
call   1030 <__gpio_to_irq@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    116b <test_gpio_to_irq+0x5b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <test_gpio_to_irq+0x81>
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    118a <test_gpio_to_irq+0x7a>
movl   $0x0,-0x4(%rbp)
jmp    1191 <test_gpio_to_irq+0x81>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_gpio_to_irq>:
push   %rbx
xor    %edi,%edi
call   1030 <__gpio_to_irq@plt>
test   %eax,%eax
je     1138 <test_gpio_to_irq+0x28>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <__gpio_to_irq@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
setne  %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @test_gpio_to_irq() {
%1 = tail call i32 @__gpio_to_irq(i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @__gpio_to_irq(i32 1)
%5 = sub nsw i32 %4, %1
%6 = icmp ne i32 %5, 1
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ -1, %0 ], [ %7, %3 ]
ret i32 %9
}
int main(void) {
  int *i = (int *)&main;
  *i = 0xdead;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ed6(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xdead,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ee1(%rip),%rax
movl   $0xdead,(%rax)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* bitcast (i32 ()* @main to i32*), i32** %2
%3 = load i32*, i32** %2
store i32 57005, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() align 4 {
store i32 57005, i32* bitcast (i32 ()* @main to i32*)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBEndpointPacketCountSet(uint32_t ui32Base, uint32_t ui32Endpoint,
                               uint32_t ui32Count) {
  (*((volatile unsigned long *)(ui32Base + 0x00000304 +
                                (0x4 * (((ui32Endpoint) >> 4) - 1))))) =
      ui32Count;
}


x86 assembly (clang, -O0):
<USBEndpointPacketCountSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    $0x304,%eax
mov    -0x8(%rbp),%edx
sar    $0x4,%edx
sub    $0x1,%edx
shl    $0x2,%edx
add    %edx,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointPacketCountSet>:
movslq %edx,%rax
movslq %edi,%rcx
sar    $0x2,%esi
add    $0xfffffffc,%esi
movslq %esi,%rdx
and    $0xfffffffffffffffc,%rdx
mov    %rax,0x304(%rcx,%rdx,1)
ret

LLVM IR (-O0):
define void @USBEndpointPacketCountSet(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* %6
%8 = sext i32 %7 to i64
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 772
%11 = load i32, i32* %5
%12 = ashr i32 %11, 4
%13 = sub nsw i32 %12, 1
%14 = mul nsw i32 4, %13
%15 = add nsw i32 %10, %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i64*
store volatile i64 %8, i64* %17
ret void
}

LLVM IR (-O2):
define void @USBEndpointPacketCountSet(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = add nsw i32 %0, 772
%6 = ashr i32 %1, 2
%7 = add nsw i32 %6, -4
%8 = and i32 %7, -4
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
store volatile i64 %4, i64* %11
ret void
}
/* Type definitions */
struct mem_block {
  int dummy;
};

/* Variables and functions */
void *mem_block_end(struct mem_block *);
bool mem_block_inside(struct mem_block *block, void *addr) {
  return (addr >= (void *)block) && (addr < mem_block_end(block));
}


x86 assembly (clang, -O0):
<mem_block_inside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x11(%rbp)
jb     1157 <mem_block_inside+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mem_block_end@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
setb   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_block_inside>:
xor    %eax,%eax
cmp    %rsi,%rdi
ja     112c <mem_block_inside+0x1c>
push   %rbx
mov    %rsi,%rbx
call   1030 <mem_block_end@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
seta   %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.mem_block = type { i32 }
define i32 @mem_block_inside(%struct.mem_block* %0, i8* %1) {
%3 = alloca %struct.mem_block*
%4 = alloca i8*
store %struct.mem_block* %0, %struct.mem_block** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load %struct.mem_block*, %struct.mem_block** %3
%7 = bitcast %struct.mem_block* %6 to i8*
%8 = icmp uge i8* %5, %7
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load %struct.mem_block*, %struct.mem_block** %3
%12 = call i8* @mem_block_end(%struct.mem_block* %11)
%13 = icmp ult i8* %10, %12
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ false, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
%struct.mem_block = type { i32 }
define i32 @mem_block_inside(%struct.mem_block* %0, i8* readnone %1) {
%3 = bitcast %struct.mem_block* %0 to i8*
%4 = icmp ugt i8* %3, %1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i8* @mem_block_end(%struct.mem_block* %0)
%7 = icmp ugt i8* %6, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}