#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*/ set_variable(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void init_variables() {
  char buf[10];
  sprintf(buf, "%d", 20);
  set_variable("history", buf);
  set_variable("show_receive", "true");
  set_variable("slash_commands", "true");
  sprintf(buf, "%d", 30);
  set_variable("lines_to_save", buf);
  set_variable("verbose", "true");
  sprintf(buf, "%d", 0);
  set_variable("screen_length", buf);
}


x86 assembly (clang, -O0):
<init_variables>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x14,%edx
call   1040 <sprintf@plt>
lea    -0xa(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1030 <set_variable@plt>
lea    0xeb7(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1030 <set_variable@plt>
lea    0xeb6(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <set_variable@plt>
lea    -0xa(%rbp),%rdi
lea    0xe82(%rip),%rsi
mov    $0x1e,%edx
call   1040 <sprintf@plt>
lea    -0xa(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <set_variable@plt>
lea    0xe9b(%rip),%rdi
lea    0xe72(%rip),%rsi
call   1030 <set_variable@plt>
lea    -0xa(%rbp),%rdi
lea    0xe4a(%rip),%rsi
xor    %edx,%edx
call   1040 <sprintf@plt>
lea    -0xa(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1030 <set_variable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_variables>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x14,%edx
call   1040 <sprintf@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <set_variable@plt>
lea    0xeb0(%rip),%rdi
lea    0xeb6(%rip),%r15
mov    %r15,%rsi
call   1030 <set_variable@plt>
lea    0xeac(%rip),%rdi
mov    %r15,%rsi
call   1030 <set_variable@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1e,%edx
call   1040 <sprintf@plt>
lea    0xe9c(%rip),%rdi
mov    %rbx,%rsi
call   1030 <set_variable@plt>
lea    0xe9b(%rip),%rdi
mov    %r15,%rsi
call   1030 <set_variable@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <sprintf@plt>
lea    0xe87(%rip),%rdi
mov    %rbx,%rsi
call   1030 <set_variable@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"history\00"
@.str.2 = [13 x i8] c"show_receive\00"
@.str.3 = [5 x i8] c"true\00"
@.str.4 = [15 x i8] c"slash_commands\00"
@.str.5 = [14 x i8] c"lines_to_save\00"
@.str.6 = [8 x i8] c"verbose\00"
@.str.7 = [14 x i8] c"screen_length\00"
define void @init_variables() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 20)
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call i32 @set_variable(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @set_variable(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @set_variable(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%9 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 30)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%11 = call i32 @set_variable(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %10)
%12 = call i32 @set_variable(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%14 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%16 = call i32 @set_variable(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"history\00"
@.str.2 = [13 x i8] c"show_receive\00"
@.str.3 = [5 x i8] c"true\00"
@.str.4 = [15 x i8] c"slash_commands\00"
@.str.5 = [14 x i8] c"lines_to_save\00"
@.str.6 = [8 x i8] c"verbose\00"
@.str.7 = [14 x i8] c"screen_length\00"
define void @init_variables() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 20)
%4 = call i32 @set_variable(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @set_variable(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @set_variable(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 30)
%8 = call i32 @set_variable(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%9 = call i32 @set_variable(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%11 = call i32 @set_variable(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %2)
ret void
}