#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 */
struct lsuper {
  int dummy;
};
struct lobject {
  int dummy;
};
struct lemon {
  int dummy;
};
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
struct lobject *lstring_create(struct lemon *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *);
int /*<<< orphan*/ strlen(char *);
struct lobject *lsuper_string(struct lemon *lemon, struct lsuper *self) {
  char buffer[9];
  snprintf(buffer, sizeof(buffer), "<super>");
  buffer[sizeof(buffer) - 1] = '\0';
  return lstring_create(lemon, buffer, strlen(buffer));
}


x86 assembly (clang, -O0):
<lsuper_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x19(%rbp),%rdi
mov    $0x9,%esi
lea    0xeb0(%rip),%rdx
call   1040 <snprintf@plt>
movb   $0x0,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x19(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x19(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1050 <lstring_create@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsuper_string>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
lea    0xebf(%rip),%rdx
lea    0xf(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <snprintf@plt>
movb   $0x0,0x17(%rsp)
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <lstring_create@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.lobject = type { i32 }
%struct.lemon = type { i32 }
%struct.lsuper = type { i32 }
@.str = [8 x i8] c"<super>\00"
define %struct.lobject* @lsuper_string(%struct.lemon* %0, %struct.lsuper* %1) {
%3 = alloca %struct.lemon*
%4 = alloca %struct.lsuper*
%5 = alloca [9 x i8]
store %struct.lemon* %0, %struct.lemon** %3
store %struct.lsuper* %1, %struct.lsuper** %4
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 8
store i8 0, i8* %8
%9 = load %struct.lemon*, %struct.lemon** %3
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call %struct.lobject* @lstring_create(%struct.lemon* %9, i8* %10, i32 %12)
ret %struct.lobject* %13
}

LLVM IR (-O2):
%struct.lobject = type { i32 }
%struct.lemon = type { i32 }
%struct.lsuper = type { i32 }
@.str = [8 x i8] c"<super>\00"
define %struct.lobject* @lsuper_string(%struct.lemon* %0, %struct.lsuper* nocapture readnone %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 8
store i8 0, i8* %6
%7 = call i32 @strlen(i8* %4)
%8 = call %struct.lobject* @lstring_create(%struct.lemon* %0, i8* %4, i32 %7)
ret %struct.lobject* %8
}