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

/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void CNSL_SetGeometry(int width, int height) {
  char widthstr[10] = {0};
  char heightstr[10] = {0};
  snprintf(widthstr, 10, "%i", width);
  snprintf(heightstr, 10, "%i", height);
  setenv("CNSLWIDTH", widthstr, 1);
  setenv("CNSLHEIGHT", heightstr, 1);
}


x86 assembly (clang, -O0):
<CNSL_SetGeometry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
lea    -0x1c(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
lea    -0x12(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0xa,%esi
lea    0xe8f(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x1c(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0xa,%esi
lea    0xe77(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x12(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x1,%edx
call   1030 <setenv@plt>
lea    -0x1c(%rbp),%rsi
lea    0xe5f(%rip),%rdi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CNSL_SetGeometry>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebx
mov    %edi,%ecx
movw   $0x0,0x20(%rsp)
movq   $0x0,0x18(%rsp)
movw   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xeaa(%rip),%r14
lea    0x18(%rsp),%r15
mov    %r15,%rdi
mov    $0xa,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
lea    0x8(%rsp),%r12
mov    %r12,%rdi
mov    $0xa,%esi
mov    %r14,%rdx
mov    %ebx,%ecx
call   1040 <snprintf@plt>
lea    0xe7a(%rip),%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
lea    0xe70(%rip),%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [10 x i8] c"CNSLWIDTH\00"
@.str.2 = [11 x i8] c"CNSLHEIGHT\00"
define void @CNSL_SetGeometry(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i8]
%6 = alloca [10 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = bitcast [10 x i8]* %5 to i8*
%8 = bitcast [10 x i8]* %6 to i8*
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @snprintf(i8* %9, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* %4
%14 = call i32 @snprintf(i8* %12, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%16 = call i32 @setenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 1)
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%18 = call i32 @setenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %17, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [10 x i8] c"CNSLWIDTH\00"
@.str.2 = [11 x i8] c"CNSLHEIGHT\00"
define void @CNSL_SetGeometry(i32 %0, i32 %1) {
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%7 = call i32 @snprintf(i8* %5, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = call i32 @snprintf(i8* %6, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%9 = call i32 @setenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 1)
%10 = call i32 @setenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32 1)
ret void
}