#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*/ maius(char);
int /*<<< orphan*/ strcpy(char *, char *);
unsigned int strlen(char *);
void Maiuskulak(char *hitz, char *atzizki, char *hitz_ald) {
  unsigned int i = 0, j = 0;
  char hitza[80];
  while (!maius(hitz[j]))
    j++;
  hitza[0] = '\0';
  atzizki[0] = '\0';
  strcpy(hitza, &hitz[j]);
  for (i = 0; i < strlen(hitza); i++)
    if (!maius(hitza[i])) {
      strcpy(atzizki, &hitza[i]);
      hitza[i] = '\0';
      strcpy(hitz_ald, hitza);
      return;
    }
  strcpy(hitz_ald, hitza);
  return;
}


x86 assembly (clang, -O0):
<Maiuskulak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1050 <maius@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117a <Maiuskulak+0x4a>
jmp    1188 <Maiuskulak+0x58>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1155 <Maiuskulak+0x25>
movb   $0x0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%eax
add    %rax,%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
cmp    %ecx,%eax
jae    121f <Maiuskulak+0xef>
mov    -0x1c(%rbp),%eax
movsbl -0x70(%rbp,%rax,1),%edi
call   1050 <maius@plt>
cmp    $0x0,%eax
jne    120c <Maiuskulak+0xdc>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%eax
lea    -0x70(%rbp),%rsi
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x1c(%rbp),%eax
movb   $0x0,-0x70(%rbp,%rax,1)
mov    -0x18(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    122c <Maiuskulak+0xfc>
jmp    1211 <Maiuskulak+0xe1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ad <Maiuskulak+0x7d>
mov    -0x18(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Maiuskulak>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x50,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
mov    $0xffffffff,%ebx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
movsbl 0x0(%r13,%rbx,1),%edi
call   1050 <maius@plt>
test   %eax,%eax
je     1150 <Maiuskulak+0x20>
mov    %ebx,%eax
add    %rax,%r13
movb   $0x0,(%rsp)
movb   $0x0,(%r15)
mov    %rsp,%r12
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
je     11c2 <Maiuskulak+0x92>
xor    %ebx,%ebx
mov    %rsp,%r12
xchg   %ax,%ax
movsbl (%rsp,%rbx,1),%edi
call   1050 <maius@plt>
test   %eax,%eax
je     11b2 <Maiuskulak+0x82>
add    $0x1,%rbx
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbx
jb     1190 <Maiuskulak+0x60>
jmp    11c2 <Maiuskulak+0x92>
lea    (%rsp,%rbx,1),%rsi
mov    %r15,%rdi
call   1030 <strcpy@plt>
movb   $0x0,(%rsp,%rbx,1)
mov    %rsp,%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @Maiuskulak(i8* %0, i8* %1, i8* %2) {
%4 = alloca [80 x i8]
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
br label %6
6: ; preds = %6, %3
%7 = phi i32 [ 0, %3 ], [ %13, %6 ]
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @maius(i8 signext %10)
%12 = icmp eq i32 %11, 0
%13 = add i32 %7, 1
br i1 %12, label %6, label %14
14: ; preds = %6
%15 = zext i32 %7 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
store i8 0, i8* %5
store i8 0, i8* %1
%17 = call i32 @strcpy(i8* %5, i8* %16)
%18 = call i32 @strlen(i8* %5)
%19 = icmp eq i32 %18, 0
br i1 %19, label %35, label %20
20: ; preds = %14, %30
%21 = phi i64 [ %31, %30 ], [ 0, %14 ]
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = call i32 @maius(i8 signext %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %20
%27 = and i64 %21, 4294967295
%28 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %27
%29 = call i32 @strcpy(i8* %1, i8* %28)
store i8 0, i8* %28
br label %35
30: ; preds = %20
%31 = add nuw nsw i64 %21, 1
%32 = call i32 @strlen(i8* %5)
%33 = zext i32 %32 to i64
%34 = icmp ult i64 %31, %33
br i1 %34, label %20, label %35
35: ; preds = %30, %14, %26
%36 = call i32 @strcpy(i8* %2, i8* %5)
ret void
}