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


x86 assembly (clang, -O0):
<Call_C_Arg_String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x6,-0x4(%rbp)
jge    1160 <Call_C_Arg_String+0x30>
lea    -0xc(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeaa(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1170 <Call_C_Arg_String+0x40>
lea    -0xc(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%ecx
lea    -0xc(%rbp),%r8
lea    0xe8c(%rip),%rdi
lea    0xe8b(%rip),%rsi
lea    0xe92(%rip),%rdx
mov    $0x0,%al
call   1050 <Delay_Printf@plt>
lea    -0xc(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    -0xc(%rbp),%r9
lea    0xe7c(%rip),%rdi
lea    0xe78(%rip),%rsi
lea    0xe6a(%rip),%rcx
mov    $0x0,%al
call   1050 <Delay_Printf@plt>
cmpl   $0x6,-0x4(%rbp)
jl     11ea <Call_C_Arg_String+0xba>
lea    -0xc(%rbp),%rdx
mov    -0x4(%rbp),%ecx
sub    $0x6,%ecx
shl    $0x2,%ecx
add    $0x5c,%ecx
lea    0xe5a(%rip),%rdi
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1050 <Delay_Printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Call_C_Arg_String>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %edi,%ebx
cmp    $0x5,%edi
jg     1156 <Call_C_Arg_String+0x26>
lea    0xeb8(%rip),%rsi
lea    0x4(%rsp),%rdi
mov    %ebx,%edx
call   1040 <sprintf@plt>
jmp    1167 <Call_C_Arg_String+0x37>
lea    0xea9(%rip),%rsi
lea    0x4(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xe9c(%rip),%rdi
lea    0xe9b(%rip),%rsi
lea    0xea2(%rip),%r14
lea    0x4(%rsp),%rbp
mov    %r14,%rdx
mov    %r15d,%ecx
mov    %rbp,%r8
xor    %eax,%eax
call   1050 <Delay_Printf@plt>
lea    0xe8a(%rip),%rdi
lea    0xe86(%rip),%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
mov    %r15d,%r8d
mov    %rbp,%r9
xor    %eax,%eax
call   1050 <Delay_Printf@plt>
cmp    $0x6,%ebx
jl     11d8 <Call_C_Arg_String+0xa8>
lea    0x44(,%rbx,4),%ecx
lea    0xe71(%rip),%rdi
lea    0xe6d(%rip),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1050 <Delay_Printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
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 = [14 x i8] c"%%hi(%s%d),%s\00"
@.str.4 = [4 x i8] c".LC\00"
@.str.5 = [3 x i8] c"or\00"
@.str.6 = [17 x i8] c"%s,%%lo(%s%d),%s\00"
@.str.7 = [3 x i8] c"st\00"
@.str.8 = [13 x i8] c"%s,[%%sp+%d]\00"
define i32 @Call_C_Arg_String(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %15
12: ; preds = %2
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %12, %8
%16 = load i32, i32* %4
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%18 = call i32 (i8*, i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %16, i8* %17)
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%20 = load i32, i32* %4
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%22 = call i32 (i8*, i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %20, i8* %21)
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 6
br i1 %24, label %25, label %32
25: ; preds = %15
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%27 = load i32, i32* %3
%28 = sub nsw i32 %27, 6
%29 = mul nsw i32 %28, 4
%30 = add nsw i32 92, %29
%31 = call i32 (i8*, i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %26, i32 %30)
br label %32
32: ; preds = %25, %15
ret i32 1
}

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 = [14 x i8] c"%%hi(%s%d),%s\00"
@.str.4 = [4 x i8] c".LC\00"
@.str.5 = [3 x i8] c"or\00"
@.str.6 = [17 x i8] c"%s,%%lo(%s%d),%s\00"
@.str.7 = [3 x i8] c"st\00"
@.str.8 = [13 x i8] c"%s,[%%sp+%d]\00"
define i32 @Call_C_Arg_String(i32 %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 6
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
8: ; preds = %2
%9 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = call i32 (i8*, i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %1, i8* %4)
%12 = call i32 (i8*, i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %1, i8* %4)
%13 = icmp sgt i32 %0, 5
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = shl i32 %0, 2
%16 = add i32 %15, 68
%17 = call i32 (i8*, i8*, i8*, ...) @Delay_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %4, i32 %16)
br label %18
18: ; preds = %14, %10
ret i32 1
}