#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*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  int i;
  char buffer[80];
  strcpy(buffer, "Irgv}txmsr$mw$jyr%");
  for (i = 0; i < strlen(buffer); i++)
    buffer[i] -= 4;
  printf("The code is      %s\n", buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x64(%rbp),%eax
cmp    %ecx,%eax
jge    1190 <main+0x60>
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%ecx
sub    $0x4,%ecx
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <main+0x26>
lea    -0x60(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
lea    0xec2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1177 <main+0x47>
xor    %ebx,%ebx
mov    %rsp,%r14
nopw   0x0(%rax,%rax,1)
addb   $0xfc,(%rsp,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1160 <main+0x30>
lea    0xe95(%rip),%rdi
mov    %rsp,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Irgv}txmsr$mw$jyr%\00"
@.str.1 = [21 x i8] c"The code is %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [80 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %6
6: ; preds = %19, %0
%7 = load i32, i32* %2
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %22
11: ; preds = %6
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 4
%18 = trunc i32 %17 to i8
store i8 %18, i8* %14
br label %19
19: ; preds = %11
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %6
22: ; preds = %6
%23 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%24 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %23)
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@.str = [19 x i8] c"Irgv}txmsr$mw$jyr%\00"
@.str.1 = [21 x i8] c"The code is %s\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strlen(i8* %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %0, %6
%7 = phi i64 [ %11, %6 ], [ 0, %0 ]
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = add i8 %9, -4
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = call i32 @strlen(i8* %2)
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %6, label %15
15: ; preds = %6, %0
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}