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

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ mytoupper(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  char a[5][64];
  int i = 0;
  int size = sizeof(a) / sizeof(a[0]);
  for (i = 0; i < size; i++) {
    fgets(a[i], sizeof(a[i]), stdin);
    a[i][strlen(a[i]) - 1] = 0;
    mytoupper(a[i]);
  }
  for (i = 0; i < size; i++) {
    puts(a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x154(%rbp)
movl   $0x5,-0x158(%rbp)
movl   $0x0,-0x154(%rbp)
mov    -0x154(%rbp),%eax
cmp    -0x158(%rbp),%eax
jge    1221 <main+0xe1>
movslq -0x154(%rbp),%rax
lea    -0x150(%rbp),%rdi
shl    $0x6,%rax
add    %rax,%rdi
mov    0x2e4a(%rip),%rax
mov    (%rax),%edx
mov    $0x40,%esi
call   1050 <fgets@plt>
movslq -0x154(%rbp),%rcx
lea    -0x150(%rbp),%rax
shl    $0x6,%rcx
add    %rcx,%rax
mov    %rax,-0x160(%rbp)
movslq -0x154(%rbp),%rax
lea    -0x150(%rbp),%rdi
shl    $0x6,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x160(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
movslq -0x154(%rbp),%rax
lea    -0x150(%rbp),%rdi
shl    $0x6,%rax
add    %rax,%rdi
call   1060 <mytoupper@plt>
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    1170 <main+0x30>
movl   $0x0,-0x154(%rbp)
mov    -0x154(%rbp),%eax
cmp    -0x158(%rbp),%eax
jge    126b <main+0x12b>
movslq -0x154(%rbp),%rax
lea    -0x150(%rbp),%rdi
shl    $0x6,%rax
add    %rax,%rdi
call   1030 <puts@plt>
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    122b <main+0xeb>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    0x2e90(%rip),%rbp
mov    0x0(%rbp),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
call   1060 <mytoupper@plt>
lea    0x40(%rsp),%r14
mov    0x0(%rbp),%edx
mov    %r14,%rdi
mov    $0x40,%esi
call   1050 <fgets@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,0x3f(%rax,%rbx,1)
mov    %r14,%rdi
call   1060 <mytoupper@plt>
lea    0x80(%rsp),%r15
mov    0x0(%rbp),%edx
mov    %r15,%rdi
mov    $0x40,%esi
call   1050 <fgets@plt>
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,0x7f(%rax,%rbx,1)
mov    %r15,%rdi
call   1060 <mytoupper@plt>
lea    0xc0(%rsp),%r12
mov    0x0(%rbp),%edx
mov    %r12,%rdi
mov    $0x40,%esi
call   1050 <fgets@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,0xbf(%rax,%rbx,1)
mov    %r12,%rdi
call   1060 <mytoupper@plt>
lea    0x100(%rsp),%r13
mov    0x0(%rbp),%edx
mov    %r13,%rdi
mov    $0x40,%esi
call   1050 <fgets@plt>
mov    %r13,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,0xff(%rax,%rbx,1)
mov    %r13,%rdi
call   1060 <mytoupper@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [64 x i8]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 5, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %32, %0
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %35
9: ; preds = %5
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %2, i64 0, i64 %11
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %12, i64 0, i64 0
%14 = load i32, i32* @stdin
%15 = call i32 @fgets(i8* %13, i32 64, i32 %14)
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %2, i64 0, i64 %17
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %2, i64 0, i64 %20
%22 = getelementptr inbounds [64 x i8], [64 x i8]* %21, i64 0, i64 0
%23 = call i32 @strlen(i8* %22)
%24 = sub nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [64 x i8], [64 x i8]* %18, i64 0, i64 %25
store i8 0, i8* %26
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %2, i64 0, i64 %28
%30 = getelementptr inbounds [64 x i8], [64 x i8]* %29, i64 0, i64 0
%31 = call i32 @mytoupper(i8* %30)
br label %32
32: ; preds = %9
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %5
35: ; preds = %5
store i32 0, i32* %3
br label %36
36: ; preds = %46, %35
%37 = load i32, i32* %3
%38 = load i32, i32* %4
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %49
40: ; preds = %36
%41 = load i32, i32* %3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %2, i64 0, i64 %42
%44 = getelementptr inbounds [64 x i8], [64 x i8]* %43, i64 0, i64 0
%45 = call i32 @puts(i8* %44)
br label %46
46: ; preds = %40
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %36
49: ; preds = %36
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [5 x [64 x i8]]
%2 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %1, i64 0, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 64, i32 %3)
%5 = call i32 @strlen(i8* %2)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %1, i64 0, i64 0, i64 %7
store i8 0, i8* %8
%9 = call i32 @mytoupper(i8* %2)
%10 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %1, i64 0, i64 1, i64 0
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %10, i32 64, i32 %11)
%13 = call i32 @strlen(i8* %10)
%14 = add nsw i32 %13, -1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %1, i64 0, i64 1, i64 %15
store i8 0, i8* %16
%17 = call i32 @mytoupper(i8* %10)
%18 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %1, i64 0, i64 2, i64 0
%19 = load i32, i32* @stdin
%20 = call i32 @fgets(i8* %18, i32 64, i32 %19)
%21 = call i32 @strlen(i8* %18)
%22 = add nsw i32 %21, -1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %1, i64 0, i64 2, i64 %23
store i8 0, i8* %24
%25 = call i32 @mytoupper(i8* %18)
%26 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %1, i64 0, i64 3, i64 0
%27 = load i32, i32* @stdin
%28 = call i32 @fgets(i8* %26, i32 64, i32 %27)
%29 = call i32 @strlen(i8* %26)
%30 = add nsw i32 %29, -1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %1, i64 0, i64 3, i64 %31
store i8 0, i8* %32
%33 = call i32 @mytoupper(i8* %26)
%34 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %1, i64 0, i64 4, i64 0
%35 = load i32, i32* @stdin
%36 = call i32 @fgets(i8* %34, i32 64, i32 %35)
%37 = call i32 @strlen(i8* %34)
%38 = add nsw i32 %37, -1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [5 x [64 x i8]], [5 x [64 x i8]]* %1, i64 0, i64 4, i64 %39
store i8 0, i8* %40
%41 = call i32 @mytoupper(i8* %34)
%42 = call i32 @puts(i8* %2)
%43 = call i32 @puts(i8* %10)
%44 = call i32 @puts(i8* %18)
%45 = call i32 @puts(i8* %26)
%46 = call i32 @puts(i8* %34)
ret i32 0
}