#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 atoint(char *);
int firstUnique(char *);
char mostOccuring(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char *name = "dafsdukjhj", *cap = "GAF I E J   FIGA";
  char ch = mostOccuring(name);
  int idx = firstUnique(cap);
  printf("Most occuring character is %c\n", ch);
  printf("First unique character is %c\n", cap[idx]);
  char *sentence = "a word my friend";
  printf("Reversed: %s\n", sentence);
  printf("%d\n", atoint("-a27"));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <mostOccuring@plt>
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <firstUnique@plt>
mov    %eax,-0x20(%rbp)
movsbl -0x19(%rbp),%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1060 <atoint@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2df7(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xeb5(%rip),%rdi
call   1050 <mostOccuring@plt>
mov    %eax,%ebx
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
call   1040 <firstUnique@plt>
mov    %eax,%ebp
movsbl %bl,%esi
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq %ebp,%rax
movsbl (%rax,%r14,1),%esi
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0xec1(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
call   1060 <atoint@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"dafsdukjhj\00"
@.str.1 = [17 x i8] c"GAF I E J FIGA\00"
@.str.2 = [31 x i8] c"Most occuring character is %c\0A\00"
@.str.3 = [30 x i8] c"First unique character is %c\0A\00"
@.str.4 = [17 x i8] c"a word my friend\00"
@.str.5 = [14 x i8] c"Reversed: %s\0A\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@.str.7 = [5 x i8] c"-a27\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %3
%7 = load i8*, i8** %2
%8 = call signext i8 @mostOccuring(i8* %7)
store i8 %8, i8* %4
%9 = load i8*, i8** %3
%10 = call i32 @firstUnique(i8* %9)
store i32 %10, i32* %5
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %19)
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8** %6
%21 = load i8*, i8** %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %21)
%23 = call i32 @atoint(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %23)
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
}

LLVM IR (-O2):
@.str = [11 x i8] c"dafsdukjhj\00"
@.str.1 = [17 x i8] c"GAF I E J FIGA\00"
@.str.2 = [31 x i8] c"Most occuring character is %c\0A\00"
@.str.3 = [30 x i8] c"First unique character is %c\0A\00"
@.str.4 = [17 x i8] c"a word my friend\00"
@.str.5 = [14 x i8] c"Reversed: %s\0A\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@.str.7 = [5 x i8] c"-a27\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call signext i8 @mostOccuring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @firstUnique(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = sext i8 %1 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @.str.1, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @atoint(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}