#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 */
float atof(char *);
int atoi(char *);
int /*<<< orphan*/ checkArgument(int, int);
int /*<<< orphan*/ convertFloatToBin(float);
int /*<<< orphan*/ convertIntegToBin(int);
int main(int argc, char *argv[]) {
  int N = (argc == 3) ? atoi(argv[1]) : -1;
  checkArgument(argc, N);
  if (N == 1) {
    int X = atoi(argv[2]);
    convertIntegToBin(X);
  } else if (N == 2) {
    float X = atof(argv[2]);
    convertFloatToBin(X);
  } else
    ;
  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)
cmpl   $0x3,-0x8(%rbp)
jne    1185 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x20(%rbp)
jmp    1192 <main+0x42>
mov    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1192 <main+0x42>
mov    -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <checkArgument@plt>
cmpl   $0x1,-0x14(%rbp)
jne    11ca <main+0x7a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <convertIntegToBin@plt>
jmp    11ff <main+0xaf>
cmpl   $0x2,-0x14(%rbp)
jne    11f5 <main+0xa5>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atof@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1060 <convertFloatToBin@plt>
jmp    11fa <main+0xaa>
jmp    11fa <main+0xaa>
jmp    11ff <main+0xaf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x3,%edi
jne    118e <main+0x3e>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    $0x3,%edi
mov    %eax,%esi
call   1030 <checkArgument@plt>
cmp    $0x2,%ebp
je     119a <main+0x4a>
cmp    $0x1,%ebp
jne    11a8 <main+0x58>
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%edi
call   1040 <convertIntegToBin@plt>
jmp    11a8 <main+0x58>
mov    $0xffffffff,%esi
call   1030 <checkArgument@plt>
jmp    11a8 <main+0x58>
mov    0x10(%rbx),%rdi
call   1050 <atof@plt>
call   1060 <convertFloatToBin@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 3
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
br label %17
16: ; preds = %2
br label %17
17: ; preds = %16, %11
%18 = phi i32 [ %15, %11 ], [ -1, %16 ]
store i32 %18, i32* %6
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = call i32 @checkArgument(i32 %19, i32 %20)
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %31
24: ; preds = %17
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %7
%29 = load i32, i32* %7
%30 = call i32 @convertIntegToBin(i32 %29)
br label %43
31: ; preds = %17
%32 = load i32, i32* %6
%33 = icmp eq i32 %32, 2
br i1 %33, label %34, label %41
34: ; preds = %31
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call float @atof(i8* %37)
store float %38, float* %8
%39 = load float, float* %8
%40 = call i32 @convertFloatToBin(float %39)
br label %42
41: ; preds = %31
br label %42
42: ; preds = %41, %34
br label %43
43: ; preds = %42, %24
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @checkArgument(i32 %0, i32 -1)
br label %21
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @checkArgument(i32 3, i32 %9)
switch i32 %9, label %21 [
i32 1, label %11
i32 2, label %16
]
11: ; preds = %6
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = tail call i32 @convertIntegToBin(i32 %14)
br label %21
16: ; preds = %6
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = tail call float @atof(i8* %18)
%20 = tail call i32 @convertFloatToBin(float %19)
br label %21
21: ; preds = %4, %6, %16, %11
ret i32 0
}