#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 */
unsigned int atoi(char *);
scalar_t__ cuda_test_float(double, double, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  unsigned int n = 3;
  if (argc > 1)
    n = atoi(argv[1]);
  if (cuda_test_float(0.1234, 0.4567, ".") < 0)
    printf("Test failed\n");
  else
    printf("Test passed\n");
  return 0;
}


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)
movl   $0x3,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1167 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
movsd  0xe91(%rip),%xmm0
movsd  0xe91(%rip),%xmm1
lea    0xe92(%rip),%rdi
call   1040 <cuda_test_float@plt>
cmp    $0x0,%rax
jge    119e <main+0x6e>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
jmp    11aa <main+0x7a>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
movsd  0xed0(%rip),%xmm0
movsd  0xed0(%rip),%xmm1
call   1040 <cuda_test_float@plt>
test   %rax,%rax
lea    0xed7(%rip),%rax
lea    0xec4(%rip),%rdi
cmovs  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [13 x i8] c"Test failed\0A\00"
@.str.2 = [13 x i8] c"Test passed\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
br label %14
14: ; preds = %9, %2
%15 = call i64 @cuda_test_float(double 1.234000e-01, double 4.567000e-01, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %21
19: ; preds = %14
%20 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@str = [12 x i8] c"Test passed\00"
@str.3 = [12 x i8] c"Test failed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @cuda_test_float(double 1.234000e-01, double 4.567000e-01, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}