#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 feed_utf8_code {
  int dummy;
};
struct feed_text {
  int dummy;
};
struct feed_line {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ feed_line_write_utf8_code(struct feed_line *,
                                             struct feed_utf8_code const *const,
                                             unsigned long const);
struct feed_line *feed_text_get_line(struct feed_text *const,
                                     unsigned long const);
void feed_text_write_utf8_code(struct feed_text *const p_text,
                               struct feed_utf8_code const *const p_utf8_code,
                               unsigned long int const i_line_index,
                               unsigned long int const i_glyph_index) {
  struct feed_line *p_line;
  p_line = feed_text_get_line(p_text, i_line_index);
  if (p_line) {
    feed_line_write_utf8_code(p_line, p_utf8_code, i_glyph_index);
  }
}


x86 assembly (clang, -O0):
<feed_text_write_utf8_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <feed_text_get_line@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1165 <feed_text_write_utf8_code+0x45>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <feed_line_write_utf8_code@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_text_write_utf8_code>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdx,%rsi
call   1030 <feed_text_get_line@plt>
test   %rax,%rax
je     114c <feed_text_write_utf8_code+0x2c>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <feed_line_write_utf8_code@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.feed_text = type { i32 }
%struct.feed_utf8_code = type { i32 }
%struct.feed_line = type { i32 }
define void @feed_text_write_utf8_code(%struct.feed_text* %0, %struct.feed_utf8_code* %1, i64 %2, i64 %3) {
%5 = alloca %struct.feed_text*
%6 = alloca %struct.feed_utf8_code*
%7 = alloca i64
%8 = alloca i64
%9 = alloca %struct.feed_line*
store %struct.feed_text* %0, %struct.feed_text** %5
store %struct.feed_utf8_code* %1, %struct.feed_utf8_code** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load %struct.feed_text*, %struct.feed_text** %5
%11 = load i64, i64* %7
%12 = call %struct.feed_line* @feed_text_get_line(%struct.feed_text* %10, i64 %11)
store %struct.feed_line* %12, %struct.feed_line** %9
%13 = load %struct.feed_line*, %struct.feed_line** %9
%14 = icmp ne %struct.feed_line* %13, null
br i1 %14, label %15, label %20
15: ; preds = %4
%16 = load %struct.feed_line*, %struct.feed_line** %9
%17 = load %struct.feed_utf8_code*, %struct.feed_utf8_code** %6
%18 = load i64, i64* %8
%19 = call i32 @feed_line_write_utf8_code(%struct.feed_line* %16, %struct.feed_utf8_code* %17, i64 %18)
br label %20
20: ; preds = %15, %4
ret void
}

LLVM IR (-O2):
%struct.feed_text = type { i32 }
%struct.feed_utf8_code = type { i32 }
%struct.feed_line = type { i32 }
define void @feed_text_write_utf8_code(%struct.feed_text* %0, %struct.feed_utf8_code* %1, i64 %2, i64 %3) {
%5 = tail call %struct.feed_line* @feed_text_get_line(%struct.feed_text* %0, i64 %2)
%6 = icmp eq %struct.feed_line* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @feed_line_write_utf8_code(%struct.feed_line* %5, %struct.feed_utf8_code* %1, i64 %3)
br label %9
9: ; preds = %7, %4
ret void
}