#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void register_user(FILE *fp, char *input_username, char *input_password) {
  int i;
  for (i = 0; i < (50); i++) {
    if (*(input_username + i) == '\0') {
      break;
    }
    (void)fputc(*(input_username + i), fp);
  }
  fputc(';', fp);
  for (i = 0; i < (50); i++) {
    if (*(input_password + i) == '\0') {
      break;
    }
    (void)fputc(*(input_password + i), fp);
  }
  fputc(';', fp);
  fputc('\n', fp);
}


x86 assembly (clang, -O0):
<register_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x32,-0x1c(%rbp)
jge    1174 <register_user+0x64>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    114f <register_user+0x3f>
jmp    1174 <register_user+0x64>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <register_user+0x1b>
mov    -0x8(%rbp),%rsi
mov    $0x3b,%edi
call   1030 <fputc@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x32,-0x1c(%rbp)
jge    11d2 <register_user+0xc2>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    11ad <register_user+0x9d>
jmp    11d2 <register_user+0xc2>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1189 <register_user+0x79>
mov    -0x8(%rbp),%rsi
mov    $0x3b,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1030 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_user>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%r15,%rbx,1),%eax
test   %al,%al
je     114e <register_user+0x3e>
movsbl %al,%edi
mov    %r12,%rsi
call   1030 <fputc@plt>
add    $0x1,%rbx
cmp    $0x32,%rbx
jne    1130 <register_user+0x20>
mov    $0x3b,%edi
mov    %r12,%rsi
call   1030 <fputc@plt>
xor    %ebx,%ebx
nopl   (%rax)
movzbl (%r14,%rbx,1),%eax
test   %al,%al
je     117e <register_user+0x6e>
movsbl %al,%edi
mov    %r12,%rsi
call   1030 <fputc@plt>
add    $0x1,%rbx
cmp    $0x32,%rbx
jne    1160 <register_user+0x50>
mov    $0x3b,%edi
mov    %r12,%rsi
call   1030 <fputc@plt>
mov    $0xa,%edi
mov    %r12,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @register_user(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 0, i32* %7
br label %8
8: ; preds = %28, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 50
br i1 %10, label %11, label %31
11: ; preds = %8
%12 = load i8*, i8** %5
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %11
br label %31
20: ; preds = %11
%21 = load i8*, i8** %5
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = load i32*, i32** %4
%27 = call i32 @fputc(i8 signext %25, i32* %26)
br label %28
28: ; preds = %20
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %8
31: ; preds = %19, %8
%32 = load i32*, i32** %4
%33 = call i32 @fputc(i8 signext 59, i32* %32)
store i32 0, i32* %7
br label %34
34: ; preds = %54, %31
%35 = load i32, i32* %7
%36 = icmp slt i32 %35, 50
br i1 %36, label %37, label %57
37: ; preds = %34
%38 = load i8*, i8** %6
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %38, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %37
br label %57
46: ; preds = %37
%47 = load i8*, i8** %6
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %47, i64 %49
%51 = load i8, i8* %50
%52 = load i32*, i32** %4
%53 = call i32 @fputc(i8 signext %51, i32* %52)
br label %54
54: ; preds = %46
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %34
57: ; preds = %45, %34
%58 = load i32*, i32** %4
%59 = call i32 @fputc(i8 signext 59, i32* %58)
%60 = load i32*, i32** %4
%61 = call i32 @fputc(i8 signext 10, i32* %60)
ret void
}

LLVM IR (-O2):
define void @register_user(i32* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
br label %4
4: ; preds = %3, %9
%5 = phi i64 [ 0, %3 ], [ %11, %9 ]
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = tail call i32 @fputc(i8 signext %7, i32* %0)
%11 = add nuw nsw i64 %5, 1
%12 = icmp eq i64 %11, 50
br i1 %12, label %13, label %4
13: ; preds = %4, %9
%14 = tail call i32 @fputc(i8 signext 59, i32* %0)
br label %15
15: ; preds = %13, %20
%16 = phi i64 [ 0, %13 ], [ %22, %20 ]
%17 = getelementptr inbounds i8, i8* %2, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %15
%21 = tail call i32 @fputc(i8 signext %18, i32* %0)
%22 = add nuw nsw i64 %16, 1
%23 = icmp eq i64 %22, 50
br i1 %23, label %24, label %15
24: ; preds = %15, %20
%25 = tail call i32 @fputc(i8 signext 59, i32* %0)
%26 = tail call i32 @fputc(i8 signext 10, i32* %0)
ret void
}