#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*/ newline();
int /*<<< orphan*/ output_line(char *);
int /*<<< orphan*/ output_string(char *);
gen_call(char *sname) {
  output_string("\tjal\t");
  if (*sname == '^') {
    output_string("__sc_");
    sname++;
  }
  output_string(sname);
  newline();
  output_line("nop");
}


x86 assembly (clang, -O0):
<gen_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <output_string@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5e,%eax
jne    1170 <gen_call+0x40>
lea    0xea7(%rip),%rdi
call   1040 <output_string@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <output_string@plt>
mov    $0x0,%al
call   1030 <newline@plt>
lea    0xe85(%rip),%rdi
call   1050 <output_line@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_call>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <output_string@plt>
cmpb   $0x5e,(%rbx)
jne    1155 <gen_call+0x25>
lea    0xeba(%rip),%rdi
call   1040 <output_string@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <output_string@plt>
xor    %eax,%eax
call   1030 <newline@plt>
lea    0xea1(%rip),%rdi
pop    %rbx
jmp    1050 <output_line@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\09jal\09\00"
@.str.1 = [6 x i8] c"__sc_\00"
@.str.2 = [4 x i8] c"nop\00"
define i32 @gen_call(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @output_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 94
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = call i32 @output_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %13
13: ; preds = %9, %1
%14 = load i8*, i8** %3
%15 = call i32 @output_string(i8* %14)
%16 = call i32 (...) @newline()
%17 = call i32 @output_line(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [6 x i8] c"\09jal\09\00"
@.str.1 = [6 x i8] c"__sc_\00"
@.str.2 = [4 x i8] c"nop\00"
define i32 @gen_call(i8* %0) {
%2 = tail call i32 @output_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 94
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @output_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds i8, i8* %0, i64 1
br label %8
8: ; preds = %5, %1
%9 = phi i8* [ %7, %5 ], [ %0, %1 ]
%10 = tail call i32 @output_string(i8* %9)
%11 = tail call i32 (...) @newline()
%12 = tail call i32 @output_line(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 undef
}