#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*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  char *s;
  s = *argv;
  while (*s != 0) {
    if (*s >= 'a' && *s <= 'z')
      *s = *s + (65 - 97);
    ++s;
  }
  printf("%s", *argv);
  puts("");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1194 <main+0x74>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1183 <main+0x63>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1183 <main+0x63>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffe0,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <main+0x21>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe54(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rax
mov    (%rsi),%rsi
mov    (%rsi),%cl
test   %cl,%cl
je     115e <main+0x3e>
add    $0x1,%rsi
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
je     115b <main+0x3b>
lea    -0x61(%rcx),%edx
cmp    $0x19,%dl
ja     1140 <main+0x20>
add    $0xe0,%cl
mov    %cl,-0x1(%rsi)
jmp    1140 <main+0x20>
mov    (%rax),%rsi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
store i8* %8, i8** %6
br label %9
9: ; preds = %31, %2
%10 = load i8*, i8** %6
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %34
14: ; preds = %9
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 97
br i1 %18, label %19, label %31
19: ; preds = %14
%20 = load i8*, i8** %6
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 122
br i1 %23, label %24, label %31
24: ; preds = %19
%25 = load i8*, i8** %6
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = add nsw i32 %27, -32
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %6
store i8 %29, i8* %30
br label %31
31: ; preds = %24, %19, %14
%32 = load i8*, i8** %6
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %6
br label %9
34: ; preds = %9
%35 = load i8**, i8*** %5
%36 = load i8*, i8** %35
%37 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %36)
%38 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %2, %13
%7 = phi i8 [ %15, %13 ], [ %4, %2 ]
%8 = phi i8* [ %14, %13 ], [ %3, %2 ]
%9 = add i8 %7, -97
%10 = icmp ult i8 %9, 26
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = add nsw i8 %7, -32
store i8 %12, i8* %8
br label %13
13: ; preds = %11, %6
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %13
%18 = load i8*, i8** %1
br label %19
19: ; preds = %17, %2
%20 = phi i8* [ %18, %17 ], [ %3, %2 ]
%21 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = tail call i32 @putchar(i32 10)
ret i32 0
}