xunge/DecIR huggingface dataset:
int Base64_EncodeSizeInBytes(int dataSizeInBytes) {
  return (dataSizeInBytes + 2) / 3 * 4;
}


x86 assembly (clang, -O0):
<Base64_EncodeSizeInBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Base64_EncodeSizeInBytes>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @Base64_EncodeSizeInBytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 4
ret i32 %6
}

LLVM IR (-O2):
define i32 @Base64_EncodeSizeInBytes(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ resetdeferstack();
void resetbuttons(void) { resetdeferstack(); }


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

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

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

LLVM IR (-O2):
define void @resetbuttons() {
%1 = tail call i32 (...) @resetdeferstack()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ standard_command(int, int /*<<< orphan*/, int, char **);
void two_arguments_command(int opcode_byte, char **arguments) {
  standard_command(opcode_byte, 0, 2, arguments);
}


x86 assembly (clang, -O0):
<two_arguments_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <standard_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_arguments_command>:
mov    %rsi,%rcx
xor    %esi,%esi
mov    $0x2,%edx
jmp    1030 <standard_command@plt>

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

LLVM IR (-O2):
define void @two_arguments_command(i32 %0, i8** %1) {
%3 = tail call i32 @standard_command(i32 %0, i32 0, i32 2, i8** %1)
ret void
}
int root(int *arr, int x) {
  if (arr[x] < 0)
    return x;
  arr[x] = root(arr, arr[x]);
  return arr[x];
}


x86 assembly (clang, -O0):
<root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    113c <root+0x2c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <root+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <root@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<root>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%eax
movslq %esi,%r14
mov    (%rdi,%r14,4),%esi
test   %esi,%esi
js     112d <root+0x1d>
mov    %rdi,%rbx
call   1030 <root@plt>
mov    %eax,(%rbx,%r14,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @root(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2, %9
%8 = phi i32 [ %10, %9 ], [ %1, %2 ]
ret i32 %8
9: ; preds = %2
%10 = tail call i32 @root(i32* %0, i32 %5)
store i32 %10, i32* %4
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, float *, double *);
int main() {
  int a;
  float b;
  double c;
  scanf("%d%f%lf", &a, &b, &c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d%f%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3, double* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d%f%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1, float* %2, double* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int socket_unix(void) { return socket(AF_UNIX, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<socket_unix>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_unix>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @socket_unix() {
%1 = load i32, i32* @AF_UNIX
%2 = load i32, i32* @SOCK_STREAM
%3 = call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @socket_unix() {
%1 = load i32, i32* @AF_UNIX
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
int compare_doubles(const void *a, const void *b) {
  const double *da = (const double *)a;
  const double *db = (const double *)b;
  return (*da > *db) - (*da < *db);
}


x86 assembly (clang, -O0):
<compare_doubles>:
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
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
movsd  (%rcx),%xmm1
mov    -0x20(%rbp),%rcx
movsd  (%rcx),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_doubles>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_doubles(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
store double* %8, double** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
store double* %10, double** %6
%11 = load double*, double** %5
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = fcmp ogt double %12, %14
%16 = zext i1 %15 to i32
%17 = load double*, double** %5
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = fcmp olt double %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @compare_doubles(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt double %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int MemcmpLowercase(void *, void *, size_t);
int SCMemcmpLowercase(void *s1, void *s2, size_t len) {
  return MemcmpLowercase(s1, s2, len);
}


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

x86 assembly (clang, -O2):
<SCMemcmpLowercase>:
jmp    1030 <MemcmpLowercase@plt>

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

LLVM IR (-O2):
define i32 @SCMemcmpLowercase(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @MemcmpLowercase(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }


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

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

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int Operand_label8_ator(unsigned int *valp, unsigned int pc) {
  *valp -= pc;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_label8_ator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_label8_ator>:
sub    %esi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_label8_ator(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sub i32 %3, %1
store i32 %4, i32* %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ucontext_t;

/* Variables and functions */
int getcontext(int /*<<< orphan*/ *);
int __fillcontextx(char *ctx) {
  ucontext_t *ucp;
  ucp = (ucontext_t *)ctx;
  return (getcontext(ucp));
}


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

x86 assembly (clang, -O2):
<__fillcontextx>:
push   %rax
call   1030 <getcontext@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__fillcontextx(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @getcontext(i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__fillcontextx(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = call i32 @getcontext(i32* %2)
ret i32 %3
}
void set_PMUX_B(unsigned char pinnum, unsigned char value) {
  value &= 0x08;
  unsigned char pmux_n =
      *(unsigned char volatile *)(0x41004400 + 0x30 + 0x80 + (pinnum / 2));
  unsigned char offset = pinnum % 2;
  unsigned char buf = pmux_n;
  buf &= (0xF0 >> (offset * 4));
  buf |= (value << (offset * 4));
  pmux_n = buf;
}


x86 assembly (clang, -O0):
<set_PMUX_B>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0x8,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x410044b0,%eax
cltq
mov    (%rax),%al
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x4(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x5(%rbp)
movzbl -0x4(%rbp),%ecx
shl    $0x2,%ecx
mov    $0xf0,%eax
sar    %cl,%eax
mov    %eax,%ecx
movzbl -0x5(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x5(%rbp)
movzbl -0x2(%rbp),%eax
movzbl -0x4(%rbp),%ecx
shl    $0x2,%ecx
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x3(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_PMUX_B>:
mov    %edi,%eax
shr    %rax
mov    0x410044b0(%rax),%al
ret

LLVM IR (-O0):
define void @set_PMUX_B(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = and i32 %9, 8
%11 = trunc i32 %10 to i8
store i8 %11, i8* %4
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sdiv i32 %13, 2
%15 = add nsw i32 1090536624, %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
%18 = load volatile i8, i8* %17
store i8 %18, i8* %5
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = srem i32 %20, 2
%22 = trunc i32 %21 to i8
store i8 %22, i8* %6
%23 = load i8, i8* %5
store i8 %23, i8* %7
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = mul nsw i32 %25, 4
%27 = ashr i32 240, %26
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = and i32 %29, %27
%31 = trunc i32 %30 to i8
store i8 %31, i8* %7
%32 = load i8, i8* %4
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = mul nsw i32 %35, 4
%37 = shl i32 %33, %36
%38 = load i8, i8* %7
%39 = zext i8 %38 to i32
%40 = or i32 %39, %37
%41 = trunc i32 %40 to i8
store i8 %41, i8* %7
%42 = load i8, i8* %7
store i8 %42, i8* %5
ret void
}

LLVM IR (-O2):
define void @set_PMUX_B(i8 zeroext %0, i8 zeroext %1) {
%3 = lshr i8 %0, 1
%4 = zext i8 %3 to i64
%5 = add nuw nsw i64 %4, 1090536624
%6 = inttoptr i64 %5 to i8*
%7 = load volatile i8, i8* %6
ret void
}
void Intake(int in1, int in2) {
  if (in1 == 1) {
    Pickup();
  } else if (in2 == 1) {
    Release();
  } else {
    Pickup(0);
    Release(0);
  }
}


x86 assembly (clang, -O0):
<Intake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1144 <Intake+0x24>
mov    $0x0,%al
call   1040 <Pickup@plt>
jmp    1171 <Intake+0x51>
cmpl   $0x1,-0x8(%rbp)
jne    115a <Intake+0x3a>
mov    $0x0,%al
call   1030 <Release@plt>
jmp    116c <Intake+0x4c>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <Pickup@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <Release@plt>
jmp    1171 <Intake+0x51>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Intake>:
cmp    $0x1,%edi
jne    112c <Intake+0xc>
xor    %eax,%eax
jmp    1040 <Pickup@plt>
cmp    $0x1,%esi
jne    1138 <Intake+0x18>
xor    %eax,%eax
jmp    1030 <Release@plt>
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1040 <Pickup@plt>
xor    %edi,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <Release@plt>

LLVM IR (-O0):
define void @Intake(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @Pickup()
br label %18
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (...) @Release()
br label %17
14: ; preds = %9
%15 = call i32 (i32, ...) bitcast (i32 (...)* @Pickup to i32 (i32, ...)*)(i32 0)
%16 = call i32 (i32, ...) bitcast (i32 (...)* @Release to i32 (i32, ...)*)(i32 0)
br label %17
17: ; preds = %14, %12
br label %18
18: ; preds = %17, %7
ret void
}

LLVM IR (-O2):
define void @Intake(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @Pickup()
br label %13
6: ; preds = %2
%7 = icmp eq i32 %1, 1
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 (...) @Release()
br label %13
10: ; preds = %6
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @Pickup to i32 (i32, ...)*)(i32 0)
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @Release to i32 (i32, ...)*)(i32 0)
br label %13
13: ; preds = %8, %10, %4
ret void
}
__attribute__((weak)) void fd_nrf8001_radio_reset_success(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_radio_reset_success() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char const *, int, char const *,
                       int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void check_rc(const char *file, int line, const char *src, int rc) {
  if (rc)
    die("%s, %d (\"%s\"): error: %s", file, line, src, strerror(errno));
}


x86 assembly (clang, -O0):
<check_rc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     117e <check_rc+0x5e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x38(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    %eax,%r8d
lea    0xe87(%rip),%rdi
call   1030 <die@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_rc>:
test   %ecx,%ecx
je     1159 <check_rc+0x39>
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <die@plt>
ret

LLVM IR (-O0):
@.str = [25 x i8] c"%s, %d (\22%s\22): error: %s\00"
@errno = global i32 0
define void @check_rc(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = load i32, i32* @errno
%16 = call i32 @strerror(i32 %15)
%17 = call i32 @die(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i8* %14, i32 %16)
br label %18
18: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s, %d (\22%s\22): error: %s\00"
@errno = global i32 0
define void @check_rc(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @die(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i32 %8)
br label %10
10: ; preds = %6, %4
ret void
}
int test_imm_4Eint64_midword_reg(long long val) {
  return ((val >> 16) & (0x4E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Eint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5111808
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ ta_oom_b(int /*<<< orphan*/);
int /*<<< orphan*/ ta_vasprintf_append_buffer(char **, char const *,
                                              int /*<<< orphan*/);
char *ta_talloc_vasprintf_append_buffer(char *s, const char *fmt, va_list ap) {
  ta_oom_b(ta_vasprintf_append_buffer(&s, fmt, ap));
  return s;
}


x86 assembly (clang, -O0):
<ta_talloc_vasprintf_append_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x8(%rbp),%rdi
call   1030 <ta_vasprintf_append_buffer@plt>
mov    %eax,%edi
call   1040 <ta_oom_b@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ta_talloc_vasprintf_append_buffer>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <ta_vasprintf_append_buffer@plt>
mov    %eax,%edi
call   1040 <ta_oom_b@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @ta_talloc_vasprintf_append_buffer(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
store i8* %0, i8** %4
%5 = call i32 @ta_vasprintf_append_buffer(i8** %4, i8* %1, i32 %2)
%6 = call i32 @ta_oom_b(i32 %5)
%7 = load i8*, i8** %4
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M130_f(char *s) {
  debug("M130_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M130_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M130_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M130_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M130_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M130_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M130_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int literal(char c) {
  if (c && strchr("`\\", c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<literal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     1151 <literal+0x41>
lea    0xece(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1151 <literal+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1158 <literal+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<literal>:
test   %dil,%dil
je     1139 <literal+0x29>
push   %rax
movsbl %dil,%esi
lea    0xedf(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
lea    0x8(%rsp),%rsp
je     1139 <literal+0x29>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"`\\\00"
define i32 @literal(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %1
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
double gsw_specvol(double, double, double);
double gsw_specvol_sso_0_p(double);
double gsw_specvol_anom(double sa, double ct, double p) {
  return (gsw_specvol(sa, ct, p) - gsw_specvol_sso_0_p(p));
}


x86 assembly (clang, -O0):
<gsw_specvol_anom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <gsw_specvol@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <gsw_specvol_sso_0_p@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_specvol_anom>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
call   1040 <gsw_specvol@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <gsw_specvol_sso_0_p@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @gsw_specvol_anom(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @gsw_specvol(double %7, double %8, double %9)
%11 = load double, double* %6
%12 = call double @gsw_specvol_sso_0_p(double %11)
%13 = fsub double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @gsw_specvol_anom(double %0, double %1, double %2) {
%4 = tail call double @gsw_specvol(double %0, double %1, double %2)
%5 = tail call double @gsw_specvol_sso_0_p(double %2)
%6 = fsub double %4, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x02() {
  Assert_real((isdigit(2) == 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_isdigit.c",
              15, ("isdigit should be 0 for 0x02"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x02>:
push   %rax
mov    $0x2,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x02\00"
define void @t_isdigit_0x02() {
%1 = call i64 @isdigit(i32 2)
%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 15, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x02\00"
define void @t_isdigit_0x02() {
%1 = tail call i64 @isdigit(i32 2)
%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 15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup();
int main(void) {
  setup();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup()
ret i32 0
}
/* Variables and functions */
int putLine(char **, char *, int);
int putLines(char **buffer, char *t, int addCRLF) {
  int n, n1 = 0;
  while (*t) {
    n = putLine(buffer, t, addCRLF);
    t += n;
    n1 += n;
  }
  return n1;
}


x86 assembly (clang, -O0):
<putLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1169 <putLines+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <putLine@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <putLines+0x1a>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putLines>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rsi)
je     114e <putLines+0x3e>
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <putLine@plt>
cltq
add    %eax,%ebp
cmpb   $0x0,(%rbx,%rax,1)
lea    (%rbx,%rax,1),%rbx
jne    1130 <putLines+0x20>
jmp    1150 <putLines+0x40>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @putLines(i8** %0, i8* %1, i32 %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %12, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %1, %3 ]
%9 = tail call i32 @putLine(i8** %0, i8* %8, i32 %2)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = add nsw i32 %9, %7
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %3
%16 = phi i32 [ 0, %3 ], [ %12, %6 ]
ret i32 %16
}
int allMarked(int *selected, int n) {
  int i, flag = 1;
  for (i = 0; i < n; i++) {
    if (selected[i] == 0) {
      flag = 0;
      break;
    }
  }
  return flag;
}


x86 assembly (clang, -O0):
<allMarked>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1156 <allMarked+0x56>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1143 <allMarked+0x43>
movl   $0x0,-0x14(%rbp)
jmp    1156 <allMarked+0x56>
jmp    1148 <allMarked+0x48>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <allMarked+0x19>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allMarked>:
mov    $0x1,%eax
test   %esi,%esi
jle    111f <allMarked+0x1f>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpl   $0x0,(%rdi,%rdx,4)
je     1120 <allMarked+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <allMarked+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @allMarked(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %14, label %6
14: ; preds = %6, %8, %2
%15 = phi i32 [ 1, %2 ], [ 0, %8 ], [ 1, %6 ]
ret i32 %15
}
int fun1000() { return 1000; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x3e8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x3e8,%eax
ret

LLVM IR (-O0):
define i32 @fun1000() {
ret i32 1000
}

LLVM IR (-O2):
define i32 @fun1000() {
ret i32 1000
}
int netlib_get_page_size(void) { return (8192L); }


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

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

LLVM IR (-O0):
define i32 @netlib_get_page_size() {
ret i32 8192
}

LLVM IR (-O2):
define i32 @netlib_get_page_size() {
ret i32 8192
}
/* Variables and functions */
int fibonacci(int);
int main() {
  int n = 9;
  *(int *)0x07FC = fibonacci(n);
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    $0x7fc,%eax
mov    %ecx,(%rax)
jmp    1137 <main+0x27>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1030 <fibonacci@plt>
mov    %eax,0x7fc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1130 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 9, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fibonacci(i32 %3)
store i32 %4, i32* inttoptr (i64 2044 to i32*)
br label %5
5: ; preds = %0, %5
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fibonacci(i32 9)
store i32 %1, i32* inttoptr (i64 2044 to i32*)
br label %2
2: ; preds = %2, %0
br label %2
}
void strCpyReplace(char *dest, const char *src) {
  while (*src) {
    if (*src != '_')
      *dest++ = *src;
    else
      *dest++ = ' ';
    src++;
  }
}


x86 assembly (clang, -O0):
<strCpyReplace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <strCpyReplace+0x68>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     1145 <strCpyReplace+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1157 <strCpyReplace+0x57>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x20,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strCpyReplace+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCpyReplace>:
xor    %eax,%eax
jmp    1119 <strCpyReplace+0x19>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%cl
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
movzbl (%rsi,%rax,1),%ecx
cmp    $0x5f,%cl
je     1110 <strCpyReplace+0x10>
test   %cl,%cl
jne    1112 <strCpyReplace+0x12>
ret

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

LLVM IR (-O2):
define void @strCpyReplace(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %10, %8 ]
%5 = phi i8* [ %1, %2 ], [ %11, %8 ]
%6 = load i8, i8* %5
switch i8 %6, label %8 [
i8 0, label %12
i8 95, label %7
]
7: ; preds = %3
br label %8
8: ; preds = %3, %7
%9 = phi i8 [ 32, %7 ], [ %6, %3 ]
%10 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %9, i8* %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
br label %3
12: ; preds = %3
ret void
}
/* Variables and functions */
int errno;
extern int sched_get_priority_max(int policy) {
  if (policy != 0 && policy != 1 && policy != 2) {
    (void)(errno = (7655));
    return -1;
  }
  return ((policy) != 0 ? 99 : 0);
}


x86 assembly (clang, -O0):
<sched_get_priority_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113e <sched_get_priority_max+0x3e>
cmpl   $0x1,-0x8(%rbp)
je     113e <sched_get_priority_max+0x3e>
cmpl   $0x2,-0x8(%rbp)
je     113e <sched_get_priority_max+0x3e>
mov    0x2eb4(%rip),%rax
movl   $0x1de7,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <sched_get_priority_max+0x51>
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x63,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_get_priority_max>:
cmp    $0x3,%edi
jb     1118 <sched_get_priority_max+0x18>
mov    0x2ed4(%rip),%rax
movl   $0x1de7,(%rax)
mov    $0xffffffff,%eax
ret
test   %edi,%edi
mov    $0x63,%eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @sched_get_priority_max(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 7655, i32* @errno
store i32 -1, i32* %2
br label %18
13: ; preds = %9, %6, %1
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 99, i32 0
store i32 %17, i32* %2
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @sched_get_priority_max(i32 %0) {
%2 = icmp ugt i32 %0, 2
br i1 %2, label %3, label %4
3: ; preds = %1
store i32 7655, i32* @errno
br label %7
4: ; preds = %1
%5 = icmp eq i32 %0, 0
%6 = select i1 %5, i32 0, i32 99
br label %7
7: ; preds = %4, %3
%8 = phi i32 [ -1, %3 ], [ %6, %4 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int /*<<< orphan*/);
char is_string_blank(char *s) {
  while (*s != '\0')
    if (!isspace(*s++))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_string_blank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <is_string_blank+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1155 <is_string_blank+0x45>
movb   $0x0,-0x1(%rbp)
jmp    115e <is_string_blank+0x4e>
jmp    111c <is_string_blank+0xc>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_string_blank>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
test   %edi,%edi
je     1138 <is_string_blank+0x28>
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %eax,%eax
jne    1120 <is_string_blank+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%al
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @is_string_blank(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = sext i8 %4 to i32
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = tail call i32 @isspace(i32 %7)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %2, %6
%12 = phi i8 [ 0, %6 ], [ 1, %2 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ platform_delay(int const);
int /*<<< orphan*/ platform_gpio_set_high();
int /*<<< orphan*/ platform_gpio_set_low();
void _transmit_to_gpio(const unsigned char bit, const int delay) {
  if (bit == 1) {
    platform_gpio_set_high();
  } else {
    platform_gpio_set_low();
  }
  platform_delay(delay);
}


x86 assembly (clang, -O0):
<_transmit_to_gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    115a <_transmit_to_gpio+0x2a>
mov    $0x0,%al
call   1040 <platform_gpio_set_high@plt>
jmp    1161 <_transmit_to_gpio+0x31>
mov    $0x0,%al
call   1050 <platform_gpio_set_low@plt>
mov    -0x8(%rbp),%edi
call   1030 <platform_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_transmit_to_gpio>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
cmp    $0x1,%dil
jne    1142 <_transmit_to_gpio+0x12>
call   1040 <platform_gpio_set_high@plt>
jmp    1147 <_transmit_to_gpio+0x17>
call   1050 <platform_gpio_set_low@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <platform_delay@plt>

LLVM IR (-O0):
define void @_transmit_to_gpio(i8 zeroext %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 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @platform_gpio_set_high()
br label %12
10: ; preds = %2
%11 = call i32 (...) @platform_gpio_set_low()
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %4
%14 = call i32 @platform_delay(i32 %13)
ret void
}

LLVM IR (-O2):
define void @_transmit_to_gpio(i8 zeroext %0, i32 %1) {
%3 = icmp eq i8 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @platform_gpio_set_high()
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @platform_gpio_set_low()
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @platform_delay(i32 %1)
ret void
}