#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 */
typedef int /*<<< orphan*/ lineb;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char const *);
int /*<<< orphan*/ strlen(char const *);
void emit_line(FILE *stream, int line, const char *file) {
  char lineb[24 + strlen(file)];
  snprintf(lineb, sizeof(lineb) / sizeof(char), "#line %d \"%s\"\n", line,
           file);
  fputs(lineb, stream);
}


x86 assembly (clang, -O0):
<emit_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x18,%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
shr    $0x0,%rax
mov    %eax,%esi
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xe7a(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <fputs@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_line>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %esi,%r15d
mov    %rdi,%r14
mov    %rdx,%rdi
call   1030 <strlen@plt>
lea    0x18(%rax),%esi
mov    %rsp,%rbx
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xe99(%rip),%rdx
mov    %rbx,%rdi
mov    %r15d,%ecx
mov    %r12,%r8
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <fputs@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"#line %d \22%s\22\0A\00"
define void @emit_line(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 24, %10
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %7
%14 = alloca i8, i64 %12
store i64 %12, i64* %8
%15 = udiv i64 %12, 1
%16 = trunc i64 %15 to i32
%17 = load i32, i32* %5
%18 = load i8*, i8** %6
%19 = call i32 @snprintf(i8* %14, i32 %16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %17, i8* %18)
%20 = load i32*, i32** %4
%21 = call i32 @fputs(i8* %14, i32* %20)
%22 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"#line %d \22%s\22\0A\00"
define void @emit_line(i32* nocapture %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = add nsw i32 %4, 24
%6 = zext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = call i32 @snprintf(i8* %7, i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%9 = call i32 @fputs(i8* %7, i32* %0)
ret void
}