#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 */
double atof(char *);
int atoi(char *);
int /*<<< orphan*/ printf(char *);
main(int argc, char **argv) {
  int i;
  double j;
  i = atoi(argv[1]);
  j = atof(argv[2]);
  if (i < (int)j)
    printf("integer <  truncated double\n");
  else if (i == (int)j)
    printf("integer = truncated double\n");
  else
    printf("integer > truncated double\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cvttsd2si -0x20(%rbp),%ecx
cmp    %ecx,%eax
jge    1189 <main+0x59>
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
jmp    11bb <main+0x8b>
mov    -0x14(%rbp),%eax
cvttsd2si -0x20(%rbp),%ecx
cmp    %ecx,%eax
jne    11aa <main+0x7a>
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
jmp    11b6 <main+0x86>
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
jmp    11bb <main+0x8b>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atof@plt>
cvttsd2si %xmm0,%eax
cmp    %eax,%ebp
lea    0xec4(%rip),%rax
lea    0xea2(%rip),%rcx
cmove  %rax,%rcx
lea    0xecd(%rip),%rdi
cmovge %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"integer < truncated double\0A\00"
@.str.1 = [28 x i8] c"integer = truncated double\0A\00"
@.str.2 = [28 x i8] c"integer > truncated double\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call double @atof(i8* %14)
store double %15, double* %7
%16 = load i32, i32* %6
%17 = load double, double* %7
%18 = fptosi double %17 to i32
%19 = icmp slt i32 %16, %18
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %32
22: ; preds = %2
%23 = load i32, i32* %6
%24 = load double, double* %7
%25 = fptosi double %24 to i32
%26 = icmp eq i32 %23, %25
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %31
29: ; preds = %22
%30 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %27
br label %32
32: ; preds = %31, %20
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@str = [27 x i8] c"integer > truncated double\00"
@str.3 = [27 x i8] c"integer = truncated double\00"
@str.4 = [28 x i8] c"integer < truncated double\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call double @atof(i8* %7)
%9 = fptosi double %8 to i32
%10 = icmp slt i32 %5, %9
%11 = icmp eq i32 %5, %9
%12 = select i1 %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0)
%13 = select i1 %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0), i8* %12
%14 = tail call i32 @puts(i8* dereferenceable(1) %13)
ret i32 0
}