#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ emit_text(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ generate_eq(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ generate_neq(int /*<<< orphan*/ *, char *);
int main() {
  FILE *f = fopen("sse_msk_luts.h", "wb");
  emit_text(f,
            "#ifndef __sse_msk_jmp_lut__\n#define __sse_msk_jmp_lut__\n\n\t");
  generate_eq(f, "g_sse_msk_jmp_eq_lut");
  generate_neq(f, "g_sse_msk_jmp_neq_lut");
  emit_text(f, "#endif\n\n");
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1070 <emit_text@plt>
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1050 <generate_eq@plt>
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1040 <generate_neq@plt>
mov    -0x10(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1070 <emit_text@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xea8(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xea4(%rip),%rsi
mov    %rax,%rdi
call   1070 <emit_text@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1050 <generate_eq@plt>
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <generate_neq@plt>
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1070 <emit_text@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"sse_msk_luts.h\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [59 x i8] c"#ifndef __sse_msk_jmp_lut__\0A#define __sse_msk_jmp_lut__\0A\0A\09\00"
@.str.3 = [21 x i8] c"g_sse_msk_jmp_eq_lut\00"
@.str.4 = [22 x i8] c"g_sse_msk_jmp_neq_lut\00"
@.str.5 = [9 x i8] c"#endif\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @emit_text(i32* %4, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @generate_eq(i32* %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32*, i32** %2
%9 = call i32 @generate_neq(i32* %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%10 = load i32*, i32** %2
%11 = call i32 @emit_text(i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%12 = load i32*, i32** %2
%13 = call i32 @fclose(i32* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"sse_msk_luts.h\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [59 x i8] c"#ifndef __sse_msk_jmp_lut__\0A#define __sse_msk_jmp_lut__\0A\0A\09\00"
@.str.3 = [21 x i8] c"g_sse_msk_jmp_eq_lut\00"
@.str.4 = [22 x i8] c"g_sse_msk_jmp_neq_lut\00"
@.str.5 = [9 x i8] c"#endif\0A\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @emit_text(i32* %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @generate_eq(i32* %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @generate_neq(i32* %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 @emit_text(i32* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @fclose(i32* %1)
ret i32 0
}