#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 */
scalar_t__ gets(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char a[1000000];
  while (gets(a)) {
    int i = 0;
    while (a[i]) {
      a[i] = a[i] - 7;
      i++;
    }
    puts(a);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf4260,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xf4250(%rbp),%rdi
call   1040 <gets@plt>
cmp    $0x0,%rax
je     11ae <main+0x8e>
movl   $0x0,-0xf4254(%rbp)
movslq -0xf4254(%rbp),%rax
cmpb   $0x0,-0xf4250(%rbp,%rax,1)
je     119d <main+0x7d>
movslq -0xf4254(%rbp),%rax
movsbl -0xf4250(%rbp,%rax,1),%eax
ff
sub    $0x7,%eax
mov    %al,%cl
movslq -0xf4254(%rbp),%rax
mov    %cl,-0xf4250(%rbp,%rax,1)
mov    -0xf4254(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4254(%rbp)
jmp    1152 <main+0x32>
lea    -0xf4250(%rbp),%rdi
call   1030 <puts@plt>
jmp    1132 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0xf4260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xf4248,%rsp
mov    %rsp,%rdi
call   1040 <gets@plt>
test   %rax,%rax
je     1182 <main+0x62>
lea    0x1(%rsp),%r14
mov    %rsp,%rbx
jmp    1165 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <gets@plt>
test   %rax,%rax
je     1182 <main+0x62>
mov    (%rsp),%al
test   %al,%al
je     1150 <main+0x30>
mov    %r14,%rcx
nop
add    $0xf9,%al
mov    %al,-0x1(%rcx)
movzbl (%rcx),%eax
add    $0x1,%rcx
test   %al,%al
jne    1170 <main+0x50>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0xf4248,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000000 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %28, %0
%5 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %2, i64 0, i64 0
%6 = call i64 @gets(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %31
8: ; preds = %4
store i32 0, i32* %3
br label %9
9: ; preds = %15, %8
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %2, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %9
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %20, 7
%22 = trunc i32 %21 to i8
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %2, i64 0, i64 %24
store i8 %22, i8* %25
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %9
28: ; preds = %9
%29 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %2, i64 0, i64 0
%30 = call i32 @puts(i8* %29)
br label %4
31: ; preds = %4
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1000000 x i8]
%2 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %1, i64 0, i64 0
%3 = call i64 @gets(i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %21, label %5
5: ; preds = %0, %17
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %5, %8
%9 = phi i64 [ %13, %8 ], [ 0, %5 ]
%10 = phi i8 [ %15, %8 ], [ %6, %5 ]
%11 = phi i8* [ %14, %8 ], [ %2, %5 ]
%12 = add i8 %10, -7
store i8 %12, i8* %11
%13 = add nuw nsw i64 %9, 1
%14 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %1, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %5
%18 = call i32 @puts(i8* %2)
%19 = call i64 @gets(i8* %2)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %5
21: ; preds = %17, %0
ret i32 0
}