#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 */
unsigned int encipher(unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ showbits(unsigned int);
int main(int argc, char *argv[]) {
  unsigned int plaintext = 0x31;
  unsigned int key = 0xfa;
  unsigned int ciphertext = 0x00;
  printf("Initial Set-up of plaintext, key, and default ciphertext: ");
  printf("\n");
  showbits(plaintext);
  showbits(key);
  showbits(ciphertext);
  printf("\n");
  printf("Running the Encryption...\n");
  ciphertext = encipher(plaintext, key);
  printf("\n");
  printf("Final versions of plaintext, key, and ciphertext: ");
  printf("\n");
  showbits(plaintext);
  showbits(key);
  showbits(ciphertext);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x31,-0x14(%rbp)
movl   $0xfa,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeed(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
call   1030 <showbits@plt>
mov    -0x18(%rbp),%edi
call   1030 <showbits@plt>
mov    -0x1c(%rbp),%edi
call   1030 <showbits@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <encipher@plt>
mov    %eax,-0x1c(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
call   1030 <showbits@plt>
mov    -0x18(%rbp),%edi
call   1030 <showbits@plt>
mov    -0x1c(%rbp),%edi
call   1030 <showbits@plt>
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xea8(%rip),%rdi
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x31,%edi
call   1050 <showbits@plt>
mov    $0xfa,%edi
call   1050 <showbits@plt>
xor    %edi,%edi
call   1050 <showbits@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
mov    $0x31,%edi
mov    $0xfa,%esi
call   1070 <encipher@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe81(%rip),%rdi
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x31,%edi
call   1050 <showbits@plt>
mov    $0xfa,%edi
call   1050 <showbits@plt>
mov    %ebx,%edi
call   1050 <showbits@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [59 x i8] c"Initial Set-up of plaintext, key, and default ciphertext: \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [27 x i8] c"Running the Encryption...\0A\00"
@.str.3 = [51 x i8] c"Final versions of plaintext, key, and ciphertext: \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 49, i32* %5
store i32 250, i32* %6
store i32 0, i32* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %5
%11 = call i32 @showbits(i32 %10)
%12 = load i32, i32* %6
%13 = call i32 @showbits(i32 %12)
%14 = load i32, i32* %7
%15 = call i32 @showbits(i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i32 @encipher(i32 %18, i32 %19)
store i32 %20, i32* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* %5
%25 = call i32 @showbits(i32 %24)
%26 = load i32, i32* %6
%27 = call i32 @showbits(i32 %26)
%28 = load i32, i32* %7
%29 = call i32 @showbits(i32 %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [59 x i8] c"Initial Set-up of plaintext, key, and default ciphertext: \00"
@.str.3 = [51 x i8] c"Final versions of plaintext, key, and ciphertext: \00"
@str = [26 x i8] c"Running the Encryption...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @showbits(i32 49)
%6 = tail call i32 @showbits(i32 250)
%7 = tail call i32 @showbits(i32 0)
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @encipher(i32 49, i32 250)
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 @showbits(i32 49)
%15 = tail call i32 @showbits(i32 250)
%16 = tail call i32 @showbits(i32 %10)
%17 = tail call i32 @putchar(i32 10)
ret i32 0
}