xunge/DecIR huggingface dataset:
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR6E_get(void) { return U_WMRCORENONE_get("U_WMR6E"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR6E\00"
define i32 @U_WMR6E_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR6E\00"
define i32 @U_WMR6E_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int insy_fmt_csr_debug_set(unsigned int dev_id,
                           union insy_fmt_csr_debug_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.insy_fmt_csr_debug_u = type opaque
define i32 @insy_fmt_csr_debug_set(i32 %0, %union.insy_fmt_csr_debug_u* %1) {
%3 = alloca i32
%4 = alloca %union.insy_fmt_csr_debug_u*
store i32 %0, i32* %3
store %union.insy_fmt_csr_debug_u* %1, %union.insy_fmt_csr_debug_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.insy_fmt_csr_debug_u = type opaque
define i32 @insy_fmt_csr_debug_set(i32 %0, %union.insy_fmt_csr_debug_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ load_regs_in();
int /*<<< orphan*/ load_regs_saved();
int /*<<< orphan*/ save_regs_out();
int /*<<< orphan*/ save_regs_saved();
int /*<<< orphan*/ switch_main_thread();
int /*<<< orphan*/ switch_zero_thread();
void test_thread_func() {
  for (;;) {
    save_regs_saved();
    load_regs_in();
    switch_zero_thread();
    save_regs_out();
    load_regs_saved();
    switch_main_thread();
  }
}


x86 assembly (clang, -O0):
<test_thread_func>:
push   %rbp
mov    %rsp,%rbp
jmp    1169 <test_thread_func+0x9>
mov    $0x0,%al
call   1050 <save_regs_saved@plt>
mov    $0x0,%al
call   1080 <load_regs_in@plt>
mov    $0x0,%al
call   1030 <switch_zero_thread@plt>
mov    $0x0,%al
call   1060 <save_regs_out@plt>
mov    $0x0,%al
call   1040 <load_regs_saved@plt>
mov    $0x0,%al
call   1070 <switch_main_thread@plt>
jmp    1169 <test_thread_func+0x9>

x86 assembly (clang, -O2):
<test_thread_func>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <save_regs_saved@plt>
xor    %eax,%eax
call   1080 <load_regs_in@plt>
xor    %eax,%eax
call   1030 <switch_zero_thread@plt>
xor    %eax,%eax
call   1060 <save_regs_out@plt>
xor    %eax,%eax
call   1040 <load_regs_saved@plt>
xor    %eax,%eax
call   1070 <switch_main_thread@plt>
jmp    1170 <test_thread_func+0x10>

LLVM IR (-O0):
define void @test_thread_func() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @save_regs_saved()
%3 = call i32 (...) @load_regs_in()
%4 = call i32 (...) @switch_zero_thread()
%5 = call i32 (...) @save_regs_out()
%6 = call i32 (...) @load_regs_saved()
%7 = call i32 (...) @switch_main_thread()
br label %1
}

LLVM IR (-O2):
define void @test_thread_func() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @save_regs_saved()
%3 = tail call i32 (...) @load_regs_in()
%4 = tail call i32 (...) @switch_zero_thread()
%5 = tail call i32 (...) @save_regs_out()
%6 = tail call i32 (...) @load_regs_saved()
%7 = tail call i32 (...) @switch_main_thread()
br label %1
}
__attribute__((always_)) int try_module_get(struct module *module) { return 1; }


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

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

LLVM IR (-O0):
%struct.module = type opaque
define i32 @try_module_get(%struct.module* %0) {
%2 = alloca %struct.module*
store %struct.module* %0, %struct.module** %2
ret i32 1
}

LLVM IR (-O2):
%struct.module = type opaque
define i32 @try_module_get(%struct.module* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double cbrt(double);
double pop(struct lifo *);
double opr_cbrt(struct lifo *stack) {
  double op = pop(stack);
  return cbrt(op);
}


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

x86 assembly (clang, -O2):
<opr_cbrt>:
push   %rax
call   1030 <pop@plt>
pop    %rax
jmp    1040 <cbrt@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_cbrt(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%4 = load %struct.lifo*, %struct.lifo** %2
%5 = call double @pop(%struct.lifo* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @cbrt(double %6)
ret double %7
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_cbrt(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @cbrt(double %2)
ret double %3
}
void __attribute__((no)) baz(int *p) {}


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

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

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

LLVM IR (-O2):
define void @baz(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef char u_int32_t;

/* Variables and functions */
size_t u8_strlen(const u_int32_t *s) {
  size_t length = 0;
  while (s[length] != '\0')
    length++;
  return length;
}


x86 assembly (clang, -O0):
<u8_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <u8_strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <u8_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <u8_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @u8_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int PAPI_set_multiplex(int);
void PAPIF_SET_MULTIPLEX(int *EventSet, int *check) {
  *check = PAPI_set_multiplex(*EventSet);
}


x86 assembly (clang, -O0):
<PAPIF_SET_MULTIPLEX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <PAPI_set_multiplex@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_SET_MULTIPLEX>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_set_multiplex@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_SET_MULTIPLEX(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* %5
%7 = call i32 @PAPI_set_multiplex(i32 %6)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @PAPIF_SET_MULTIPLEX(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_set_multiplex(i32 %3)
store i32 %4, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
int mkdir(const char *path __attribute__((unused)),
          mode_t mode __attribute__((unused))) {
  printf("mkdir\n");
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea5(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"mkdir\0A\00"
@ENOENT = global i32 0
@errno = global i32 0
define i32 @mkdir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @ENOENT
store i32 %6, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
@str = [6 x i8] c"mkdir\00"
define i32 @mkdir(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @ENOENT
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, int *);
int /*<<< orphan*/ stdin;
void readInt2(int *variableAddress, char headerMessage[]) {
  bool ret;
  do {
    printf("%s", headerMessage);
    ret = scanf("\n%d", variableAddress);
    __fpurge(stdin);
  } while (ret != true);
}


x86 assembly (clang, -O0):
<readInt2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1050 <scanf@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1140 <readInt2+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeb8(%rip),%r15
lea    0xeb4(%rip),%r12
mov    0x2e92(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %eax,%ebp
mov    0x0(%r13),%edi
call   1030 <__fpurge@plt>
cmp    $0x1,%ebp
jne    1160 <readInt2+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"\0A%d\00"
@stdin = global i32 0
define void @readInt2(i32* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%6 = load i32, i32* @stdin
%7 = tail call i32 @__fpurge(i32 %6)
%8 = icmp eq i32 %5, 1
br i1 %8, label %9, label %3
9: ; preds = %3
ret void
}
void setval_222(unsigned *p) { *p = 3281031256U; }


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

x86 assembly (clang, -O2):
<setval_222>:
movl   $0xc3909058,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_222(i32* nocapture writeonly %0) {
store i32 -1013936040, i32* %0
ret void
}
float clampf(float x) {
  if (x > 1.0f) {
    return 1.0f;
  } else if (x < 0.0f) {
    return 0.0f;
  }
  return x;
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1131 <clampf+0x31>
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115a <clampf+0x5a>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    114b <clampf+0x4b>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115a <clampf+0x5a>
jmp    1150 <clampf+0x50>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
xorps  %xmm2,%xmm2
maxss  %xmm0,%xmm2
movss  0xef1(%rip),%xmm3
movaps %xmm3,%xmm1
cmpltss %xmm0,%xmm1
movaps %xmm1,%xmm0
andnps %xmm2,%xmm0
andps  %xmm3,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @clampf(float %0) {
%2 = fcmp ogt float %0, 1.000000e+00
%3 = fcmp olt float %0, 0.000000e+00
%4 = select i1 %3, float 0.000000e+00, float %0
%5 = select i1 %2, float 1.000000e+00, float %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ nhap_xau(char *);
int /*<<< orphan*/ printf(char *, char *);
void main() {
  int mang[] = {1, 2, 3, 4, 5};
  char str[100];
  nhap_xau(str);
  printf("this string =  %s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0xece(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
call   1040 <nhap_xau@plt>
lea    -0x90(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <nhap_xau@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.mang = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [19 x i8] c"this string = %s\0A\00"
define void @main() {
%1 = alloca [5 x i32]
%2 = alloca [100 x i8]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @nhap_xau(i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"this string = %s\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @nhap_xau(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
void test32(void) {
  int a;
  switch (a == 1) {
  case 1:
    a++;
  case 0:
    a--;
  }
}


x86 assembly (clang, -O0):
<test32>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
sete   %al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jne    1138 <test32+0x38>
jmp    111e <test32+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    1141 <test32+0x41>
jmp    112f <test32+0x2f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test32() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
switch i32 %4, label %11 [
i32 1, label %5
i32 0, label %8
]
5: ; preds = %0
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
br label %8
8: ; preds = %0, %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
define void @test32() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
void restorehl(void) { ol("ld\thl,(saved_hl)"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"ld\09hl,(saved_hl)\00"
define void @restorehl() {
%1 = call i32 @ol(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ld\09hl,(saved_hl)\00"
define void @restorehl() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
int isChar(char c) {
  if ('a' < c && c < 'z')
    return 1;
  if ('A' < c && c < 'Z')
    return 1;
  if ('0' < c && c < '9')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jge    1134 <isChar+0x34>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jge    1134 <isChar+0x34>
movl   $0x1,-0x4(%rbp)
jmp    118f <isChar+0x8f>
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jge    115e <isChar+0x5e>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jge    115e <isChar+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    118f <isChar+0x8f>
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jge    1188 <isChar+0x88>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jge    1188 <isChar+0x88>
movl   $0x1,-0x4(%rbp)
jmp    118f <isChar+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isChar>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbe,%al
cmp    $0x18,%al
setb   %al
add    $0xcf,%dil
cmp    $0x8,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isChar(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 slt i32 97, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %31
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp slt i32 65, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp slt i32 %18, 90
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %31
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp slt i32 48, %23
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp slt i32 %27, 57
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 1, i32* %2
br label %31
30: ; preds = %25, %21
store i32 0, i32* %2
br label %31
31: ; preds = %30, %29, %20, %11
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @isChar(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -66
%4 = icmp ult i8 %3, 24
%5 = add i8 %0, -49
%6 = icmp ult i8 %5, 8
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
int any(c, p)
register int c;
register char *p;
{
  while (p && *p)
    if (*p++ == c)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<any>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     112b <any+0x2b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113b <any+0x3b>
jmp    1167 <any+0x67>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    1162 <any+0x62>
movl   $0x1,-0x4(%rbp)
jmp    116e <any+0x6e>
jmp    110b <any+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %rsi,%rsi
je     1129 <any+0x29>
movsbl (%rsi),%ecx
test   %ecx,%ecx
je     1129 <any+0x29>
add    $0x1,%rsi
cmp    %edi,%ecx
jne    1110 <any+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @any(i32 %0, i8* %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %1, %2 ], [ %11, %9 ]
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = load i8, i8* %4
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = sext i8 %7 to i32
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i32 %10, %0
br i1 %12, label %13, label %3
13: ; preds = %6, %3, %9
%14 = phi i32 [ 1, %9 ], [ 0, %3 ], [ 0, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int /*<<< orphan*/ stderr;
void error(int l, const char *errstr) {
  fprintf(stderr, "Error:\n@ line %d: %s\n\n", l, errstr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rsi,%rcx
mov    %edi,%edx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Error:\0A@ line %d: %s\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @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* @stderr
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Error:\0A@ line %d: %s\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ write_bytes(char *, int);
void write_64bit_value(uint64_t i) { write_bytes((char *)&i, 8); }


x86 assembly (clang, -O0):
<write_64bit_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x8,%esi
call   1030 <write_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_64bit_value>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x8,%esi
call   1030 <write_bytes@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @write_64bit_value(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @write_bytes(i8* %3, i32 8)
ret void
}

LLVM IR (-O2):
define void @write_64bit_value(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @write_bytes(i8* %3, i32 8)
ret void
}
/* Variables and functions */
float sqrtf(float);
float t2(float a, float b) { return sqrtf(a / b); }


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1121 <t2+0x11>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @t2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fdiv float %5, %6
%8 = call float @sqrtf(float %7)
ret float %8
}

LLVM IR (-O2):
define float @t2(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = tail call float @sqrtf(float %3)
ret float %4
}
int llvm_fcmp_une(double X, double Y) { return X != Y; }


x86 assembly (clang, -O0):
<llvm_fcmp_une>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llvm_fcmp_une>:
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @llvm_fcmp_une(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp une double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @llvm_fcmp_une(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xf9() {
  Assert_real((isspace(249) == 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",
              1250, ("isspace should be 0 for 0xf9"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xf9>:
push   %rax
mov    $0xf9,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4e2,%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 0xf9\00"
define void @t_isspace_0xf9() {
%1 = call i64 @isspace(i32 249)
%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 1250, 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 0xf9\00"
define void @t_isspace_0xf9() {
%1 = tail call i64 @isspace(i32 249)
%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 1250, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ election();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t;
  scanf("%d", &t);
  while (t) {
    election();
    t--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     115e <main+0x3e>
mov    $0x0,%al
call   1030 <election@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     114e <main+0x2e>
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <election@plt>
addl   $0xffffffff,0x4(%rsp)
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 (...) @election()
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %0, %6
%7 = call i32 (...) @election()
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %0
ret i32 0
}
int false_builtin(ignore)
char *ignore;
{ return (1); }


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

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

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

LLVM IR (-O2):
define i32 @false_builtin(i8* nocapture readnone %0) {
ret i32 1
}
void ledtrig_usb_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ledtrig_usb_init() {
ret void
}
int test_imm_CDuint8_mem(unsigned char *val) {
  return ((*val) & (-0xCD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CDuint8_mem>:
testb  $0x33,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CDuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -205
%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_CDuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 51
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int regulator_bulk_get(struct device_d *dev, int num_consumers,
                       struct regulator_bulk_data *consumers) {
  return 0;
}


x86 assembly (clang, -O0):
<regulator_bulk_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device_d = type opaque
%struct.regulator_bulk_data = type opaque
define i32 @regulator_bulk_get(%struct.device_d* %0, i32 %1, %struct.regulator_bulk_data* %2) {
%4 = alloca %struct.device_d*
%5 = alloca i32
%6 = alloca %struct.regulator_bulk_data*
store %struct.device_d* %0, %struct.device_d** %4
store i32 %1, i32* %5
store %struct.regulator_bulk_data* %2, %struct.regulator_bulk_data** %6
ret i32 0
}

LLVM IR (-O2):
%struct.device_d = type opaque
%struct.regulator_bulk_data = type opaque
define i32 @regulator_bulk_get(%struct.device_d* nocapture readnone %0, i32 %1, %struct.regulator_bulk_data* nocapture readnone %2) {
ret i32 0
}
void func7(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int vehicle_tick(struct vehicle *this) {
  fprintf(stdout, "vehicle tick called\n");
  return 1;
}


x86 assembly (clang, -O0):
<vehicle_tick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vehicle_tick>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.vehicle = type { i32 }
@stdout = global i32 0
@.str = [21 x i8] c"vehicle tick called\0A\00"
define i32 @vehicle_tick(%struct.vehicle* %0) {
%2 = alloca %struct.vehicle*
store %struct.vehicle* %0, %struct.vehicle** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.vehicle = type { i32 }
@stdout = global i32 0
@.str = [21 x i8] c"vehicle tick called\0A\00"
define i32 @vehicle_tick(%struct.vehicle* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
scalar_t__ strtoul(char *, int /*<<< orphan*/ *, int);
void mls_type_data_str_to_uint(char *instr, unsigned int *outb) {
  char token[8 + 1];
  memcpy(token, instr, 8);
  token[8] = '\0';
  *outb = (unsigned int)strtoul(token, NULL, 16);
}


x86 assembly (clang, -O0):
<mls_type_data_str_to_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x19(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x19(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mls_type_data_str_to_uint>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xf(%rsp),%r14
mov    %r14,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movb   $0x0,0x17(%rsp)
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,(%rbx)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mls_type_data_str_to_uint(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [9 x i8]
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @memcpy(i8* %6, i8* %7, i32 8)
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 8
store i8 0, i8* %9
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%11 = call i64 @strtoul(i8* %10, i32* null, i32 16)
%12 = trunc i64 %11 to i32
%13 = load i32*, i32** %4
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @mls_type_data_str_to_uint(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %0, i32 8)
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 8
store i8 0, i8* %6
%7 = call i64 @strtoul(i8* nocapture %4, i32* null, i32 16)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %1
ret void
}
int fun667() { return 667; }


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

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

LLVM IR (-O0):
define i32 @fun667() {
ret i32 667
}

LLVM IR (-O2):
define i32 @fun667() {
ret i32 667
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void ERROR(char *mess) { printf("\n!! ERREUR !! %s\n", mess); }


x86 assembly (clang, -O0):
<ERROR>:
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):
<ERROR>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\0A!! ERREUR !! %s\0A\00"
define void @ERROR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0A!! ERREUR !! %s\0A\00"
define void @ERROR(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ nfp_crc32_be(int /*<<< orphan*/, void const *, size_t);
int /*<<< orphan*/ nfp_crc32_posix_end(int /*<<< orphan*/, size_t);
uint32_t nfp_crc32_posix(const void *buff, size_t len) {
  return nfp_crc32_posix_end(nfp_crc32_be(0, buff, len), len);
}


x86 assembly (clang, -O0):
<nfp_crc32_posix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <nfp_crc32_be@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <nfp_crc32_posix_end@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfp_crc32_posix>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
xor    %edi,%edi
mov    %rbx,%rdx
call   1030 <nfp_crc32_be@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <nfp_crc32_posix_end@plt>

LLVM IR (-O0):
define i32 @nfp_crc32_posix(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @nfp_crc32_be(i32 0, i8* %5, i64 %6)
%8 = load i64, i64* %4
%9 = call i32 @nfp_crc32_posix_end(i32 %7, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @nfp_crc32_posix(i8* %0, i64 %1) {
%3 = tail call i32 @nfp_crc32_be(i32 0, i8* %0, i64 %1)
%4 = tail call i32 @nfp_crc32_posix_end(i32 %3, i64 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MyLibraryFunctionToTest();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Test 1 for MyLibrary:\n");
  MyLibraryFunctionToTest();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Test 1 for MyLibrary:\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @MyLibraryFunctionToTest()
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"Test 1 for MyLibrary:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @MyLibraryFunctionToTest()
ret i32 0
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  while (*s) {
    if (*s == c) {
      return (char *)s;
    }
    ++s;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <strchr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <strchr+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int findNumOfDec(double);
int /*<<< orphan*/ printf(char *, double, int);
void test(double x) {
  int num = findNumOfDec(x);
  printf("%f has %d decimals\n", x, num);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <findNumOfDec@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <findNumOfDec@plt>
lea    0xece(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%f has %d decimals\0A\00"
define void @test(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @findNumOfDec(double %4)
store i32 %5, i32* %3
%6 = load double, double* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%f has %d decimals\0A\00"
define void @test(double %0) {
%2 = tail call i32 @findNumOfDec(double %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %0, i32 %2)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  long long tv_usec;
};

/* Variables and functions */
long long tst_timeval_to_us(struct timeval t) {
  return t.tv_sec * 1000000 + t.tv_usec;
}


x86 assembly (clang, -O0):
<tst_timeval_to_us>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_timeval_to_us>:
imul   $0xf4240,%edi,%eax
cltq
add    %rsi,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @tst_timeval_to_us(i32 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { i32, i64 }*
%5 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %4, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000000
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%12 = load i64, i64* %11
%13 = add nsw i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @tst_timeval_to_us(i32 %0, i64 %1) {
%3 = mul nsw i32 %0, 1000000
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, %1
ret i64 %5
}
/* Variables and functions */
float interpolate(float, float, int /*<<< orphan*/);
int /*<<< orphan*/ random_seed(unsigned long long *);
float random_range_seed(unsigned long long *seed, float min_value,
                        float max_value) {
  return interpolate(min_value, max_value, random_seed(seed));
}


x86 assembly (clang, -O0):
<random_range_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <random_seed@plt>
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mov    %eax,%edi
call   1030 <interpolate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_range_seed>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
call   1040 <random_seed@plt>
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
mov    %eax,%edi
pop    %rax
jmp    1030 <interpolate@plt>

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

LLVM IR (-O2):
define float @random_range_seed(i64* %0, float %1, float %2) {
%4 = tail call i32 @random_seed(i64* %0)
%5 = tail call float @interpolate(float %1, float %2, i32 %4)
ret float %5
}