#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 */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char c[5];
  int i;
  printf("输入五个字母\n");
  for (i = 0; i < 5; i++) {
    c[i] = getchar();
  }
  for (i = 0; i < 5; i++) {
    c[i] += 4;
    printf("%c", c[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    116d <main+0x4d>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,%cl
movslq -0x10(%rbp),%rax
mov    %cl,-0x9(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <main+0x24>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    11b3 <main+0x93>
movslq -0x10(%rbp),%rax
movsbl -0x9(%rbp,%rax,1),%ecx
add    $0x4,%ecx
mov    %cl,-0x9(%rbp,%rax,1)
movslq -0x10(%rbp),%rax
movsbl -0x9(%rbp,%rax,1),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1174 <main+0x54>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebp
add    $0x4,%bl
movsbl %bl,%edi
call   1030 <putchar@plt>
add    $0x4,%r14b
movsbl %r14b,%edi
call   1030 <putchar@plt>
add    $0x4,%r15b
movsbl %r15b,%edi
call   1030 <putchar@plt>
add    $0x4,%r12b
movsbl %r12b,%edi
call   1030 <putchar@plt>
add    $0x4,%bpl
movsbl %bpl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\E8\BE\93\E5\85\A5\E4\BA\94\E4\B8\AA\E5\AD\97\E6\AF\8D\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = call signext i8 (...) @getchar()
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 %11
store i8 %9, i8* %12
br label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
store i32 0, i32* %3
br label %17
17: ; preds = %34, %16
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 5
br i1 %19, label %20, label %37
20: ; preds = %17
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = add nsw i32 %25, 4
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %20
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %17
37: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"\E8\BE\93\E5\85\A5\E4\BA\94\E4\B8\AA\E5\AD\97\E6\AF\8D\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = tail call signext i8 (...) @getchar()
%4 = tail call signext i8 (...) @getchar()
%5 = tail call signext i8 (...) @getchar()
%6 = tail call signext i8 (...) @getchar()
%7 = add i8 %2, 4
%8 = sext i8 %7 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = add i8 %3, 4
%11 = sext i8 %10 to i32
%12 = tail call i32 @putchar(i32 %11)
%13 = add i8 %4, 4
%14 = sext i8 %13 to i32
%15 = tail call i32 @putchar(i32 %14)
%16 = add i8 %5, 4
%17 = sext i8 %16 to i32
%18 = tail call i32 @putchar(i32 %17)
%19 = add i8 %6, 4
%20 = sext i8 %19 to i32
%21 = tail call i32 @putchar(i32 %20)
ret i32 0
}