#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 node {
  int dummy;
};
struct generator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ generate_data_address(struct generator *, struct node *);
int /*<<< orphan*/ wp(struct generator *, char *, struct node *);
void generate_slicefrom(struct generator *g, struct node *p) {
  wp(g, "~{int ret = slice_from_~$(z, ", p);
  generate_data_address(g, p);
  wp(g, ");~C", p);
  wp(g,
     "~Mif (ret < 0) return ret;~N"
     "~}",
     p);
}


x86 assembly (clang, -O0):
<generate_slicefrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rsi
call   1030 <wp@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <generate_data_address@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xebe(%rip),%rsi
call   1030 <wp@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1030 <wp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_slicefrom>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
mov    %r14,%rdx
call   1030 <wp@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <generate_data_address@plt>
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <wp@plt>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <wp@plt>

LLVM IR (-O0):
%struct.generator = type { i32 }
%struct.node = type { i32 }
@.str = [30 x i8] c"~{int ret = slice_from_~$(z, \00"
@.str.1 = [5 x i8] c");~C\00"
@.str.2 = [31 x i8] c"~Mif (ret < 0) return ret;~N~}\00"
define void @generate_slicefrom(%struct.generator* %0, %struct.node* %1) {
%3 = alloca %struct.generator*
%4 = alloca %struct.node*
store %struct.generator* %0, %struct.generator** %3
store %struct.node* %1, %struct.node** %4
%5 = load %struct.generator*, %struct.generator** %3
%6 = load %struct.node*, %struct.node** %4
%7 = call i32 @wp(%struct.generator* %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), %struct.node* %6)
%8 = load %struct.generator*, %struct.generator** %3
%9 = load %struct.node*, %struct.node** %4
%10 = call i32 @generate_data_address(%struct.generator* %8, %struct.node* %9)
%11 = load %struct.generator*, %struct.generator** %3
%12 = load %struct.node*, %struct.node** %4
%13 = call i32 @wp(%struct.generator* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.node* %12)
%14 = load %struct.generator*, %struct.generator** %3
%15 = load %struct.node*, %struct.node** %4
%16 = call i32 @wp(%struct.generator* %14, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), %struct.node* %15)
ret void
}

LLVM IR (-O2):
%struct.generator = type { i32 }
%struct.node = type { i32 }
@.str = [30 x i8] c"~{int ret = slice_from_~$(z, \00"
@.str.1 = [5 x i8] c");~C\00"
@.str.2 = [31 x i8] c"~Mif (ret < 0) return ret;~N~}\00"
define void @generate_slicefrom(%struct.generator* %0, %struct.node* %1) {
%3 = tail call i32 @wp(%struct.generator* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), %struct.node* %1)
%4 = tail call i32 @generate_data_address(%struct.generator* %0, %struct.node* %1)
%5 = tail call i32 @wp(%struct.generator* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.node* %1)
%6 = tail call i32 @wp(%struct.generator* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), %struct.node* %1)
ret void
}