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

/* Variables and functions */
struct lobject *lstring_create(struct lemon *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, void *);
int /*<<< orphan*/ strlen(char *);
struct lobject *lcontinuation_string(struct lemon *lemon,
                                     struct lcontinuation *self) {
  char buffer[64];
  snprintf(buffer, sizeof(buffer), "<continuation %p>", (void *)self);
  buffer[sizeof(buffer) - 1] = '\0';
  return lstring_create(lemon, buffer, strlen(buffer));
}


x86 assembly (clang, -O0):
<lcontinuation_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x40,%esi
lea    0xeac(%rip),%rdx
call   1040 <snprintf@plt>
movb   $0x0,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    %eax,%edx
call   1050 <lstring_create@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcontinuation_string>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rcx
mov    %rdi,%r14
lea    0xebc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <snprintf@plt>
movb   $0x0,0x3f(%rsp)
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <lstring_create@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.lobject = type { i32 }
%struct.lemon = type { i32 }
%struct.lcontinuation = type { i32 }
@.str = [18 x i8] c"<continuation %p>\00"
define %struct.lobject* @lcontinuation_string(%struct.lemon* %0, %struct.lcontinuation* %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = bitcast %struct.lcontinuation* %1 to i8*
%6 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 63
store i8 0, i8* %7
%8 = call i32 @strlen(i8* %4)
%9 = call %struct.lobject* @lstring_create(%struct.lemon* %0, i8* %4, i32 %8)
ret %struct.lobject* %9
}