#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*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, float, int);
int main(int argc, char *argv[]) {
  int i = 0, num;
  float pet = 0.0;
  int (*qfun)(float *);
  int (*getbuiltout(int))(float *);
  num = (argc > 1) ? atoi(argv[1]) : 0;
  qfun = getbuiltout(num);
  if (qfun != NULL) {
    i = qfun(&pet);
    printf("number in float %f and returns %d\n", pet, i);
    exit(EXIT_SUCCESS);
  } else
    exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1184 <main+0x44>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x2c(%rbp)
jmp    118e <main+0x4e>
xor    %eax,%eax
mov    %eax,-0x2c(%rbp)
jmp    118e <main+0x4e>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <getbuiltout@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11d7 <main+0x97>
lea    -0x1c(%rbp),%rdi
call   *-0x28(%rbp)
mov    %eax,-0x14(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0x14(%rbp),%esi
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
movl   $0x0,0x4(%rsp)
xor    %edi,%edi
cmp    $0x2,%eax
jl     115d <main+0x1d>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <getbuiltout@plt>
test   %rax,%rax
jne    1175 <main+0x35>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    0x4(%rsp),%rdi
call   *%rax
movss  0x4(%rsp),%xmm0
lea    0xe77(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"number in float %f and returns %d\0A\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca i32 (float*)*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store float 0.000000e+00, float* %8
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %12
%19 = phi i32 [ %16, %12 ], [ 0, %17 ]
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = call i32 (float*)* @getbuiltout(i32 %20)
store i32 (float*)* %21, i32 (float*)** %9
%22 = load i32 (float*)*, i32 (float*)** %9
%23 = icmp ne i32 (float*)* %22, null
br i1 %23, label %24, label %32
24: ; preds = %18
%25 = load i32 (float*)*, i32 (float*)** %9
%26 = call i32 %25(float* %8)
store i32 %26, i32* %6
%27 = load float, float* %8
%28 = load i32, i32* %6
%29 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), float %27, i32 %28)
%30 = load i32, i32* @EXIT_SUCCESS
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %18
%33 = load i32, i32* @EXIT_FAILURE
%34 = call i32 @exit(i32 %33)
unreachable
}

LLVM IR (-O2):
@.str = [35 x i8] c"number in float %f and returns %d\0A\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
%12 = tail call i32 (float*)* @getbuiltout(i32 %11)
%13 = icmp eq i32 (float*)* %12, null
br i1 %13, label %20, label %14
14: ; preds = %10
%15 = call i32 %12(float* %3)
%16 = load float, float* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), float %16, i32 %15)
%18 = load i32, i32* @EXIT_SUCCESS
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %10
%21 = load i32, i32* @EXIT_FAILURE
%22 = tail call i32 @exit(i32 %21)
unreachable
}