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

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int toupper(char);
main() {
  int constrpos;
  char constr[] = "abcdefghijklmnopqrstuvwxyz";
  for (constrpos = 0; constrpos < sizeof(constr); constrpos++)
    printf("%c", toupper(constr[constrpos]));
  printf("\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb1(%rip),%ax
mov    %ax,-0x18(%rbp)
mov    0xea9(%rip),%al
mov    %al,-0x16(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x1b,%rax
jae    11b5 <main+0x85>
movslq -0x8(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%edi
call   1030 <toupper@plt>
mov    %eax,%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117b <main+0x4b>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xec3(%rip),%r14
nopl   (%rax)
movsbl (%rbx,%r14,1),%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x1b,%rbx
jne    1140 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@__const.main.constr = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [27 x i8]
store i32 0, i32* %1
%4 = bitcast [27 x i8]* %3 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 27
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = call i32 @toupper(i8 signext %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %5
19: ; preds = %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@__const.main.constr = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %7, %1 ]
%3 = getelementptr inbounds [27 x i8], [27 x i8]* @__const.main.constr, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = tail call i32 @toupper(i8 signext %4)
%6 = tail call i32 @putchar(i32 %5)
%7 = add nuw nsw i64 %2, 1
%8 = icmp eq i64 %7, 27
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 @exit(i32 0)
unreachable
}