#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*/ Delay_Printf(char *, char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int Call_C_Arg_Double(int offset, double dbl_val) {
  int *p = (int *)&dbl_val;
  {
    char r[4];
    if (offset < 6)
      sprintf(r, "%%o%d", offset);
    else
      strcpy(r, "%l7");
    ;
    Delay_Printf("sethi", "%%hi(%d),%s", p[0], r);
    Delay_Printf("or", "%s,%%lo(%d),%s", r, p[0], r);
    if (offset >= 6)
      Delay_Printf("st", "%s,[%%sp+%d]", r, 92 + (offset - 6) * 4);
  };
  offset++;
  {
    char r[4];
    if (offset < 6)
      sprintf(r, "%%o%d", offset);
    else
      strcpy(r, "%l7");
    ;
    Delay_Printf("sethi", "%%hi(%d),%s", p[1], r);
    Delay_Printf("or", "%s,%%lo(%d),%s", r, p[1], r);
    if (offset >= 6)
      Delay_Printf("st", "%s,[%%sp+%d]", r, 92 + (offset - 6) * 4);
  };
  return 2;
}


x86 assembly (clang, -O0):
<Call_C_Arg_Double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x6,-0x4(%rbp)
jge    116a <Call_C_Arg_Double+0x3a>
lea    -0x1c(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea0(%rip),%rsi
call   1040 <sprintf@plt>
jmp    117a <Call_C_Arg_Double+0x4a>
lea    -0x1c(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    -0x1c(%rbp),%rcx
lea    0xe7f(%rip),%rdi
lea    0xe7e(%rip),%rsi
mov    $0x0,%al
call   1050 <Delay_Printf@plt>
lea    -0x1c(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    -0x1c(%rbp),%r8
lea    0xe6e(%rip),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1050 <Delay_Printf@plt>
cmpl   $0x6,-0x4(%rbp)
jl     11eb <Call_C_Arg_Double+0xbb>
lea    -0x1c(%rbp),%rdx
mov    -0x4(%rbp),%ecx
sub    $0x6,%ecx
shl    $0x2,%ecx
add    $0x5c,%ecx
lea    0xe51(%rip),%rdi
lea    0xe4d(%rip),%rsi
mov    $0x0,%al
call   1050 <Delay_Printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x6,-0x4(%rbp)
jge    1216 <Call_C_Arg_Double+0xe6>
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xdf4(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1226 <Call_C_Arg_Double+0xf6>
lea    -0x20(%rbp),%rdi
lea    0xde5(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
lea    -0x20(%rbp),%rcx
lea    0xdd2(%rip),%rdi
lea    0xdd1(%rip),%rsi
mov    $0x0,%al
call   1050 <Delay_Printf@plt>
lea    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
lea    -0x20(%rbp),%r8
lea    0xdc0(%rip),%rdi
lea    0xdbc(%rip),%rsi
mov    $0x0,%al
call   1050 <Delay_Printf@plt>
cmpl   $0x6,-0x4(%rbp)
jl     1299 <Call_C_Arg_Double+0x169>
lea    -0x20(%rbp),%rdx
mov    -0x4(%rbp),%ecx
sub    $0x6,%ecx
shl    $0x2,%ecx
add    $0x5c,%ecx
lea    0xda3(%rip),%rdi
lea    0xd9f(%rip),%rsi
mov    $0x0,%al
call   1050 <Delay_Printf@plt>
mov    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Call_C_Arg_Double>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edi,%r14d
cmp    $0x5,%edi
jg     115d <Call_C_Arg_Double+0x2d>
lea    0xeb2(%rip),%rsi
lea    0x4(%rsp),%rdi
mov    %r14d,%edx
call   1040 <sprintf@plt>
jmp    116e <Call_C_Arg_Double+0x3e>
lea    0xea2(%rip),%rsi
lea    0x4(%rsp),%rdi
call   1030 <strcpy@plt>
movq   0x8(%rsp),%xmm0
movq   %xmm0,%rbx
lea    0xe8a(%rip),%rdi
lea    0xe89(%rip),%rsi
lea    0x4(%rsp),%r15
mov    %ebx,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1050 <Delay_Printf@plt>
lea    0xe7d(%rip),%rdi
lea    0xe79(%rip),%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
mov    %r15,%r8
xor    %eax,%eax
call   1050 <Delay_Printf@plt>
cmp    $0x6,%r14d
jl     11df <Call_C_Arg_Double+0xaf>
lea    0x44(,%r14,4),%ecx
lea    0xe64(%rip),%rdi
lea    0xe60(%rip),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1050 <Delay_Printf@plt>
jmp    11e5 <Call_C_Arg_Double+0xb5>
cmp    $0x5,%r14d
jne    11f6 <Call_C_Arg_Double+0xc6>
lea    0xe1a(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
jmp    1209 <Call_C_Arg_Double+0xd9>
lea    0x1(%r14),%edx
lea    0xdff(%rip),%rsi
mov    %rsp,%rdi
call   1040 <sprintf@plt>
shr    $0x20,%rbx
lea    0xdf6(%rip),%rdi
lea    0xdf5(%rip),%rsi
mov    %rsp,%r15
mov    %ebx,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1050 <Delay_Printf@plt>
lea    0xdeb(%rip),%rdi
lea    0xde7(%rip),%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
mov    %r15,%r8
xor    %eax,%eax
call   1050 <Delay_Printf@plt>
cmp    $0x5,%r14d
jl     126d <Call_C_Arg_Double+0x13d>
lea    0x48(,%r14,4),%ecx
lea    0xdd2(%rip),%rdi
lea    0xdce(%rip),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1050 <Delay_Printf@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%%o%d\00"
@.str.1 = [4 x i8] c"%l7\00"
@.str.2 = [6 x i8] c"sethi\00"
@.str.3 = [12 x i8] c"%%hi(%d),%s\00"
@.str.4 = [3 x i8] c"or\00"
@.str.5 = [15 x i8] c"%s,%%lo(%d),%s\00"
@.str.6 = [3 x i8] c"st\00"
@.str.7 = [13 x i8] c"%s,[%%sp+%d]\00"
define i32 @Call_C_Arg_Double(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32*
%6 = alloca [4 x i8]
%7 = alloca [4 x i8]
store i32 %0, i32* %3
store double %1, double* %4
%8 = bitcast double* %4 to i32*
store i32* %8, i32** %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 6
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* %3
%14 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %18
15: ; preds = %2
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %11
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%23 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %21, i8* %22)
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 0
%27 = load i32, i32* %26
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%29 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %24, i32 %27, i8* %28)
%30 = load i32, i32* %3
%31 = icmp sge i32 %30, 6
br i1 %31, label %32, label %39
32: ; preds = %18
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%34 = load i32, i32* %3
%35 = sub nsw i32 %34, 6
%36 = mul nsw i32 %35, 4
%37 = add nsw i32 92, %36
%38 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %33, i32 %37)
br label %39
39: ; preds = %32, %18
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
%42 = load i32, i32* %3
%43 = icmp slt i32 %42, 6
br i1 %43, label %44, label %48
44: ; preds = %39
%45 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%46 = load i32, i32* %3
%47 = call i32 @sprintf(i8* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %46)
br label %51
48: ; preds = %39
%49 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%50 = call i32 @strcpy(i8* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %51
51: ; preds = %48, %44
%52 = load i32*, i32** %5
%53 = getelementptr inbounds i32, i32* %52, i64 1
%54 = load i32, i32* %53
%55 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%56 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %54, i8* %55)
%57 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%58 = load i32*, i32** %5
%59 = getelementptr inbounds i32, i32* %58, i64 1
%60 = load i32, i32* %59
%61 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%62 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %57, i32 %60, i8* %61)
%63 = load i32, i32* %3
%64 = icmp sge i32 %63, 6
br i1 %64, label %65, label %72
65: ; preds = %51
%66 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%67 = load i32, i32* %3
%68 = sub nsw i32 %67, 6
%69 = mul nsw i32 %68, 4
%70 = add nsw i32 92, %69
%71 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %66, i32 %70)
br label %72
72: ; preds = %65, %51
ret i32 2
}

LLVM IR (-O2):
@.str = [6 x i8] c"%%o%d\00"
@.str.1 = [4 x i8] c"%l7\00"
@.str.2 = [6 x i8] c"sethi\00"
@.str.3 = [12 x i8] c"%%hi(%d),%s\00"
@.str.4 = [3 x i8] c"or\00"
@.str.5 = [15 x i8] c"%s,%%lo(%d),%s\00"
@.str.6 = [3 x i8] c"st\00"
@.str.7 = [13 x i8] c"%s,[%%sp+%d]\00"
define i32 @Call_C_Arg_Double(i32 %0, double %1) {
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = icmp slt i32 %0, 6
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %11
9: ; preds = %2
%10 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = bitcast double %1 to i64
%13 = trunc i64 %12 to i32
%14 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %13, i8* %5)
%15 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %5, i32 %13, i8* %5)
%16 = icmp sgt i32 %0, 5
br i1 %16, label %17, label %22
17: ; preds = %11
%18 = shl i32 %0, 2
%19 = add i32 %18, 68
%20 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %5, i32 %19)
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
br label %28
22: ; preds = %11
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%24 = icmp eq i32 %0, 5
br i1 %24, label %28, label %25
25: ; preds = %22
%26 = add nsw i32 %0, 1
%27 = call i32 @sprintf(i8* %23, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %26)
br label %31
28: ; preds = %17, %22
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%30 = call i32 @strcpy(i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %28, %25
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%33 = lshr i64 %12, 32
%34 = trunc i64 %33 to i32
%35 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %34, i8* %32)
%36 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %32, i32 %34, i8* %32)
%37 = icmp sgt i32 %0, 4
br i1 %37, label %38, label %42
38: ; preds = %31
%39 = shl i32 %0, 2
%40 = add i32 %39, 72
%41 = call i32 (i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %32, i32 %40)
br label %42
42: ; preds = %38, %31
ret i32 2
}