#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*/ printf(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(void) {
  char message[80];
  strncpy(message,
          "Sp S rkn kcuon zoyzvo grkd droi gkxdon, droi gyevn rkfo cksn pkcdob "
          "rybcoc.",
          80);
  printf("Welcome to the Caesar Cipher Solver:\n");
  printf("Key    Message\n");
  printf("0 : ");
  int key = 0;
  caesar(key, message);
  return 0;
}


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
mov    $0x50,%edx
call   1030 <strncpy@plt>
lea    0xef1(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%edi
lea    -0x60(%rbp),%rsi
call   1050 <caesar@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xeb4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%edx
call   1030 <strncpy@plt>
lea    0xeee(%rip),%rdi
call   1040 <puts@plt>
lea    0xf07(%rip),%rdi
call   1040 <puts@plt>
lea    0xed1(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <caesar@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"Sp S rkn kcuon zoyzvo grkd droi gkxdon, droi gyevn rkfo cksn pkcdob rybcoc.\00"
@.str.1 = [38 x i8] c"Welcome to the Caesar Cipher Solver:\0A\00"
@.str.2 = [16 x i8] c"Key Message\0A\00"
@.str.3 = [5 x i8] c"0 : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 80)
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
%9 = load i32, i32* %3
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%11 = call i32 @caesar(i32 %9, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [76 x i8] c"Sp S rkn kcuon zoyzvo grkd droi gkxdon, droi gyevn rkfo cksn pkcdob rybcoc.\00"
@.str.3 = [5 x i8] c"0 : \00"
@str = [37 x i8] c"Welcome to the Caesar Cipher Solver:\00"
@str.4 = [15 x i8] c"Key Message\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 @strncpy(i8* %2, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 80)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @caesar(i32 0, i8* %2)
ret i32 0
}