#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 EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int iso226_phon2spl(double, double, double *);
char *iso226_strerror(int);
int /*<<< orphan*/ parse_options(int, char **);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ stderr;
double strtod(char *, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  double fon = 0;
  double freq = 0;
  double res = 0;
  int ret;
  parse_options(argc, argv);
  fon = strtod(argv[1], NULL);
  freq = strtod(argv[2], NULL);
  ret = iso226_phon2spl(fon, freq, &res);
  if (ret != 0) {
    fprintf(stderr, "%s\n", iso226_strerror(ret));
    return ret;
  }
  printf("%f\n", res);
  return EXIT_SUCCESS;
}


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)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <parse_options@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    -0x28(%rbp),%rdi
call   1070 <iso226_phon2spl@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     1217 <main+0xb7>
mov    0x2df3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%edi
call   1080 <iso226_strerror@plt>
mov    -0x30(%rbp),%edi
mov    %rax,%rdx
lea    0xdf9(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1234 <main+0xd4>
movsd  -0x28(%rbp),%xmm0
lea    0xde1(%rip),%rdi
call   1050 <printf@plt>
mov    0x2da9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
movq   $0x0,0x8(%rsp)
call   1040 <parse_options@plt>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
movsd  %xmm0,0x10(%rsp)
mov    0x10(%rbx),%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
movaps %xmm0,%xmm1
lea    0x8(%rsp),%rdi
movsd  0x10(%rsp),%xmm0
call   1070 <iso226_phon2spl@plt>
test   %eax,%eax
je     11cf <main+0x6f>
mov    %eax,%ebx
mov    0x2e2d(%rip),%rax
mov    (%rax),%ebp
mov    %ebx,%edi
call   1080 <iso226_strerror@plt>
lea    0xe3d(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
call   1060 <fprintf@plt>
jmp    11ea <main+0x8a>
movsd  0x8(%rsp),%xmm0
lea    0xe28(%rip),%rdi
call   1050 <printf@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
store double 0.000000e+00, double* %8
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @parse_options(i32 %10, i8** %11)
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call double @strtod(i8* %15, i32* null)
store double %16, double* %6
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call double @strtod(i8* %19, i32* null)
store double %20, double* %7
%21 = load double, double* %6
%22 = load double, double* %7
%23 = call i32 @iso226_phon2spl(double %21, double %22, double* %8)
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %2
%27 = load i32, i32* @stderr
%28 = load i32, i32* %9
%29 = call i8* @iso226_strerror(i32 %28)
%30 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %29)
%31 = load i32, i32* %9
store i32 %31, i32* %3
br label %36
32: ; preds = %2
%33 = load double, double* %8
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %33)
%35 = load i32, i32* @EXIT_SUCCESS
store i32 %35, i32* %3
br label %36
36: ; preds = %32, %26
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%5 = tail call i32 @parse_options(i32 %0, i8** %1)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call double @strtod(i8* nocapture %7, i32* null)
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call double @strtod(i8* nocapture %10, i32* null)
%12 = call i32 @iso226_phon2spl(double %8, double %11, double* %3)
%13 = icmp eq i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = call i8* @iso226_strerror(i32 %12)
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %22
18: ; preds = %2
%19 = load double, double* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %19)
%21 = load i32, i32* @EXIT_SUCCESS
br label %22
22: ; preds = %18, %14
%23 = phi i32 [ %12, %14 ], [ %21, %18 ]
ret i32 %23
}