#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct bt431_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bt431_select_reg(struct bt431_regs *, int);
int /*<<< orphan*/ bt431_write_reg_inc(struct bt431_regs *, int);
void bt431_init_cursor(struct bt431_regs *regs) {
  bt431_select_reg(regs, 0x0005);
  bt431_write_reg_inc(regs, 0x00);
  bt431_write_reg_inc(regs, 0x00);
  bt431_write_reg_inc(regs, 0x00);
  bt431_write_reg_inc(regs, 0x00);
  bt431_write_reg_inc(regs, 0x00);
  bt431_write_reg_inc(regs, 0x00);
  bt431_write_reg_inc(regs, 0x00);
  bt431_write_reg_inc(regs, 0x00);
}


x86 assembly (clang, -O0):
<bt431_init_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1030 <bt431_select_reg@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bt431_init_cursor>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%esi
call   1030 <bt431_select_reg@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <bt431_write_reg_inc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <bt431_write_reg_inc@plt>

LLVM IR (-O0):
%struct.bt431_regs = type { i32 }
define void @bt431_init_cursor(%struct.bt431_regs* %0) {
%2 = alloca %struct.bt431_regs*
store %struct.bt431_regs* %0, %struct.bt431_regs** %2
%3 = load %struct.bt431_regs*, %struct.bt431_regs** %2
%4 = call i32 @bt431_select_reg(%struct.bt431_regs* %3, i32 5)
%5 = load %struct.bt431_regs*, %struct.bt431_regs** %2
%6 = call i32 @bt431_write_reg_inc(%struct.bt431_regs* %5, i32 0)
%7 = load %struct.bt431_regs*, %struct.bt431_regs** %2
%8 = call i32 @bt431_write_reg_inc(%struct.bt431_regs* %7, i32 0)
%9 = load %struct.bt431_regs*, %struct.bt431_regs** %2
%10 = call i32 @bt431_write_reg_inc(%struct.bt431_regs* %9, i32 0)
%11 = load %struct.bt431_regs*, %struct.bt431_regs** %2
%12 = call i32 @bt431_write_reg_inc(%struct.bt431_regs* %11, i32 0)
%13 = load %struct.bt431_regs*, %struct.bt431_regs** %2
%14 = call i32 @bt431_write_reg_inc(%struct.bt431_regs* %13, i32 0)
%15 = load %struct.bt431_regs*, %struct.bt431_regs** %2
%16 = call i32 @bt431_write_reg_inc(%struct.bt431_regs* %15, i32 0)
%17 = load %struct.bt431_regs*, %struct.bt431_regs** %2
%18 = call i32 @bt431_write_reg_inc(%struct.bt431_regs* %17, i32 0)
%19 = load %struct.bt431_regs*, %struct.bt431_regs** %2
%20 = call i32 @bt431_write_reg_inc(%struct.bt431_regs* %19, i32 0)
ret void
}

LLVM IR (-O2):
%struct.bt431_regs = type { i32 }
define void @bt431_init_cursor(%struct.bt431_regs* %0) {
%2 = tail call i32 @bt431_select_reg(%struct.bt431_regs* %0, i32 5)
%3 = tail call i32 @bt431_write_reg_inc(%struct.bt431_regs* %0, i32 0)
%4 = tail call i32 @bt431_write_reg_inc(%struct.bt431_regs* %0, i32 0)
%5 = tail call i32 @bt431_write_reg_inc(%struct.bt431_regs* %0, i32 0)
%6 = tail call i32 @bt431_write_reg_inc(%struct.bt431_regs* %0, i32 0)
%7 = tail call i32 @bt431_write_reg_inc(%struct.bt431_regs* %0, i32 0)
%8 = tail call i32 @bt431_write_reg_inc(%struct.bt431_regs* %0, i32 0)
%9 = tail call i32 @bt431_write_reg_inc(%struct.bt431_regs* %0, i32 0)
%10 = tail call i32 @bt431_write_reg_inc(%struct.bt431_regs* %0, i32 0)
ret void
}