#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*/ printf(char *, double, double);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int main(int argc, char *argv[]) {
  double p = 0.0, q = 0.0;
  if (argc > 1) {
    sscanf(argv[1], "%lf", &p);
  }
  if (argc > 2) {
    sscanf(argv[2], "%lf", &q);
  }
  printf("M102 P%f Q%f: put your code here\n", p, q);
  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)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1168 <main+0x48>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea1(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <sscanf@plt>
cmpl   $0x2,-0x8(%rbp)
jle    118a <main+0x6a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe7f(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <sscanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
xorps  %xmm1,%xmm1
cmp    $0x2,%edi
jl     117d <main+0x5d>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xeb0(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1040 <sscanf@plt>
xorps  %xmm1,%xmm1
cmp    $0x2,%ebp
je     117d <main+0x5d>
mov    0x10(%rbx),%rdi
lea    0xe93(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1040 <sscanf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [34 x i8] c"M102 P%f Q%f: put your code here\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
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
br label %15
15: ; preds = %10, %2
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 2
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @sscanf(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
br label %23
23: ; preds = %18, %15
%24 = load double, double* %6
%25 = load double, double* %7
%26 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), double %24, double %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [34 x i8] c"M102 P%f Q%f: put your code here\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%6 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %4
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%12 = icmp eq i32 %0, 2
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%17 = load double, double* %4
br label %18
18: ; preds = %2, %13, %8
%19 = phi double [ 0.000000e+00, %2 ], [ %17, %13 ], [ 0.000000e+00, %8 ]
%20 = load double, double* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), double %20, double %19)
ret i32 0
}