xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ arm_arith_add(int /*<<< orphan*/, int);
int /*<<< orphan*/ arm_data_regi_op();
void arm_adc_regi() { arm_arith_add(arm_data_regi_op(), 1); }


x86 assembly (clang, -O0):
<arm_adc_regi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_data_regi_op@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <arm_arith_add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_adc_regi>:
push   %rax
xor    %eax,%eax
call   1040 <arm_data_regi_op@plt>
mov    %eax,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <arm_arith_add@plt>

LLVM IR (-O0):
define void @arm_adc_regi() {
%1 = call i32 (...) @arm_data_regi_op()
%2 = call i32 @arm_arith_add(i32 %1, i32 1)
ret void
}

LLVM IR (-O2):
define void @arm_adc_regi() {
%1 = tail call i32 (...) @arm_data_regi_op()
%2 = tail call i32 @arm_arith_add(i32 %1, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ test_tx(int /*<<< orphan*/ *, int);
void test_tx_s(const char *data, int len) { test_tx((uint8_t *)data, len); }


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

x86 assembly (clang, -O2):
<test_tx_s>:
jmp    1030 <test_tx@plt>

LLVM IR (-O0):
define void @test_tx_s(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
%8 = call i32 @test_tx(i32* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @test_tx_s(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @test_tx(i32* %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpenCOM(int, char *);
int OpenCOMEx(char *port_zstr) {
  int portnum;
  if (port_zstr[0] == '0') {
    portnum = 0;
  } else {
    portnum = 1;
  }
  if (!OpenCOM(portnum, port_zstr)) {
    return -1;
  }
  return portnum;
}


x86 assembly (clang, -O0):
<OpenCOMEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1138 <OpenCOMEx+0x28>
movl   $0x0,-0x14(%rbp)
jmp    113f <OpenCOMEx+0x2f>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <OpenCOM@plt>
cmp    $0x0,%eax
jne    1160 <OpenCOMEx+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <OpenCOMEx+0x56>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenCOMEx>:
push   %rbx
mov    %rdi,%rsi
xor    %ebx,%ebx
cmpb   $0x30,(%rdi)
setne  %bl
mov    %ebx,%edi
call   1030 <OpenCOM@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
or     %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @OpenCOMEx(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 48
%4 = zext i1 %3 to i32
%5 = tail call i32 @OpenCOM(i32 %4, i8* %0)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 -1, i32 %4
ret i32 %7
}
int no_of_digits(int no) {
  int c = 0;
  while (no > 0) {
    no = no / 10;
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<no_of_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <no_of_digits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <no_of_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_of_digits>:
xor    %eax,%eax
test   %edi,%edi
jle    1124 <no_of_digits+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <no_of_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @no_of_digits(i32 %0) {
%2 = icmp sgt i32 %0, 0
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 = udiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cintern(char *);
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/, struct obj *);
void init_tar_version(void) {
  setvar(cintern("*tar-version*"),
         cintern("$Id: tar.c,v 1.3 1997/04/28 21:03:02 gjc Exp $"),
         ((struct obj *)0));
}


x86 assembly (clang, -O0):
<init_tar_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,-0x4(%rbp)
lea    0xed0(%rip),%rdi
call   1040 <cintern@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_tar_version>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,%ebx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <setvar@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [14 x i8] c"*tar-version*\00"
@.str.1 = [47 x i8] c"$Id: tar.c,v 1.3 1997/04/28 21:03:02 gjc Exp $\00"
define void @init_tar_version() {
%1 = call i32 @cintern(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cintern(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [14 x i8] c"*tar-version*\00"
@.str.1 = [47 x i8] c"$Id: tar.c,v 1.3 1997/04/28 21:03:02 gjc Exp $\00"
define void @init_tar_version() {
%1 = tail call i32 @cintern(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cintern(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}
/* Variables and functions */
int dxl_hal_isOpen();
int dxl_connected() { return dxl_hal_isOpen(); }


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

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

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

LLVM IR (-O2):
define i32 @dxl_connected() {
%1 = tail call i32 (...) @dxl_hal_isOpen()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  unsigned int i, j;
  double d;
  i = 100.0;
  d = i;
  j = d;
  assert(j == 100);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%rax
mov    %eax,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 100, i32* %1
%4 = load i32, i32* %1
%5 = uitofp i32 %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = fptoui double %6 to i32
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 100
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
void INT_Excep_TPU5_TCI5U(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU5_TCI5U() {
ret void
}
/* Variables and functions */
int annotated_inc_1_2(int);
int annotated_inc_2_1(int);
int annotated_inc_2_2(int);
int annotated_inc_1_1(int i) {
  int j = 1;
  j = annotated_inc_1_2(j);
  j = annotated_inc_2_1(j);
  j = annotated_inc_2_2(j);
  return ++i;
}


x86 assembly (clang, -O0):
<annotated_inc_1_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <annotated_inc_1_2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <annotated_inc_2_1@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <annotated_inc_2_2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<annotated_inc_1_1>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1050 <annotated_inc_1_2@plt>
mov    %eax,%edi
call   1030 <annotated_inc_2_1@plt>
mov    %eax,%edi
call   1040 <annotated_inc_2_2@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @annotated_inc_1_1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @annotated_inc_1_2(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @annotated_inc_2_1(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @annotated_inc_2_2(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @annotated_inc_1_1(i32 %0) {
%2 = tail call i32 @annotated_inc_1_2(i32 1)
%3 = tail call i32 @annotated_inc_2_1(i32 %2)
%4 = tail call i32 @annotated_inc_2_2(i32 %3)
%5 = add nsw i32 %0, 1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ glob_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int glob(const char *pattern, int flags,
         int (*errfunc)(const char *epath, int eerrno), glob_t *pglob) {
  if (errfunc)
    errfunc((void *)0, ENOSYS);
  return 0;
}


x86 assembly (clang, -O0):
<glob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1135 <glob+0x35>
mov    -0x18(%rbp),%rax
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%esi
xor    %ecx,%ecx
mov    %ecx,%edi
call   *%rax
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glob>:
test   %rdx,%rdx
je     1117 <glob+0x17>
push   %rax
mov    0x2edb(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   *%rdx
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @glob(i8* nocapture readnone %0, i32 %1, i32 (i8*, i32)* %2, i32* nocapture readnone %3) {
%5 = icmp eq i32 (i8*, i32)* %2, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = load i32, i32* @ENOSYS
%8 = tail call i32 %2(i8* null, i32 %7)
br label %9
9: ; preds = %6, %4
ret i32 0
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7UL;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 116737752064UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%rax
jae    115d <RandomFunc+0x5d>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1129 <RandomFunc+0x29>
movabs $0x1b2e1cbc00,%rcx
and    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
and    $0x36042968,%eax
shl    $0x7,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = and i64 %9, 914778474
%11 = shl i64 %10, 7
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %19, %2
%14 = load i64, i64* %6
%15 = load i64*, i64** %3
%16 = getelementptr inbounds i64, i64* %15, i64 1
%17 = load i64, i64* %16
%18 = icmp ult i64 %14, %17
br i1 %18, label %19, label %28
19: ; preds = %13
%20 = load i64, i64* %6
%21 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %20
%22 = load i64, i64* %21
%23 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%24 = load i64, i64* %23
%25 = and i64 %24, %22
store i64 %25, i64* %23
%26 = load i64, i64* %6
%27 = add i64 %26, 1
store i64 %27, i64* %6
br label %13
28: ; preds = %13
%29 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%30 = load i64, i64* %29
%31 = and i64 %30, 116737752064
%32 = load i64*, i64** %4
%33 = getelementptr inbounds i64, i64* %32, i64 0
store i64 %31, i64* %33
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 7
%5 = and i64 %4, 115999028224
store i64 %5, i64* %1
ret void
}
void mycpy(const char *source, char *dest) {
  int i = 0;
  while (source[i] != '\0')
    dest[i++] = source[i];
  dest[i] = 0;
}


x86 assembly (clang, -O0):
<mycpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114d <mycpy+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1113 <mycpy+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycpy>:
mov    (%rdi),%al
test   %al,%al
je     1127 <mycpy+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rsi,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <mycpy+0x10>
mov    %ecx,%eax
movb   $0x0,(%rsi,%rax,1)
ret
xor    %eax,%eax
movb   $0x0,(%rsi,%rax,1)
ret

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

LLVM IR (-O2):
define void @mycpy(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = add nuw nsw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %7, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %8, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %1, i64 %16
store i8 0, i8* %17
ret void
}
void RTTimeNanoTSLFenceAsync(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeNanoTSLFenceAsync() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int *);
int main(int argc, char *argv[]) {
  char c = 'a';
  int i = 0xFFFEFDFC;
  printf("c: %p, i: %p\n", &c, &i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x61,-0x11(%rbp)
movl   $0xfffefdfc,-0x18(%rbp)
lea    0xec8(%rip),%rdi
lea    -0x11(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x61,0x3(%rsp)
movl   $0xfffefdfc,0x4(%rsp)
ff
lea    0xedb(%rip),%rdi
lea    0x3(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"c: %p, i: %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 97, i8* %6
store i32 -66052, i32* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %6, i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"c: %p, i: %p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = alloca i32
store i8 97, i8* %3
%5 = bitcast i32* %4 to i8*
store i32 -66052, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void out_of_memory(void) {
  fprintf(stderr, "Out of memory\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<out_of_memory>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define void @out_of_memory() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define void @out_of_memory() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t lo_validate_string(void *, size_t);
char *lo_get_path(void *data, size_t size) {
  size_t result = lo_validate_string(data, size);
  return (result >= 4) ? (char *)data : NULL;
}


x86 assembly (clang, -O0):
<lo_get_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <lo_validate_string@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x4,-0x18(%rbp)
jb     1149 <lo_get_path+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1154 <lo_get_path+0x44>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1154 <lo_get_path+0x44>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lo_get_path>:
push   %rbx
mov    %rdi,%rbx
call   1030 <lo_validate_string@plt>
xor    %ecx,%ecx
cmp    $0x4,%rax
cmovae %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @lo_get_path(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i64 @lo_validate_string(i8* %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp uge i64 %9, 4
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %3
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %11
%15 = phi i8* [ %12, %11 ], [ null, %13 ]
ret i8* %15
}

LLVM IR (-O2):
define i8* @lo_get_path(i8* %0, i64 %1) {
%3 = tail call i64 @lo_validate_string(i8* %0, i64 %1)
%4 = icmp ugt i64 %3, 3
%5 = select i1 %4, i8* %0, i8* null
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xce() {
  Assert_real((isspace(206) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1035, ("isspace should be 0 for 0xce"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xce\00"
define void @t_isspace_0xce() {
%1 = tail call i64 @isspace(i32 206)
%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 1035, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  unsigned int i = 1;
  char *x = (char *)&i;
  if (*x) {
    printf("Little Endian\n");
  } else {
    printf("Big Endian\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <main+0x43>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    115f <main+0x4f>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"Little Endian\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int dict_key_cmp_int(void *key1, void *key2) {
  return (uintptr_t)key1 - (uintptr_t)key2;
}


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

x86 assembly (clang, -O2):
<dict_key_cmp_int>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @dict_key_cmp_int(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 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = sub i64 %6, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @dict_key_cmp_int(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_setb_c(struct em8051 *aCPU, int aPosition, char *aBuffer) {
  sprintf(aBuffer, "SETB  C");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_setb_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_setb_c>:
movabs $0x43202042544553,%rax
mov    %rax,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [8 x i8] c"SETB C\00"
define i32 @disasm_setb_c(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
define i32 @disasm_setb_c(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %2 to i64*
store i64 18894146363475283, i64* %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x85() {
  Assert_real((isgraph(133) == 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_isgraph.c",
              670, ("isgraph should be 0 for 0x85"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x85>:
push   %rax
mov    $0x85,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x29e,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x85\00"
define void @t_isgraph_0x85() {
%1 = call i64 @isgraph(i32 133)
%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 670, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x85\00"
define void @t_isgraph_0x85() {
%1 = tail call i64 @isgraph(i32 133)
%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 670, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ScaleRowDown38_3_Box_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown38_3_Box_Any_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int NGROUPS_MAX;
int /*<<< orphan*/ _getgrouplist(char const *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, int *);
int initgroups(const char *user, gid_t group) {
  int n = NGROUPS_MAX;
  gid_t grouplist[NGROUPS_MAX];
  _getgrouplist(user, group, grouplist, &n);
  return 0;
}


x86 assembly (clang, -O0):
<initgroups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%ecx
mov    %ecx,-0x10(%rbp)
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rcx
call   1030 <_getgrouplist@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initgroups>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rsp,%rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    %rsp,%rdx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdx
mov    %rdx,%rsp
lea    -0xc(%rbp),%rcx
call   1030 <_getgrouplist@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@NGROUPS_MAX = global i32 0
define i32 @initgroups(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* @NGROUPS_MAX
store i32 %8, i32* %5
%9 = load i32, i32* @NGROUPS_MAX
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %6
%12 = alloca i32, i64 %10
store i64 %10, i64* %7
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @_getgrouplist(i8* %13, i32 %14, i32* %12, i32* %5)
%16 = load i8*, i8** %6
ret i32 0
}

LLVM IR (-O2):
@NGROUPS_MAX = global i32 0
define i32 @initgroups(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @NGROUPS_MAX
store i32 %5, i32* %3
%6 = zext i32 %5 to i64
%7 = tail call i8* @llvm.stacksave()
%8 = alloca i32, i64 %6
%9 = call i32 @_getgrouplist(i8* %0, i32 %1, i32* %8, i32* %3)
ret i32 0
}
int my_char_is_print(char c) {
  if (!(c > 32 && c <= 126))
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<my_char_is_print>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jle    1124 <my_char_is_print+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
jle    1130 <my_char_is_print+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1137 <my_char_is_print+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_char_is_print>:
add    $0xdf,%dil
xor    %eax,%eax
cmp    $0x5e,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @my_char_is_print(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 sgt i32 %5, 32
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 126
br i1 %10, label %12, label %11
11: ; preds = %7, %1
store i32 0, i32* %2
br label %13
12: ; preds = %7
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @my_char_is_print(i8 signext %0) {
%2 = add i8 %0, -33
%3 = icmp ult i8 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int pread(int, unsigned long long *, int, int);
unsigned long long rapl_get_msr(int fd_msr, int offset) {
  unsigned long long buf;
  if (pread(fd_msr, &buf, sizeof(buf), offset) != sizeof(buf)) {
    perror("msr read failed");
    buf = 0;
  }
  return buf;
}


x86 assembly (clang, -O0):
<rapl_get_msr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <pread@plt>
cltq
cmp    $0x8,%rax
je     1162 <rapl_get_msr+0x42>
lea    0xeab(%rip),%rdi
call   1030 <perror@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_get_msr>:
push   %rax
mov    %esi,%ecx
mov    %rsp,%rsi
mov    $0x8,%edx
call   1040 <pread@plt>
cmp    $0x8,%eax
jne    113b <rapl_get_msr+0x1b>
mov    (%rsp),%rax
pop    %rcx
ret
lea    0xebe(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"msr read failed\00"
define i64 @rapl_get_msr(i32 %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @pread(i32 %0, i64* %3, i32 8, i32 %1)
%6 = icmp eq i32 %5, 8
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* %3
br label %11
9: ; preds = %2
%10 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %7, %9
%12 = phi i64 [ %8, %7 ], [ 0, %9 ]
ret i64 %12
}
/* Variables and functions */
int core4_swap(char *, int);
int U_EMRFILLPATH_swap(char *record, int torev) {
  return (core4_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRFILLPATH_swap>:
jmp    1030 <core4_swap@plt>

LLVM IR (-O0):
define i32 @U_EMRFILLPATH_swap(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 @core4_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRFILLPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *expath(char *, int);
int strlen(char *);
char *path(char *name, int flag) {
  char *p, *last;
  p = expath(name, flag);
  last = p + strlen(p) - 1;
  if (last > p && *last == '/')
    *last = '\0';
  return p;
}


x86 assembly (clang, -O0):
<path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <expath@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1189 <path+0x69>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1189 <path+0x69>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path>:
push   %rbx
call   1040 <expath@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jbe    1147 <path+0x27>
cmpb   $0x2f,(%rax)
jne    1147 <path+0x27>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @path(i8* %0, i32 %1) {
%3 = tail call i8* @expath(i8* %0, i32 %1)
%4 = tail call i32 @strlen(i8* %3)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = icmp ugt i8* %7, %3
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 47
br i1 %11, label %12, label %13
12: ; preds = %9
store i8 0, i8* %7
br label %13
13: ; preds = %12, %9, %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int, unsigned long, void **,
                       int const *, int *, int);
long shim_move_pages(int pid, unsigned long count, void **pages,
                     const int *nodes, int *status, int flags) {
  return (long)shim_enosys(0, pid, count, pages, nodes, status, flags);
}


x86 assembly (clang, -O0):
<shim_move_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
xor    %edi,%edi
mov    %eax,(%rsp)
call   1030 <shim_enosys@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_move_pages>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    %r9d,(%rsp)
xor    %edi,%edi
mov    %rax,%r9
call   1030 <shim_enosys@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @shim_move_pages(i32 %0, i64 %1, i8** %2, i32* %3, i32* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8**
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
store i32 %0, i32* %7
store i64 %1, i64* %8
store i8** %2, i8*** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i64, i64* %8
%15 = load i8**, i8*** %9
%16 = load i32*, i32** %10
%17 = load i32*, i32** %11
%18 = load i32, i32* %12
%19 = call i64 @shim_enosys(i32 0, i32 %13, i64 %14, i8** %15, i32* %16, i32* %17, i32 %18)
ret i64 %19
}

LLVM IR (-O2):
define i64 @shim_move_pages(i32 %0, i64 %1, i8** %2, i32* %3, i32* %4, i32 %5) {
%7 = tail call i64 @shim_enosys(i32 0, i32 %0, i64 %1, i8** %2, i32* %3, i32* %4, i32 %5)
ret i64 %7
}
void do_bar() {
  int i;
  ;
  for (i = 0; i < 7; i++) {
    ;
  };
}


x86 assembly (clang, -O0):
<do_bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jge    1128 <do_bar+0x28>
jmp    111a <do_bar+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <do_bar+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_bar() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 7
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @do_bar() {
ret void
}
/* Variables and functions */
size_t b642bin_output_len(size_t in) { return ((in + 3) / 4) * 3; }


x86 assembly (clang, -O0):
<b642bin_output_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
shr    $0x2,%rax
imul   $0x3,%rax,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b642bin_output_len>:
add    $0x3,%rdi
shr    $0x2,%rdi
lea    (%rdi,%rdi,2),%rax
ret

LLVM IR (-O0):
define i64 @b642bin_output_len(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 3
%5 = udiv i64 %4, 4
%6 = mul i64 %5, 3
ret i64 %6
}

LLVM IR (-O2):
define i64 @b642bin_output_len(i64 %0) {
%2 = add i64 %0, 3
%3 = lshr i64 %2, 2
%4 = mul nuw i64 %3, 3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ fn_a(int);
int fn_ab(int, int);
int /*<<< orphan*/ fn_b(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
main() {
  int a = 10, b = 20;
  fn_a(a);
  fn_b(b);
  printf("a+b = %d\n", fn_ab(a, b));
  printf("\nPress any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <fn_a@plt>
mov    -0x8(%rbp),%edi
call   1030 <fn_b@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1070 <fn_ab@plt>
mov    %eax,%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1060 <fn_a@plt>
mov    $0x14,%edi
call   1030 <fn_b@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1070 <fn_ab@plt>
lea    0xe85(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"a+b = %d\0A\00"
@.str.1 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 20, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @fn_a(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @fn_b(i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @fn_ab(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"a+b = %d\0A\00"
@.str.1 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = tail call i32 @fn_a(i32 10)
%2 = tail call i32 @fn_b(i32 20)
%3 = tail call i32 @fn_ab(i32 10, i32 20)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
char *carmen_next_word(char *);
__attribute__((gnu_)) char *carmen_next_n_words(char *str, int n) {
  int i;
  char *result;
  result = str;
  for (i = 0; i < n; i++)
    result = carmen_next_word(result);
  return result;
}


x86 assembly (clang, -O0):
<carmen_next_n_words>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1155 <carmen_next_n_words+0x45>
mov    -0x18(%rbp),%rdi
call   1030 <carmen_next_word@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112e <carmen_next_n_words+0x1e>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_next_n_words>:
push   %rbx
mov    %rdi,%rax
test   %esi,%esi
jle    112d <carmen_next_n_words+0x1d>
mov    %esi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <carmen_next_word@plt>
add    $0xffffffff,%ebx
jne    1120 <carmen_next_n_words+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @carmen_next_n_words(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i8* [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %8, %4 ], [ 0, %2 ]
%7 = tail call i8* @carmen_next_word(i8* %5)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i8* [ %0, %2 ], [ %7, %4 ]
ret i8* %11
}