#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 opctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ outputf(struct opctx *, char *, ...);
int output_prototype_constant_int(struct opctx *outc, const char *constant_name,
                                  int value) {
  outputf(outc, "\tduk_dup(ctx, 0);\n");
  outputf(outc, "\tduk_push_string(ctx, \"%s\");\n", constant_name);
  outputf(outc, "\tduk_push_int(ctx, %d);\n", value);
  outputf(outc, "\tduk_def_prop(ctx, -3, DUK_DEFPROP_HAVE_VALUE |\n");
  outputf(outc, "\t\t     DUK_DEFPROP_HAVE_WRITABLE |\n");
  outputf(outc, "\t\t     DUK_DEFPROP_HAVE_ENUMERABLE |\n");
  outputf(outc, "\t\t     DUK_DEFPROP_ENUMERABLE |\n");
  outputf(outc, "\t\t     DUK_DEFPROP_HAVE_CONFIGURABLE);\n");
  outputf(outc, "\tduk_pop(ctx);\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<output_prototype_constant_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <outputf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <outputf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <outputf@plt>
mov    -0x8(%rbp),%rdi
lea    0xedf(%rip),%rsi
mov    $0x0,%al
call   1030 <outputf@plt>
mov    -0x8(%rbp),%rdi
lea    0xefe(%rip),%rsi
mov    $0x0,%al
call   1030 <outputf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf10(%rip),%rsi
mov    $0x0,%al
call   1030 <outputf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf24(%rip),%rsi
mov    $0x0,%al
call   1030 <outputf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf33(%rip),%rsi
mov    $0x0,%al
call   1030 <outputf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf49(%rip),%rsi
mov    $0x0,%al
call   1030 <outputf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_prototype_constant_int>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%rbx
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <outputf@plt>
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1030 <outputf@plt>
lea    0xeeb(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <outputf@plt>
lea    0xef0(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <outputf@plt>
lea    0xf10(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <outputf@plt>
lea    0xf23(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <outputf@plt>
lea    0xf38(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <outputf@plt>
lea    0xf48(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <outputf@plt>
lea    0xf5f(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <outputf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.opctx = type { i32 }
@.str = [19 x i8] c"\09duk_dup(ctx, 0);\0A\00"
@.str.1 = [30 x i8] c"\09duk_push_string(ctx, \22%s\22);\0A\00"
@.str.2 = [25 x i8] c"\09duk_push_int(ctx, %d);\0A\00"
@.str.3 = [49 x i8] c"\09duk_def_prop(ctx, -3, DUK_DEFPROP_HAVE_VALUE |\0A\00"
@.str.4 = [36 x i8] c"\09\09 DUK_DEFPROP_HAVE_WRITABLE |\0A\00"
@.str.5 = [38 x i8] c"\09\09 DUK_DEFPROP_HAVE_ENUMERABLE |\0A\00"
@.str.6 = [33 x i8] c"\09\09 DUK_DEFPROP_ENUMERABLE |\0A\00"
@.str.7 = [40 x i8] c"\09\09 DUK_DEFPROP_HAVE_CONFIGURABLE);\0A\00"
@.str.8 = [17 x i8] c"\09duk_pop(ctx);\0A\0A\00"
define i32 @output_prototype_constant_int(%struct.opctx* %0, i8* %1, i32 %2) {
%4 = alloca %struct.opctx*
%5 = alloca i8*
%6 = alloca i32
store %struct.opctx* %0, %struct.opctx** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.opctx*, %struct.opctx** %4
%8 = call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = load %struct.opctx*, %struct.opctx** %4
%10 = load i8*, i8** %5
%11 = call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %9, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load %struct.opctx*, %struct.opctx** %4
%13 = load i32, i32* %6
%14 = call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load %struct.opctx*, %struct.opctx** %4
%16 = call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %15, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%17 = load %struct.opctx*, %struct.opctx** %4
%18 = call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %17, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%19 = load %struct.opctx*, %struct.opctx** %4
%20 = call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %19, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%21 = load %struct.opctx*, %struct.opctx** %4
%22 = call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %21, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%23 = load %struct.opctx*, %struct.opctx** %4
%24 = call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %23, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%25 = load %struct.opctx*, %struct.opctx** %4
%26 = call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %25, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.opctx = type { i32 }
@.str = [19 x i8] c"\09duk_dup(ctx, 0);\0A\00"
@.str.1 = [30 x i8] c"\09duk_push_string(ctx, \22%s\22);\0A\00"
@.str.2 = [25 x i8] c"\09duk_push_int(ctx, %d);\0A\00"
@.str.3 = [49 x i8] c"\09duk_def_prop(ctx, -3, DUK_DEFPROP_HAVE_VALUE |\0A\00"
@.str.4 = [36 x i8] c"\09\09 DUK_DEFPROP_HAVE_WRITABLE |\0A\00"
@.str.5 = [38 x i8] c"\09\09 DUK_DEFPROP_HAVE_ENUMERABLE |\0A\00"
@.str.6 = [33 x i8] c"\09\09 DUK_DEFPROP_ENUMERABLE |\0A\00"
@.str.7 = [40 x i8] c"\09\09 DUK_DEFPROP_HAVE_CONFIGURABLE);\0A\00"
@.str.8 = [17 x i8] c"\09duk_pop(ctx);\0A\0A\00"
define i32 @output_prototype_constant_int(%struct.opctx* %0, i8* %1, i32 %2) {
%4 = tail call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%6 = tail call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%7 = tail call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%10 = tail call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%11 = tail call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%12 = tail call i32 (%struct.opctx*, i8*, ...) @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}