#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_address(struct generator *, struct node *);
int /*<<< orphan*/ w(struct generator *, char *);
int /*<<< orphan*/ write_comment(struct generator *, struct node *);
int /*<<< orphan*/ writef(struct generator *, char *, struct node *);
void generate_slicefrom(struct generator *g, struct node *p) {
  write_comment(g, p);
  w(g, "~Mslice_from(");
  generate_address(g, p);
  writef(g, ");~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),%rsi
call   1040 <write_comment@plt>
mov    -0x8(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1050 <w@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <generate_address@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe85(%rip),%rsi
call   1060 <writef@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
call   1040 <write_comment@plt>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1050 <w@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <generate_address@plt>
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <writef@plt>

LLVM IR (-O0):
%struct.generator = type { i32 }
%struct.node = type { i32 }
@.str = [14 x i8] c"~Mslice_from(\00"
@.str.1 = [5 x i8] c");~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 @write_comment(%struct.generator* %5, %struct.node* %6)
%8 = load %struct.generator*, %struct.generator** %3
%9 = call i32 @w(%struct.generator* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = load %struct.generator*, %struct.generator** %3
%11 = load %struct.node*, %struct.node** %4
%12 = call i32 @generate_address(%struct.generator* %10, %struct.node* %11)
%13 = load %struct.generator*, %struct.generator** %3
%14 = load %struct.node*, %struct.node** %4
%15 = call i32 @writef(%struct.generator* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.node* %14)
ret void
}

LLVM IR (-O2):
%struct.generator = type { i32 }
%struct.node = type { i32 }
@.str = [14 x i8] c"~Mslice_from(\00"
@.str.1 = [5 x i8] c");~N\00"
define void @generate_slicefrom(%struct.generator* %0, %struct.node* %1) {
%3 = tail call i32 @write_comment(%struct.generator* %0, %struct.node* %1)
%4 = tail call i32 @w(%struct.generator* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @generate_address(%struct.generator* %0, %struct.node* %1)
%6 = tail call i32 @writef(%struct.generator* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.node* %1)
ret void
}