#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 parser {
  int dummy;
};
struct cb_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cb_putc(struct cb_context *, char);
int /*<<< orphan*/ cb_puti(struct cb_context *, unsigned int);
int /*<<< orphan*/ cb_puts(struct cb_context *, char const *);
struct cb_context *parser_get_context(struct parser *);
void cb_error(struct parser *p, unsigned lineno, unsigned u8col,
              const char *msg) {
  struct cb_context *context = parser_get_context(p);
  cb_puts(context, "ERROR ");
  cb_puti(context, lineno);
  cb_putc(context, ':');
  cb_puti(context, u8col);
  cb_putc(context, ' ');
  cb_puts(context, msg);
  cb_putc(context, '\n');
}


x86 assembly (clang, -O0):
<cb_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <parser_get_context@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1050 <cb_puts@plt>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <cb_puti@plt>
mov    -0x20(%rbp),%rdi
mov    $0x3a,%esi
call   1040 <cb_putc@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <cb_puti@plt>
mov    -0x20(%rbp),%rdi
mov    $0x20,%esi
call   1040 <cb_putc@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <cb_puts@plt>
mov    -0x20(%rbp),%rdi
mov    $0xa,%esi
call   1040 <cb_putc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_error>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%ebp
call   1060 <parser_get_context@plt>
mov    %rax,%rbx
lea    0xea2(%rip),%rsi
mov    %rax,%rdi
call   1050 <cb_puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <cb_puti@plt>
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1040 <cb_putc@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1030 <cb_puti@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <cb_putc@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <cb_puts@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <cb_putc@plt>

LLVM IR (-O0):
%struct.parser = type { i32 }
%struct.cb_context = type { i32 }
@.str = [7 x i8] c"ERROR \00"
define void @cb_error(%struct.parser* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.parser*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %struct.cb_context*
store %struct.parser* %0, %struct.parser** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load %struct.parser*, %struct.parser** %5
%11 = call %struct.cb_context* @parser_get_context(%struct.parser* %10)
store %struct.cb_context* %11, %struct.cb_context** %9
%12 = load %struct.cb_context*, %struct.cb_context** %9
%13 = call i32 @cb_puts(%struct.cb_context* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = load %struct.cb_context*, %struct.cb_context** %9
%15 = load i32, i32* %6
%16 = call i32 @cb_puti(%struct.cb_context* %14, i32 %15)
%17 = load %struct.cb_context*, %struct.cb_context** %9
%18 = call i32 @cb_putc(%struct.cb_context* %17, i8 signext 58)
%19 = load %struct.cb_context*, %struct.cb_context** %9
%20 = load i32, i32* %7
%21 = call i32 @cb_puti(%struct.cb_context* %19, i32 %20)
%22 = load %struct.cb_context*, %struct.cb_context** %9
%23 = call i32 @cb_putc(%struct.cb_context* %22, i8 signext 32)
%24 = load %struct.cb_context*, %struct.cb_context** %9
%25 = load i8*, i8** %8
%26 = call i32 @cb_puts(%struct.cb_context* %24, i8* %25)
%27 = load %struct.cb_context*, %struct.cb_context** %9
%28 = call i32 @cb_putc(%struct.cb_context* %27, i8 signext 10)
ret void
}

LLVM IR (-O2):
%struct.parser = type { i32 }
%struct.cb_context = type { i32 }
@.str = [7 x i8] c"ERROR \00"
define void @cb_error(%struct.parser* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call %struct.cb_context* @parser_get_context(%struct.parser* %0)
%6 = tail call i32 @cb_puts(%struct.cb_context* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @cb_puti(%struct.cb_context* %5, i32 %1)
%8 = tail call i32 @cb_putc(%struct.cb_context* %5, i8 signext 58)
%9 = tail call i32 @cb_puti(%struct.cb_context* %5, i32 %2)
%10 = tail call i32 @cb_putc(%struct.cb_context* %5, i8 signext 32)
%11 = tail call i32 @cb_puts(%struct.cb_context* %5, i8* %3)
%12 = tail call i32 @cb_putc(%struct.cb_context* %5, i8 signext 10)
ret void
}