xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_help() {
  fprintf(
      stderr,
      "wrapper [-o <outfile>] <infiles>\n"
      "  Generates a file with the input files wrapped into a C array.\n\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [99 x i8] c"wrapper [-o <outfile>] <infiles>\0A Generates a file with the input files wrapped into a C array.\0A\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [99 x i8] c"wrapper [-o <outfile>] <infiles>\0A Generates a file with the input files wrapped into a C array.\0A\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int xstat(const char *pathname, struct stat *buf) {
  int ret = stat(pathname, buf);
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xstat>:
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 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    113f <xstat+0x2f>
jmp    113f <xstat+0x2f>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstat>:
jmp    1030 <stat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @xstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 @stat(i8* %6, %struct.stat* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @xstat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ buttressed_foundation(double, double, double, int, double);
void keep_foundation(double width, double length, double height) {
  buttressed_foundation(width, length, height, 8, length / 6.0);
}


x86 assembly (clang, -O0):
<keep_foundation>:
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
movsd  -0x10(%rbp),%xmm3
movsd  0xebd(%rip),%xmm4
divsd  %xmm4,%xmm3
mov    $0x8,%edi
call   1030 <buttressed_foundation@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keep_foundation>:
movapd %xmm1,%xmm3
divsd  0xee4(%rip),%xmm3
mov    $0x8,%edi
jmp    1030 <buttressed_foundation@plt>

LLVM IR (-O0):
define void @keep_foundation(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 = load double, double* %5
%11 = fdiv double %10, 6.000000e+00
%12 = call i32 @buttressed_foundation(double %7, double %8, double %9, i32 8, double %11)
ret void
}

LLVM IR (-O2):
define void @keep_foundation(double %0, double %1, double %2) {
%4 = fdiv double %1, 6.000000e+00
%5 = tail call i32 @buttressed_foundation(double %0, double %1, double %2, i32 8, double %4)
ret void
}
int waitForSound() {
  int (*func)(void) = (int (*)(void))0x080A38BD;
  return func();
}


x86 assembly (clang, -O0):
<waitForSound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80a38bd,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForSound>:
mov    $0x80a38bd,%eax
jmp    *%rax

LLVM IR (-O0):
define i32 @waitForSound() {
%1 = alloca i32 ()*
store i32 ()* inttoptr (i64 134887613 to i32 ()*), i32 ()** %1
%2 = load i32 ()*, i32 ()** %1
%3 = call i32 %2()
ret i32 %3
}

LLVM IR (-O2):
define i32 @waitForSound() {
%1 = tail call i32 inttoptr (i64 134887613 to i32 ()*)()
ret i32 %1
}
/* Variables and functions */
char const *ngettext(char const *, char const *, unsigned long);
__attribute__((format_arg(1))) __attribute__((format_arg(2))) const char *
Q_(const char *msgid, const char *plu, unsigned long n) {
  if (0)
    return "# GETTEXT POISON #";
  return ngettext(msgid, plu, n);
}


x86 assembly (clang, -O0):
<Q_>:
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 <ngettext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_>:
jmp    1030 <ngettext@plt>

LLVM IR (-O0):
define i8* @Q_(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 i8* @ngettext(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @Q_(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @ngettext(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
double sqrt(double x) { return __builtin_sqrt(x); }


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

x86 assembly (clang, -O2):
<sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     1110 <sqrt+0x10>
ret
nopl   0x0(%rax,%rax,1)
jmp    1110 <sqrt+0x10>

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

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret double undef
}
int swap(int *n1, int *n2) {
  int aux;
  aux = *n1;
  *n1 = *n2;
  *n2 = aux;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %6
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 undef
}
/* Variables and functions */
void move_zeroes(int *, int);
void moveZeroes(int *nums, int numsSize) { return move_zeroes(nums, numsSize); }


x86 assembly (clang, -O0):
<moveZeroes>:
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 <move_zeroes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveZeroes>:
jmp    1030 <move_zeroes@plt>

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

LLVM IR (-O2):
define void @moveZeroes(i32* %0, i32 %1) {
tail call void @move_zeroes(i32* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __bswap_32(int /*<<< orphan*/);
size_t fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
size_t FR_fread_b32(uint32_t *dest, FILE *file) {
  size_t result = fread(dest, 4, 1, file);
  *dest = __bswap_32(*dest);
  return result;
}


x86 assembly (clang, -O0):
<FR_fread_b32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <__bswap_32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FR_fread_b32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %rax,%r14
mov    (%rbx),%edi
call   1040 <__bswap_32@plt>
mov    %eax,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @FR_fread_b32(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 i64 @fread(i32* %6, i32 4, i32 1, i32* %7)
store i64 %8, i64* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @__bswap_32(i32 %10)
%12 = load i32*, i32** %3
store i32 %11, i32* %12
%13 = load i64, i64* %5
ret i64 %13
}

LLVM IR (-O2):
define i64 @FR_fread_b32(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fread(i32* %0, i32 4, i32 1, i32* %1)
%4 = load i32, i32* %0
%5 = tail call i32 @__bswap_32(i32 %4)
store i32 %5, i32* %0
ret i64 %3
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int l2tp_session_profile_list_1_svc(void *, struct svc_req *);
int _l2tp_session_profile_list_1(void *argp, void *result,
                                 struct svc_req *rqstp) {
  return (l2tp_session_profile_list_1_svc(result, rqstp));
}


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

x86 assembly (clang, -O2):
<_l2tp_session_profile_list_1>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <l2tp_session_profile_list_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_l2tp_session_profile_list_1(i8* %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i8*, i8** %5
%8 = load %struct.svc_req*, %struct.svc_req** %6
%9 = call i32 @l2tp_session_profile_list_1_svc(i8* %7, %struct.svc_req* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_l2tp_session_profile_list_1(i8* nocapture readnone %0, i8* %1, %struct.svc_req* %2) {
%4 = tail call i32 @l2tp_session_profile_list_1_svc(i8* %1, %struct.svc_req* %2)
ret i32 %4
}
void inicializar(int *v, int val) {
  int i;
  for (i = 0; i < 10; i++)
    v[i] = val;
}


x86 assembly (clang, -O0):
<inicializar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1138 <inicializar+0x38>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <inicializar+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicializar>:
movd   %esi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqu %xmm0,(%rdi)
movdqu %xmm0,0x10(%rdi)
mov    %esi,0x20(%rdi)
mov    %esi,0x24(%rdi)
ret

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

LLVM IR (-O2):
define void @inicializar(i32* nocapture writeonly %0, i32 %1) {
%3 = insertelement <4 x i32> poison, i32 %1, i64 0
%4 = shufflevector <4 x i32> %3, <4 x i32> poison, <4 x i32> zeroinitializer
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %0, i64 8
store i32 %1, i32* %8
%9 = getelementptr inbounds i32, i32* %0, i64 9
store i32 %1, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_help(const char *command_name) {
  printf("Usage: %s --test-case <test_name>\n", command_name);
}


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: %s --test-case <test_name>\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Usage: %s --test-case <test_name>\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int check_dir(char *);
int wrap_detect_psi(struct activity *a) {
  return (check_dir(""
                    "/proc/pressure"));
}


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

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

LLVM IR (-O0):
%struct.activity = type { i32 }
@.str = [15 x i8] c"/proc/pressure\00"
define i32 @wrap_detect_psi(%struct.activity* %0) {
%2 = alloca %struct.activity*
store %struct.activity* %0, %struct.activity** %2
%3 = call i32 @check_dir(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}

LLVM IR (-O2):
%struct.activity = type { i32 }
@.str = [15 x i8] c"/proc/pressure\00"
define i32 @wrap_detect_psi(%struct.activity* nocapture readnone %0) {
%2 = tail call i32 @check_dir(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int const uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t s291_get_sdid(const uint16_t *p_s291) { return p_s291[4] & 0xff; }


x86 assembly (clang, -O0):
<s291_get_sdid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s291_get_sdid>:
movzbl 0x10(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @s291_get_sdid(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
ret i32 %6
}

LLVM IR (-O2):
define i32 @s291_get_sdid(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xb4() {
  Assert_real((isalpha(180) == 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_isalpha.c",
              905, ("isalpha should be 0 for 0xb4"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xb4>:
push   %rax
mov    $0xb4,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x389,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xb4\00"
define void @t_isalpha_0xb4() {
%1 = call i64 @isalpha(i32 180)
%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 905, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xb4\00"
define void @t_isalpha_0xb4() {
%1 = tail call i64 @isalpha(i32 180)
%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 905, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int read_byte(FILE *fin) {
  int i;
  i = fgetc(fin);
  if (i == EOF) {
    printf("unexpected end of file\n");
    exit(-1);
  }
  return i;
}


x86 assembly (clang, -O0):
<read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%eax
jne    1170 <read_byte+0x40>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_byte>:
push   %rax
call   1040 <fgetc@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
je     1143 <read_byte+0x13>
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [24 x i8] c"unexpected end of file\0A\00"
define i32 @read_byte(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i32 0
@str = [23 x i8] c"unexpected end of file\00"
define i32 @read_byte(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
int ffs(int i) {
  StubBug("STUB:"
          "ffs");
  return -1;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <StubBug@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <StubBug@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"STUB:ffs\00"
define i32 @ffs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @StubBug(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [9 x i8] c"STUB:ffs\00"
define i32 @ffs(i32 %0) {
%2 = tail call i32 @StubBug(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void check_error(const int retval, const char *errmsg) {
  if (retval != 0) {
    fputs(errmsg, stderr);
    fputc('\n', stderr);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<check_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1178 <check_error+0x48>
mov    -0x10(%rbp),%rdi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_error>:
test   %edi,%edi
jne    1135 <check_error+0x5>
ret
push   %rbx
mov    0x2ea3(%rip),%rbx
mov    (%rbx),%eax
mov    %rsi,%rdi
mov    %eax,%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @check_error(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* %8, i32 %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fputc(i8 signext 10, i32 %11)
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @check_error(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* %1, i32 %5)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputc(i8 signext 10, i32 %7)
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
ret void
}
void rop3_144_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_144_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_144_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_144_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_144_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
unsigned char msg_send(unsigned char, unsigned char *, int);
unsigned char msg_send2(unsigned char mesg, unsigned char data1,
                        unsigned char data2) {
  unsigned char buf[2];
  buf[0] = data1;
  buf[1] = data2;
  return msg_send(mesg, buf, 2);
}


x86 assembly (clang, -O0):
<msg_send2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x4(%rbp)
mov    -0x1(%rbp),%al
lea    -0x5(%rbp),%rsi
mov    $0x2,%edx
movzbl %al,%edi
call   1030 <msg_send@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_send2>:
push   %rax
mov    %sil,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <msg_send@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @msg_send2(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca [2 x i8]
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 %8, i8* %9
%10 = load i8, i8* %6
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 %10, i8* %11
%12 = load i8, i8* %4
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%14 = call zeroext i8 @msg_send(i8 zeroext %12, i8* %13, i32 2)
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @msg_send2(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 %1, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %2, i8* %6
%7 = call zeroext i8 @msg_send(i8 zeroext %0, i8* %5, i32 2)
ret i8 %7
}
int test_imm_D9int8_mem(signed char *val) {
  return ((*val) & (-0xD9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D9int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff27,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D9int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff27,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D9int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -217
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
void ql_dump_ets_regs(struct ql_adapter *qdev) {}


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

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

LLVM IR (-O0):
%struct.ql_adapter = type opaque
define void @ql_dump_ets_regs(%struct.ql_adapter* %0) {
%2 = alloca %struct.ql_adapter*
store %struct.ql_adapter* %0, %struct.ql_adapter** %2
ret void
}

LLVM IR (-O2):
%struct.ql_adapter = type opaque
define void @ql_dump_ets_regs(%struct.ql_adapter* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *ethernet_dstaddr(uint8_t *p_ethernet) { return p_ethernet; }


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

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

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

LLVM IR (-O2):
define i32* @ethernet_dstaddr(i32* readnone returned %0) {
ret i32* %0
}
float decode_temperature(unsigned char t) { return (t * 40.0 / 256.0 - 4.0); }


x86 assembly (clang, -O0):
<decode_temperature>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xef6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_temperature>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @decode_temperature(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 4.000000e+01
%7 = fdiv double %6, 2.560000e+02
%8 = fsub double %7, 4.000000e+00
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @decode_temperature(i8 zeroext %0) {
%2 = uitofp i8 %0 to double
%3 = fmul double %2, 4.000000e+01
%4 = fmul double %3, 3.906250e-03
%5 = fadd double %4, -4.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
char *binary(unsigned long long n) {
  static char str[sizeof(n) * 8 + 1];
  int pos = sizeof(str) - 1;
  do {
    str[pos] = (n & 1) + '0';
    n >>= 1;
    pos--;
  } while (n);
  return str + pos + 1;
}


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x40,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
add    $0x30,%rax
mov    %al,%dl
movslq -0xc(%rbp),%rcx
lea    0x2f08(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    110f <binary+0xf>
movslq -0xc(%rbp),%rcx
lea    0x2eda(%rip),%rax
add    %rcx,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
lea    0x2f6a(%rip),%rax
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%dl
or     $0x30,%dl
mov    %dl,-0x1(%rax)
add    $0xffffffffffffffff,%rax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <binary+0x10>
ret

LLVM IR (-O0):
@binary.str = internal global [65 x i8] zeroinitializer
define i8* @binary(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 64, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i64, i64* %2
%6 = and i64 %5, 1
%7 = add i64 %6, 48
%8 = trunc i64 %7 to i8
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [65 x i8], [65 x i8]* @binary.str, i64 0, i64 %10
store i8 %8, i8* %11
%12 = load i64, i64* %2
%13 = lshr i64 %12, 1
store i64 %13, i64* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, -1
store i32 %15, i32* %3
br label %16
16: ; preds = %4
%17 = load i64, i64* %2
%18 = icmp ne i64 %17, 0
br i1 %18, label %4, label %19
19: ; preds = %16
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @binary.str, i64 0, i64 0), i64 %21
%23 = getelementptr inbounds i8, i8* %22, i64 1
ret i8* %23
}

LLVM IR (-O2):
@binary.str = internal global [65 x i8] zeroinitializer
define i8* @binary(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %10, %2 ], [ 64, %1 ]
%4 = phi i64 [ %9, %2 ], [ %0, %1 ]
%5 = trunc i64 %4 to i8
%6 = and i8 %5, 1
%7 = or i8 %6, 48
%8 = getelementptr inbounds [65 x i8], [65 x i8]* @binary.str, i64 0, i64 %3
store i8 %7, i8* %8
%9 = lshr i64 %4, 1
%10 = add nsw i64 %3, -1
%11 = icmp ult i64 %4, 2
br i1 %11, label %12, label %2
12: ; preds = %2
%13 = shl i64 %10, 32
%14 = ashr exact i64 %13, 32
%15 = getelementptr inbounds [65 x i8], [65 x i8]* @binary.str, i64 0, i64 %14
%16 = getelementptr inbounds i8, i8* %15, i64 1
ret i8* %16
}
OP(op, fe) { CP(ARG()); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <ARG@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <CP@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <ARG@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <CP@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @ARG()
%7 = call i32 (i32, ...) bitcast (i32 (...)* @CP to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @ARG()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @CP to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
void sd_dif_op(struct scsi_cmnd *cmd, unsigned int a, unsigned int b,
               unsigned int c) {}


x86 assembly (clang, -O0):
<sd_dif_op>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.scsi_cmnd = type opaque
define void @sd_dif_op(%struct.scsi_cmnd* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.scsi_cmnd*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.scsi_cmnd* %0, %struct.scsi_cmnd** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.scsi_cmnd = type opaque
define void @sd_dif_op(%struct.scsi_cmnd* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_sysCx();
int /*<<< orphan*/ lose_sysCx();
int /*<<< orphan*/ testfn_BitTable();
int /*<<< orphan*/ testfn_cache_BitTable();
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  init_sysCx();
  testfn_BitTable();
  testfn_cache_BitTable();
  lose_sysCx();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init_sysCx@plt>
mov    $0x0,%al
call   1030 <testfn_BitTable@plt>
mov    $0x0,%al
call   1050 <testfn_cache_BitTable@plt>
mov    $0x0,%al
call   1060 <lose_sysCx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_sysCx@plt>
xor    %eax,%eax
call   1030 <testfn_BitTable@plt>
xor    %eax,%eax
call   1050 <testfn_cache_BitTable@plt>
xor    %eax,%eax
call   1060 <lose_sysCx@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (...) @init_sysCx()
%9 = call i32 (...) @testfn_BitTable()
%10 = call i32 (...) @testfn_cache_BitTable()
%11 = call i32 (...) @lose_sysCx()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_sysCx()
%4 = tail call i32 (...) @testfn_BitTable()
%5 = tail call i32 (...) @testfn_cache_BitTable()
%6 = tail call i32 (...) @lose_sysCx()
ret i32 0
}
int find_node_num(long n, long *acc_num) {
  int i = 0;
  for (; acc_num[i] < n; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<find_node_num>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x8(%rbp),%rax
jge    113c <find_node_num+0x3c>
jmp    112e <find_node_num+0x2e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <find_node_num+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_node_num>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
lea    0x8(%rsi),%rcx
cmp    %rdi,(%rsi)
mov    %rcx,%rsi
jl     1110 <find_node_num+0x10>
ret

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

LLVM IR (-O2):
define i32 @find_node_num(i64 %0, i64* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i64, i64* %1, i64 %4
%6 = load i64, i64* %5
%7 = icmp slt i64 %6, %0
%8 = add nuw i64 %4, 1
br i1 %7, label %3, label %9
9: ; preds = %3
%10 = trunc i64 %4 to i32
ret i32 %10
}
int m(int n, int o) { return o < 0 || o > 1 ? n : o; }


x86 assembly (clang, -O0):
<m>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111e <m+0x1e>
cmpl   $0x1,-0x8(%rbp)
jle    1129 <m+0x29>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112f <m+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m>:
mov    %edi,%eax
cmp    $0x2,%esi
cmovb  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @m(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sum(int *, int);
int main(void) {
  int val = 2;
  int *ptr = &val;
  sum(ptr, 3);
  printf("%d\n", val);
  sum(&val, 10);
  printf("%d\n", val);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <sum@plt>
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <sum@plt>
mov    -0x8(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%r14
mov    %r14,%rdi
mov    $0x3,%esi
call   1040 <sum@plt>
mov    0x4(%rsp),%esi
lea    0xeb7(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <sum@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%3 = call i32 @sum(i32* %1, i32 3)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @sum(i32* %1, i32 10)
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
main() {
  int i = 0;
  while (i < 0)
    printf(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1140 <main+0x30>
movslq -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = call i32 (i8*, ...) @printf(i8* %9)
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
char *strchr(char const *, int);
void print_iface(const char *iface) {
  char *c;
  if ((c = strchr(iface, 1)))
    *c = '+';
  printf("%s ", iface);
  if (c)
    *c = 1;
}


x86 assembly (clang, -O0):
<print_iface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     114f <print_iface+0x2f>
mov    -0x10(%rbp),%rax
movb   $0x2b,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1171 <print_iface+0x51>
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_iface>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1156 <print_iface+0x36>
mov    %rax,%rbx
movb   $0x2b,(%rax)
lea    0xebd(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
movb   $0x1,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xea3(%rip),%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @print_iface(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
store i8 43, i8* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
store i8 1, i8* %2
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
ret void
}
int test_imm_18uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x18 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_18uint64_lowword_reg>:
test   $0x18,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

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

/* Variables and functions */
int dc_peek(struct dc *);
int /*<<< orphan*/ dc_push(struct dc *, int);
void dcf_dup(struct dc *dc, char *cmd) {
  int v = dc_peek(dc);
  dc_push(dc, v);
}


x86 assembly (clang, -O0):
<dcf_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dc_peek@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <dc_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcf_dup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <dc_peek@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <dc_push@plt>

LLVM IR (-O0):
%struct.dc = type { i32 }
define void @dcf_dup(%struct.dc* %0, i8* %1) {
%3 = alloca %struct.dc*
%4 = alloca i8*
%5 = alloca i32
store %struct.dc* %0, %struct.dc** %3
store i8* %1, i8** %4
%6 = load %struct.dc*, %struct.dc** %3
%7 = call i32 @dc_peek(%struct.dc* %6)
store i32 %7, i32* %5
%8 = load %struct.dc*, %struct.dc** %3
%9 = load i32, i32* %5
%10 = call i32 @dc_push(%struct.dc* %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.dc = type { i32 }
define void @dcf_dup(%struct.dc* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @dc_peek(%struct.dc* %0)
%4 = tail call i32 @dc_push(%struct.dc* %0, i32 %3)
ret void
}