#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 EXIT_SUCCESS;
int /*<<< orphan*/ decrupt(char *, size_t, int);
int /*<<< orphan*/ free(char *);
int get_mask(char *, size_t);
int /*<<< orphan*/ print_reverced(char *, size_t);
size_t read_line(char **, size_t *);
int main() {
  char *buf = NULL;
  size_t size = 0, readCode;
  readCode = read_line(&buf, &size);
  int mask = get_mask(buf, readCode);
  readCode = read_line(&buf, &size);
  decrupt(buf, readCode, mask);
  print_reverced(buf, readCode);
  free(buf);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1070 <read_line@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <get_mask@plt>
mov    %eax,-0x24(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1070 <read_line@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <decrupt@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <print_reverced@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <read_line@plt>
mov    (%rsp),%rdi
mov    %rax,%rsi
call   1050 <get_mask@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <read_line@plt>
mov    %rax,%rbx
mov    (%rsp),%rdi
mov    %rax,%rsi
mov    %ebp,%edx
call   1040 <decrupt@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
call   1060 <print_reverced@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i32 0, i32* %1
store i8* null, i8** %2
store i64 0, i64* %3
%6 = call i64 @read_line(i8** %2, i64* %3)
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = load i64, i64* %4
%9 = call i32 @get_mask(i8* %7, i64 %8)
store i32 %9, i32* %5
%10 = call i64 @read_line(i8** %2, i64* %3)
store i64 %10, i64* %4
%11 = load i8*, i8** %2
%12 = load i64, i64* %4
%13 = load i32, i32* %5
%14 = call i32 @decrupt(i8* %11, i64 %12, i32 %13)
%15 = load i8*, i8** %2
%16 = load i64, i64* %4
%17 = call i32 @print_reverced(i8* %15, i64 %16)
%18 = load i8*, i8** %2
%19 = call i32 @free(i8* %18)
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i8*
%2 = alloca i64
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = call i64 @read_line(i8** %1, i64* %2)
%6 = load i8*, i8** %1
%7 = call i32 @get_mask(i8* %6, i64 %5)
%8 = call i64 @read_line(i8** %1, i64* %2)
%9 = load i8*, i8** %1
%10 = call i32 @decrupt(i8* %9, i64 %8, i32 %7)
%11 = load i8*, i8** %1
%12 = call i32 @print_reverced(i8* %11, i64 %8)
%13 = load i8*, i8** %1
%14 = call i32 @free(i8* %13)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}