#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 Logical_opp(char *, char *);
int /*<<< orphan*/ Print_Number(char *);
int /*<<< orphan*/ Scan_Number(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  Scan_Number("a");
  Scan_Number("b");
  printf("\n A is ");
  Print_Number("a");
  printf("\n B is ");
  Print_Number("b");
  Copy_Number("c", "a");
  Copy_Number("a", "b");
  Copy_Number("b", "c");
  printf("\n A is ");
  Print_Number("a");
  printf("\n B is ");
  Print_Number("b");
  int logical = Logical_opp("a", "b");
  if (logical == 1)
    puts("A is greater");
  else if (logical == -1)
    puts("B is greater");
  else if (logical == 0)
    puts("A 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    0xe8a(%rip),%rdi
call   1050 <Scan_Number@plt>
lea    0xe80(%rip),%rdi
call   1050 <Scan_Number@plt>
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
lea    0xe66(%rip),%rdi
call   1080 <Print_Number@plt>
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
lea    0xe50(%rip),%rdi
call   1080 <Print_Number@plt>
lea    0xe56(%rip),%rdi
lea    0xe3b(%rip),%rsi
call   1070 <Copy_Number@plt>
lea    0xe2f(%rip),%rdi
lea    0xe2a(%rip),%rsi
call   1070 <Copy_Number@plt>
lea    0xe1e(%rip),%rdi
lea    0xe29(%rip),%rsi
call   1070 <Copy_Number@plt>
lea    0xe0d(%rip),%rdi
call   1040 <printf@plt>
lea    0xdfd(%rip),%rdi
call   1080 <Print_Number@plt>
lea    0xdfd(%rip),%rdi
call   1040 <printf@plt>
lea    0xde7(%rip),%rdi
call   1080 <Print_Number@plt>
lea    0xdd9(%rip),%rdi
lea    0xdd4(%rip),%rsi
call   1060 <Logical_opp@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1251 <main+0xf1>
lea    0xdcf(%rip),%rdi
call   1030 <puts@plt>
jmp    129d <main+0x13d>
cmpl   $0xffffffff,-0x8(%rbp)
jne    126c <main+0x10c>
lea    0xdc1(%rip),%rdi
call   1030 <puts@plt>
jmp    1298 <main+0x138>
cmpl   $0x0,-0x8(%rbp)
jne    1287 <main+0x127>
lea    0xdb3(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <main+0x133>
lea    0xdb4(%rip),%rdi
call   1030 <puts@plt>
jmp    1298 <main+0x138>
jmp    129d <main+0x13d>
lea    0xda6(%rip),%rdi
call   1040 <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    0xe80(%rip),%r14
mov    %r14,%rdi
call   1060 <Scan_Number@plt>
lea    0xe73(%rip),%rbx
mov    %rbx,%rdi
call   1060 <Scan_Number@plt>
lea    0xe66(%rip),%r15
mov    %r15,%rdi
call   1050 <printf@plt>
mov    %r14,%rdi
call   1090 <Print_Number@plt>
lea    0xe57(%rip),%r12
mov    %r12,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1090 <Print_Number@plt>
lea    0xe48(%rip),%r13
mov    %r13,%rdi
mov    %r14,%rsi
call   1080 <Copy_Number@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1080 <Copy_Number@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1080 <Copy_Number@plt>
mov    %r15,%rdi
call   1050 <printf@plt>
mov    %r14,%rdi
call   1090 <Print_Number@plt>
mov    %r12,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1090 <Print_Number@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <Logical_opp@plt>
add    $0x1,%eax
cmp    $0x2,%eax
ja     1232 <main+0xc2>
cltq
lea    0xe23(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1239 <main+0xc9>
lea    0xe09(%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 = [13 x i8] c"A is greater\00"
@.str.6 = [13 x i8] c"B is greater\00"
@.str.7 = [18 x i8] c"A 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_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%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_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%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_Number(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))
%10 = call i32 @Copy_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), 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_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%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(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), 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 ([13 x i8], [13 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 ([13 x i8], [13 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 ([18 x i8], [18 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 = [13 x i8] c"A is greater\00"
@.str.6 = [13 x i8] c"B is greater\00"
@.str.7 = [18 x i8] c"A and B are equal\00"
@.str.8 = [8 x i8] c"Invalid\00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.6 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.7 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 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_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%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_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%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_Number(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))
%8 = tail call i32 @Copy_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), 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_Number(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%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(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), 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
}