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

/* Variables and functions */
int /*<<< orphan*/ mystrupr(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char const *);
void test1(void) {
  int i, num_words;
  const char *words[] = {"Four",      "score",   "and",
                         "seven",     "years",   "ago",
                         "our",       "fathers", "brought",
                         "forth",     "on",      "this",
                         "continent", "a",       "new",
                         "NATION",    "fast123", "123  abc",
                         "Hello!!",   "",        "*&^%$#8UPPERlower"};
  num_words = sizeof(words) / sizeof(*words);
  printf("\nTest1--------------------------------------------------------\n");
  for (i = 0; i < num_words; i++) {
    char buffer[50 + 1];
    strcpy(buffer, words[i]);
    mystrupr(buffer);
    printf("Word: %s (%s)\n", words[i], buffer);
  }
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
lea    -0xb0(%rbp),%rdi
lea    0x2c17(%rip),%rsi
mov    $0xa8,%edx
call   1060 <memcpy@plt>
movl   $0x15,-0x8(%rbp)
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11de <test1+0x9e>
lea    -0xf0(%rbp),%rdi
movslq -0x4(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rsi
ff
call   1030 <strcpy@plt>
lea    -0xf0(%rbp),%rdi
call   1050 <mystrupr@plt>
movslq -0x4(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rsi
ff
lea    -0xf0(%rbp),%rdx
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117f <test1+0x3f>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0xf3a(%rip),%rdi
call   1040 <puts@plt>
lea    0x2c10(%rip),%r12
mov    %rsp,%r15
lea    0xf15(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%rbx,%r12,1),%r13
mov    %r15,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
call   1060 <mystrupr@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x8,%rbx
cmp    $0xa8,%rbx
jne    1170 <test1+0x30>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Four\00"
@.str.1 = [6 x i8] c"score\00"
@.str.2 = [4 x i8] c"and\00"
@.str.3 = [6 x i8] c"seven\00"
@.str.4 = [6 x i8] c"years\00"
@.str.5 = [4 x i8] c"ago\00"
@.str.6 = [4 x i8] c"our\00"
@.str.7 = [8 x i8] c"fathers\00"
@.str.8 = [8 x i8] c"brought\00"
@.str.9 = [6 x i8] c"forth\00"
@.str.10 = [3 x i8] c"on\00"
@.str.11 = [5 x i8] c"this\00"
@.str.12 = [10 x i8] c"continent\00"
@.str.13 = [2 x i8] c"a\00"
@.str.14 = [4 x i8] c"new\00"
@.str.15 = [7 x i8] c"NATION\00"
@.str.16 = [8 x i8] c"fast123\00"
@.str.17 = [9 x i8] c"123 abc\00"
@.str.18 = [8 x i8] c"Hello!!\00"
@.str.19 = [1 x i8] zeroinitializer
@.str.20 = [18 x i8] c"*&^%$UPPERlower\00"
@__const.test1.words = [21 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i32 0, i32 0)]
@.str.21 = [64 x i8] c"\0ATest1--------------------------------------------------------\0A\00"
@.str.22 = [15 x i8] c"Word: %s (%s)\0A\00"
define void @test1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [21 x i8*]
%4 = alloca [51 x i8]
%5 = bitcast [21 x i8*]* %3 to i8*
store i32 21, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.21, i64 0, i64 0))
store i32 0, i32* %1
br label %7
7: ; preds = %26, %0
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %29
11: ; preds = %7
%12 = getelementptr inbounds [51 x i8], [51 x i8]* %4, i64 0, i64 0
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [21 x i8*], [21 x i8*]* %3, i64 0, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @strcpy(i8* %12, i8* %16)
%18 = getelementptr inbounds [51 x i8], [51 x i8]* %4, i64 0, i64 0
%19 = call i32 @mystrupr(i8* %18)
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [21 x i8*], [21 x i8*]* %3, i64 0, i64 %21
%23 = load i8*, i8** %22
%24 = getelementptr inbounds [51 x i8], [51 x i8]* %4, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.22, i64 0, i64 0), i8* %23, i8* %24)
br label %26
26: ; preds = %11
%27 = load i32, i32* %1
%28 = add nsw i32 %27, 1
store i32 %28, i32* %1
br label %7
29: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Four\00"
@.str.1 = [6 x i8] c"score\00"
@.str.2 = [4 x i8] c"and\00"
@.str.3 = [6 x i8] c"seven\00"
@.str.4 = [6 x i8] c"years\00"
@.str.5 = [4 x i8] c"ago\00"
@.str.6 = [4 x i8] c"our\00"
@.str.7 = [8 x i8] c"fathers\00"
@.str.8 = [8 x i8] c"brought\00"
@.str.9 = [6 x i8] c"forth\00"
@.str.10 = [3 x i8] c"on\00"
@.str.11 = [5 x i8] c"this\00"
@.str.12 = [10 x i8] c"continent\00"
@.str.13 = [2 x i8] c"a\00"
@.str.14 = [4 x i8] c"new\00"
@.str.15 = [7 x i8] c"NATION\00"
@.str.16 = [8 x i8] c"fast123\00"
@.str.17 = [9 x i8] c"123 abc\00"
@.str.18 = [8 x i8] c"Hello!!\00"
@.str.19 = [1 x i8] zeroinitializer
@.str.20 = [18 x i8] c"*&^%$UPPERlower\00"
@__const.test1.words = [21 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i32 0, i32 0)]
@.str.22 = [15 x i8] c"Word: %s (%s)\0A\00"
@str = [63 x i8] c"\0ATest1--------------------------------------------------------\00"
define void @test1() {
%1 = alloca [51 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [51 x i8], [51 x i8]* %1, i64 0, i64 0
br label %4
4: ; preds = %0, %4
%5 = phi i64 [ 0, %0 ], [ %11, %4 ]
%6 = getelementptr inbounds [21 x i8*], [21 x i8*]* @__const.test1.words, i64 0, i64 %5
%7 = load i8*, i8** %6
%8 = call i32 @strcpy(i8* %3, i8* %7)
%9 = call i32 @mystrupr(i8* %3)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.22, i64 0, i64 0), i8* %7, i8* %3)
%11 = add nuw nsw i64 %5, 1
%12 = icmp eq i64 %11, 21
br i1 %12, label %13, label %4
13: ; preds = %4
ret void
}