#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*/ printf(char *, ...);
int strlen(char *);
int main() {
  int i;
  char s[1000];
  while (gets(s)) {
    for (i = 0; i < strlen(s); i++)
      printf("%c", s[i] - 7);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
je     11c2 <main+0x92>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x3f4(%rbp),%eax
cmp    %ecx,%eax
jge    11af <main+0x7f>
movslq -0x8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%esi
ff
sub    $0x7,%esi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115f <main+0x2f>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     11a1 <main+0x71>
mov    %rsp,%r14
jmp    1167 <main+0x37>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     11a1 <main+0x71>
mov    %r14,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1150 <main+0x20>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rsp,%rbx,1),%edi
add    $0xfffffff9,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1180 <main+0x50>
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.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 [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %25, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i64 @gets(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %27
8: ; preds = %4
store i32 0, i32* %2
br label %9
9: ; preds = %22, %8
%10 = load i32, i32* %2
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %14
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %9
25: ; preds = %9
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %4
27: ; preds = %4
ret i32 0
}

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