#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int fig02_13() {
  int num1;
  int num2;
  printf("Enter to integers,and I will tell you\n");
  printf("the relationships they satisfy: ");
  scanf("%d%d", &num1, &num2);
  if (num1 == num2) {
    printf("%d is equal to %d\n", num1, num2);
  }
  if (num1 != num2) {
    printf("%d is not equal to %d\n", num1, num2);
  }
  if (num1 < num2) {
    printf("%d is less than %d\n", num1, num2);
  }
  if (num1 > num2) {
    printf("%d is greater than %d\n", num1, num2);
  }
  if (num1 <= num2) {
    printf("%d is less than or equal to %d", num1, num2);
  }
  if (num1 >= num2) {
    printf("%d is more than or equal to %d", num1, num2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<fig02_13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1178 <fig02_13+0x58>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1198 <fig02_13+0x78>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b8 <fig02_13+0x98>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11d8 <fig02_13+0xb8>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11f8 <fig02_13+0xd8>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1218 <fig02_13+0xf8>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig02_13>:
push   %rax
lea    0xf81(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%eax
cmp    %eax,%esi
jne    1181 <fig02_13+0x51>
lea    0xeb5(%rip),%rdi
mov    %esi,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%eax
cmp    %eax,%esi
jne    1189 <fig02_13+0x59>
mov    %eax,%edx
jmp    11fa <fig02_13+0xca>
lea    0xea9(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%edx
cmp    %edx,%eax
jl     11c4 <fig02_13+0x94>
cmp    %edx,%eax
jg     11df <fig02_13+0xaf>
cmp    %edx,%eax
jle    11fa <fig02_13+0xca>
cmp    %edx,%eax
jl     11c0 <fig02_13+0x90>
lea    0xee3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe85(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%edx
cmp    %edx,%eax
jle    11a8 <fig02_13+0x78>
lea    0xe7e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%edx
cmp    %edx,%eax
jg     11ac <fig02_13+0x7c>
lea    0xe7a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%edx
cmp    %edx,%eax
jge    11b0 <fig02_13+0x80>
jmp    11c0 <fig02_13+0x90>

LLVM IR (-O0):
@.str = [39 x i8] c"Enter to integers,and I will tell you\0A\00"
@.str.1 = [33 x i8] c"the relationships they satisfy: \00"
@.str.2 = [5 x i8] c"%d%d\00"
@.str.3 = [19 x i8] c"%d is equal to %d\0A\00"
@.str.4 = [23 x i8] c"%d is not equal to %d\0A\00"
@.str.5 = [20 x i8] c"%d is less than %d\0A\00"
@.str.6 = [23 x i8] c"%d is greater than %d\0A\00"
@.str.7 = [31 x i8] c"%d is less than or equal to %d\00"
@.str.8 = [31 x i8] c"%d is more than or equal to %d\00"
define i32 @fig02_13() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %10, i32 %11)
br label %13
13: ; preds = %9, %0
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %18, i32 %19)
br label %21
21: ; preds = %17, %13
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i32, i32* %1
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %26, i32 %27)
br label %29
29: ; preds = %25, %21
%30 = load i32, i32* %1
%31 = load i32, i32* %2
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = load i32, i32* %1
%35 = load i32, i32* %2
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %34, i32 %35)
br label %37
37: ; preds = %33, %29
%38 = load i32, i32* %1
%39 = load i32, i32* %2
%40 = icmp sle i32 %38, %39
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = load i32, i32* %1
%43 = load i32, i32* %2
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i32 %42, i32 %43)
br label %45
45: ; preds = %41, %37
%46 = load i32, i32* %1
%47 = load i32, i32* %2
%48 = icmp sge i32 %46, %47
br i1 %48, label %49, label %53
49: ; preds = %45
%50 = load i32, i32* %1
%51 = load i32, i32* %2
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 %50, i32 %51)
br label %53
53: ; preds = %49, %45
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"the relationships they satisfy: \00"
@.str.2 = [5 x i8] c"%d%d\00"
@.str.3 = [19 x i8] c"%d is equal to %d\0A\00"
@.str.4 = [23 x i8] c"%d is not equal to %d\0A\00"
@.str.5 = [20 x i8] c"%d is less than %d\0A\00"
@.str.6 = [23 x i8] c"%d is greater than %d\0A\00"
@.str.7 = [31 x i8] c"%d is less than or equal to %d\00"
@.str.8 = [31 x i8] c"%d is more than or equal to %d\00"
@str = [38 x i8] c"Enter to integers,and I will tell you\00"
define i32 @fig02_13() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %8, i32 %8)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
br label %15
15: ; preds = %11, %0
%16 = phi i32 [ %14, %11 ], [ %9, %0 ]
%17 = phi i32 [ %13, %11 ], [ %8, %0 ]
%18 = icmp eq i32 %17, %16
br i1 %18, label %40, label %19
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %17, i32 %16)
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %19
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %21, i32 %22)
%26 = load i32, i32* %1
%27 = load i32, i32* %2
br label %28
28: ; preds = %24, %19
%29 = phi i32 [ %27, %24 ], [ %22, %19 ]
%30 = phi i32 [ %26, %24 ], [ %21, %19 ]
%31 = icmp sgt i32 %30, %29
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %30, i32 %29)
%34 = load i32, i32* %1
%35 = load i32, i32* %2
br label %36
36: ; preds = %32, %28
%37 = phi i32 [ %35, %32 ], [ %29, %28 ]
%38 = phi i32 [ %34, %32 ], [ %30, %28 ]
%39 = icmp sgt i32 %38, %37
br i1 %39, label %46, label %40
40: ; preds = %15, %36
%41 = phi i32 [ %38, %36 ], [ %16, %15 ]
%42 = phi i32 [ %37, %36 ], [ %16, %15 ]
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i32 %41, i32 %42)
%44 = load i32, i32* %1
%45 = load i32, i32* %2
br label %46
46: ; preds = %40, %36
%47 = phi i32 [ %45, %40 ], [ %37, %36 ]
%48 = phi i32 [ %44, %40 ], [ %38, %36 ]
%49 = icmp slt i32 %48, %47
br i1 %49, label %52, label %50
50: ; preds = %46
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 %48, i32 %47)
br label %52
52: ; preds = %50, %46
ret i32 0
}