#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*/ caesar(int, char *);
int /*<<< orphan*/ caesar1(int, char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  char message1[100];
  int key1;
  printf("Enter a String: ");
  gets(message1);
  printf("Enter a Key: ");
  scanf("%d", &key1);
  caesar1(key1, message1);
  char message[] = "Sp S rkn kcuon zoyzo grkd droi gkxdon droi gyevn rkfo cksn "
                   "pkcdob rybcoc";
  for (int key = 0; key < 27; key++) {
    caesar(key, message);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1070 <gets@plt>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
lea    -0x74(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x74(%rbp),%edi
lea    -0x70(%rbp),%rsi
call   1050 <caesar1@plt>
lea    -0xc0(%rbp),%rdi
lea    0xe73(%rip),%rsi
mov    $0x49,%edx
call   1060 <memcpy@plt>
movl   $0x0,-0xc4(%rbp)
cmpl   $0x1b,-0xc4(%rbp)
jge    1204 <main+0xa4>
mov    -0xc4(%rbp),%edi
lea    -0xc0(%rbp),%rsi
call   1040 <caesar@plt>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    11d1 <main+0x71>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1050 <caesar1@plt>
movups 0xec8(%rip),%xmm0
movups %xmm0,0x49(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe97(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe7b(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe5f(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x6,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x7,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x9,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0xb,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0xc,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0xd,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0xe,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0xf,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x10,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x11,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x12,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x13,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x14,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x15,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x16,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x17,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x18,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x19,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
mov    $0x1a,%edi
mov    %rbx,%rsi
call   1040 <caesar@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a String: \00"
@.str.1 = [14 x i8] c"Enter a Key: \00"
@.str.2 = [3 x i8] c"%d\00"
@__const.main.message = [73 x i8] c"Sp S rkn kcuon zoyzo grkd droi gkxdon droi gyevn rkfo cksn pkcdob rybcoc\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca [73 x i8]
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%13 = call i32 @caesar1(i32 %11, i8* %12)
%14 = bitcast [73 x i8]* %4 to i8*
store i32 0, i32* %5
br label %15
15: ; preds = %22, %0
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 27
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load i32, i32* %5
%20 = getelementptr inbounds [73 x i8], [73 x i8]* %4, i64 0, i64 0
%21 = call i32 @caesar(i32 %19, i8* %20)
br label %22
22: ; preds = %18
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %15
25: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a String: \00"
@.str.1 = [14 x i8] c"Enter a Key: \00"
@.str.2 = [3 x i8] c"%d\00"
@__const.main.message = [73 x i8] c"Sp S rkn kcuon zoyzo grkd droi gkxdon droi gyevn rkfo cksn pkcdob rybcoc\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = alloca [73 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @gets(i8* %4)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = call i32 @caesar1(i32 %10, i8* %4)
%12 = getelementptr inbounds [73 x i8], [73 x i8]* %3, i64 0, i64 0
%13 = call i32 @caesar(i32 0, i8* %12)
%14 = call i32 @caesar(i32 1, i8* %12)
%15 = call i32 @caesar(i32 2, i8* %12)
%16 = call i32 @caesar(i32 3, i8* %12)
%17 = call i32 @caesar(i32 4, i8* %12)
%18 = call i32 @caesar(i32 5, i8* %12)
%19 = call i32 @caesar(i32 6, i8* %12)
%20 = call i32 @caesar(i32 7, i8* %12)
%21 = call i32 @caesar(i32 8, i8* %12)
%22 = call i32 @caesar(i32 9, i8* %12)
%23 = call i32 @caesar(i32 10, i8* %12)
%24 = call i32 @caesar(i32 11, i8* %12)
%25 = call i32 @caesar(i32 12, i8* %12)
%26 = call i32 @caesar(i32 13, i8* %12)
%27 = call i32 @caesar(i32 14, i8* %12)
%28 = call i32 @caesar(i32 15, i8* %12)
%29 = call i32 @caesar(i32 16, i8* %12)
%30 = call i32 @caesar(i32 17, i8* %12)
%31 = call i32 @caesar(i32 18, i8* %12)
%32 = call i32 @caesar(i32 19, i8* %12)
%33 = call i32 @caesar(i32 20, i8* %12)
%34 = call i32 @caesar(i32 21, i8* %12)
%35 = call i32 @caesar(i32 22, i8* %12)
%36 = call i32 @caesar(i32 23, i8* %12)
%37 = call i32 @caesar(i32 24, i8* %12)
%38 = call i32 @caesar(i32 25, i8* %12)
%39 = call i32 @caesar(i32 26, i8* %12)
ret i32 0
}