#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 /*<<< orphan*/ convert(double, char);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc == 2) {
    double temp = atof(argv[1]);
    convert(temp, 'C');
    printf("\n");
    convert(temp, 'K');
    printf("\n");
    convert(temp, 'F');
  } else if (argc == 3) {
    double temp = atof(argv[1]);
    convert(temp, *argv[2]);
  }
  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   $0x2,-0x8(%rbp)
jne    11ac <main+0x7c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x43,%edi
call   1030 <convert@plt>
lea    0xe88(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mov    $0x4b,%edi
call   1030 <convert@plt>
lea    0xe6d(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mov    $0x46,%edi
call   1030 <convert@plt>
jmp    11e2 <main+0xb2>
cmpl   $0x3,-0x8(%rbp)
jne    11dd <main+0xad>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%edi
call   1030 <convert@plt>
jmp    11e2 <main+0xb2>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
je     118c <main+0x5c>
cmp    $0x2,%edi
jne    11a1 <main+0x71>
mov    0x8(%rbx),%rdi
call   1050 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x43,%edi
call   1040 <convert@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x4b,%edi
call   1040 <convert@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x46,%edi
jmp    119c <main+0x6c>
mov    0x8(%rbx),%rdi
call   1050 <atof@plt>
mov    0x10(%rbx),%rax
movsbl (%rax),%edi
call   1040 <convert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %20 [
i32 2, label %3
i32 3, label %12
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call double @atof(i8* %5)
%7 = tail call i32 @convert(double %6, i8 signext 67)
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @convert(double %6, i8 signext 75)
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 @convert(double %6, i8 signext 70)
br label %20
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call double @atof(i8* %14)
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = tail call i32 @convert(double %15, i8 signext %18)
br label %20
20: ; preds = %2, %12, %3
ret i32 0
}