#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*/ Copy_Number(char *, char *);
int /*<<< orphan*/ Copy_toArray(char *, int, char *);
int /*<<< orphan*/ Copy_toNumber(char *, char *, int);
int Logical_opp_Array_Number(char *, int, char *);
int /*<<< orphan*/ Print_Array(char *, int);
int /*<<< orphan*/ Print_Number(char *);
int /*<<< orphan*/ Scan_Array(char *, int);
int /*<<< orphan*/ Scan_Number(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  Scan_Array("a", 1);
  Scan_Number("b");
  printf("\n A is ");
  Print_Array("a", 1);
  printf("\n B is ");
  Print_Number("b");
  Copy_toNumber("c", "a", 1);
  Copy_toArray("a", 1, "b");
  Copy_Number("b", "c");
  printf("\n A is ");
  Print_Array("a", 1);
  printf("\n B is ");
  Print_Number("b");
  int logical = Logical_opp_Array_Number("a", 1, "b");
  if (logical == 1)
    puts("\nA is greater");
  else if (logical == -1)
    puts("\nB is greater");
  else if (logical == 0)
    puts("\nA and B are equal");
  else
    puts("Invalid");
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe4a(%rip),%rdi
mov    $0x1,%esi
call   1040 <Scan_Array@plt>
lea    0xe3b(%rip),%rdi
call   1070 <Scan_Number@plt>
lea    0xe31(%rip),%rdi
call   1050 <printf@plt>
lea    0xe21(%rip),%rdi
mov    $0x1,%esi
call   1080 <Print_Array@plt>
lea    0xe1c(%rip),%rdi
call   1050 <printf@plt>
lea    0xe06(%rip),%rdi
call   10c0 <Print_Number@plt>
lea    0xe0c(%rip),%rdi
lea    0xdf1(%rip),%rsi
mov    $0x1,%edx
call   1090 <Copy_toNumber@plt>
lea    0xde0(%rip),%rdi
mov    $0x1,%esi
lea    0xdd6(%rip),%rdx
call   10b0 <Copy_toArray@plt>
lea    0xdca(%rip),%rdi
lea    0xdd5(%rip),%rsi
call   10a0 <Copy_Number@plt>
lea    0xdb9(%rip),%rdi
call   1050 <printf@plt>
lea    0xda9(%rip),%rdi
mov    $0x1,%esi
call   1080 <Print_Array@plt>
lea    0xda4(%rip),%rdi
call   1050 <printf@plt>
lea    0xd8e(%rip),%rdi
call   10c0 <Print_Number@plt>
lea    0xd80(%rip),%rdi
mov    $0x1,%esi
lea    0xd76(%rip),%rdx
call   1060 <Logical_opp_Array_Number@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    12af <main+0x10f>
lea    0xd71(%rip),%rdi
call   1030 <puts@plt>
jmp    12fb <main+0x15b>
cmpl   $0xffffffff,-0x8(%rbp)
jne    12ca <main+0x12a>
lea    0xd64(%rip),%rdi
call   1030 <puts@plt>
jmp    12f6 <main+0x156>
cmpl   $0x0,-0x8(%rbp)
jne    12e5 <main+0x145>
lea    0xd57(%rip),%rdi
call   1030 <puts@plt>
jmp    12f1 <main+0x151>
lea    0xd59(%rip),%rdi
call   1030 <puts@plt>
jmp    12f6 <main+0x156>
jmp    12fb <main+0x15b>
lea    0xd4b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xe40(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1050 <Scan_Array@plt>
lea    0xe2e(%rip),%rbx
mov    %rbx,%rdi
call   1080 <Scan_Number@plt>
lea    0xe21(%rip),%r15
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   1090 <Print_Array@plt>
lea    0xe0d(%rip),%r12
mov    %r12,%rdi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   10d0 <Print_Number@plt>
lea    0xdfe(%rip),%r13
mov    %r13,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   10a0 <Copy_toNumber@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   10c0 <Copy_toArray@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10b0 <Copy_Number@plt>
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   1090 <Print_Array@plt>
mov    %r12,%rdi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   10d0 <Print_Number@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1070 <Logical_opp_Array_Number@plt>
add    $0x1,%eax
cmp    $0x2,%eax
ja     1290 <main+0xe0>
cltq
lea    0xdc9(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1297 <main+0xe7>
lea    0xdae(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
@.str.2 = [8 x i8] c"\0A A is \00"
@.str.3 = [8 x i8] c"\0A B is \00"
@.str.4 = [2 x i8] c"c\00"
@.str.5 = [14 x i8] c"\0AA is greater\00"
@.str.6 = [14 x i8] c"\0AB is greater\00"
@.str.7 = [19 x i8] c"\0AA and B are equal\00"
@.str.8 = [8 x i8] c"Invalid\00"
@.str.9 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @Scan_Array(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @Scan_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @Print_Array(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @Print_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @Copy_toNumber(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%10 = call i32 @Copy_toArray(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @Copy_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @Print_Array(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @Print_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @Logical_opp_Array_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %0
%20 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %35
21: ; preds = %0
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
br label %34
26: ; preds = %21
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
br label %33
31: ; preds = %26
%32 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
br label %34
34: ; preds = %33, %24
br label %35
35: ; preds = %34, %19
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
@.str.2 = [8 x i8] c"\0A A is \00"
@.str.3 = [8 x i8] c"\0A B is \00"
@.str.4 = [2 x i8] c"c\00"
@.str.5 = [14 x i8] c"\0AA is greater\00"
@.str.6 = [14 x i8] c"\0AB is greater\00"
@.str.7 = [19 x i8] c"\0AA and B are equal\00"
@.str.8 = [8 x i8] c"Invalid\00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.6 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.7 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.5 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = tail call i32 @Scan_Array(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @Scan_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @Print_Array(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @Print_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @Copy_toNumber(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = tail call i32 @Copy_toArray(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @Copy_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32 @Print_Array(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%13 = tail call i32 @Print_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @Logical_opp_Array_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = add i32 %14, 1
%16 = icmp ult i32 %15, 3
br i1 %16, label %17, label %21
17: ; preds = %0
%18 = sext i32 %15 to i64
%19 = shl i64 %18, 2
%20 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.main to i8*), i64 %19)
br label %21
21: ; preds = %0, %17
%22 = phi i8* [ %20, %17 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), %0 ]
%23 = tail call i32 @puts(i8* dereferenceable(1) %22)
%24 = tail call i32 @putchar(i32 10)
ret i32 0
}