#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 */

/* Variables and functions */
int /*<<< orphan*/ tgt_put(char *);
void gen_reg_entry(char *reg_name, char *reg_len, char *reg_type, char *reg_num,
                   char *reg_other) {
  tgt_put("<reg name=\"");
  tgt_put(reg_name);
  tgt_put("\" bitsize=\"");
  tgt_put(reg_len);
  tgt_put("\" type=\"");
  tgt_put(reg_type);
  tgt_put("\" regnum=\"");
  tgt_put(reg_num);
  if (*reg_other != '\0') {
    tgt_put("\" ");
    tgt_put(reg_other);
  }
  tgt_put("\"/>");
}


x86 assembly (clang, -O0):
<gen_reg_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <tgt_put@plt>
mov    -0x8(%rbp),%rdi
call   1030 <tgt_put@plt>
lea    0xec4(%rip),%rdi
call   1030 <tgt_put@plt>
mov    -0x10(%rbp),%rdi
call   1030 <tgt_put@plt>
lea    0xebb(%rip),%rdi
call   1030 <tgt_put@plt>
mov    -0x18(%rbp),%rdi
call   1030 <tgt_put@plt>
lea    0xeaf(%rip),%rdi
call   1030 <tgt_put@plt>
mov    -0x20(%rbp),%rdi
call   1030 <tgt_put@plt>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11a5 <gen_reg_entry+0x95>
lea    0xe95(%rip),%rdi
call   1030 <tgt_put@plt>
mov    -0x28(%rbp),%rdi
call   1030 <tgt_put@plt>
lea    0xe83(%rip),%rdi
call   1030 <tgt_put@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_reg_entry>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1030 <tgt_put@plt>
mov    %rbx,%rdi
call   1030 <tgt_put@plt>
lea    0xec9(%rip),%rdi
call   1030 <tgt_put@plt>
mov    %r13,%rdi
call   1030 <tgt_put@plt>
lea    0xec1(%rip),%rdi
call   1030 <tgt_put@plt>
mov    %r12,%rdi
call   1030 <tgt_put@plt>
lea    0xeb6(%rip),%rdi
call   1030 <tgt_put@plt>
mov    %r14,%rdi
call   1030 <tgt_put@plt>
cmpb   $0x0,(%r15)
je     1192 <gen_reg_entry+0x82>
lea    0xea7(%rip),%rdi
call   1030 <tgt_put@plt>
mov    %r15,%rdi
call   1030 <tgt_put@plt>
lea    0xe96(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <tgt_put@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"<reg name=\22\00"
@.str.1 = [12 x i8] c"\22 bitsize=\22\00"
@.str.2 = [9 x i8] c"\22 type=\22\00"
@.str.3 = [11 x i8] c"\22 regnum=\22\00"
@.str.4 = [3 x i8] c"\22 \00"
@.str.5 = [4 x i8] c"\22/>\00"
define void @gen_reg_entry(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = call i32 @tgt_put(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %6
%13 = call i32 @tgt_put(i8* %12)
%14 = call i32 @tgt_put(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%15 = load i8*, i8** %7
%16 = call i32 @tgt_put(i8* %15)
%17 = call i32 @tgt_put(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%18 = load i8*, i8** %8
%19 = call i32 @tgt_put(i8* %18)
%20 = call i32 @tgt_put(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%21 = load i8*, i8** %9
%22 = call i32 @tgt_put(i8* %21)
%23 = load i8*, i8** %10
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %5
%28 = call i32 @tgt_put(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%29 = load i8*, i8** %10
%30 = call i32 @tgt_put(i8* %29)
br label %31
31: ; preds = %27, %5
%32 = call i32 @tgt_put(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"<reg name=\22\00"
@.str.1 = [12 x i8] c"\22 bitsize=\22\00"
@.str.2 = [9 x i8] c"\22 type=\22\00"
@.str.3 = [11 x i8] c"\22 regnum=\22\00"
@.str.4 = [3 x i8] c"\22 \00"
@.str.5 = [4 x i8] c"\22/>\00"
define void @gen_reg_entry(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @tgt_put(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @tgt_put(i8* %0)
%8 = tail call i32 @tgt_put(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @tgt_put(i8* %1)
%10 = tail call i32 @tgt_put(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32 @tgt_put(i8* %2)
%12 = tail call i32 @tgt_put(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%13 = tail call i32 @tgt_put(i8* %3)
%14 = load i8, i8* %4
%15 = icmp eq i8 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %5
%17 = tail call i32 @tgt_put(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%18 = tail call i32 @tgt_put(i8* %4)
br label %19
19: ; preds = %16, %5
%20 = tail call i32 @tgt_put(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
ret void
}