#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 session {
  int dummy;
};
struct listnode {
  int dummy;
};

/* Variables and functions */
char *get_arg_in_braces(char *, char *, int);
int /*<<< orphan*/ set_list_item(struct session *, struct listnode *, char *,
                                 char *);
struct session *array_set(struct session *ses, struct listnode *list,
                          char *arg) {
  char left[10000], right[10000];
  arg = get_arg_in_braces(arg, left, 0);
  arg = get_arg_in_braces(arg, right, 1);
  set_list_item(ses, list, left, right);
  return ses;
}


x86 assembly (clang, -O0):
<array_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x2730(%rbp),%rsi
xor    %edx,%edx
call   1030 <get_arg_in_braces@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x4e40(%rbp),%rsi
mov    $0x1,%edx
call   1030 <get_arg_in_braces@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x2730(%rbp),%rdx
lea    -0x4e40(%rbp),%rcx
call   1040 <set_list_item@plt>
mov    -0x8(%rbp),%rax
add    $0x4e40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_set>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x4e28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x2710(%rsp),%r15
mov    %rdx,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1030 <get_arg_in_braces@plt>
mov    %rsp,%r12
mov    %rax,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1030 <get_arg_in_braces@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <set_list_item@plt>
mov    %rbx,%rax
add    $0x4e28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.session = type { i32 }
%struct.listnode = type { i32 }
define %struct.session* @array_set(%struct.session* %0, %struct.listnode* %1, i8* %2) {
%4 = alloca %struct.session*
%5 = alloca %struct.listnode*
%6 = alloca i8*
%7 = alloca [10000 x i8]
%8 = alloca [10000 x i8]
store %struct.session* %0, %struct.session** %4
store %struct.listnode* %1, %struct.listnode** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = getelementptr inbounds [10000 x i8], [10000 x i8]* %7, i64 0, i64 0
%11 = call i8* @get_arg_in_braces(i8* %9, i8* %10, i32 0)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = getelementptr inbounds [10000 x i8], [10000 x i8]* %8, i64 0, i64 0
%14 = call i8* @get_arg_in_braces(i8* %12, i8* %13, i32 1)
store i8* %14, i8** %6
%15 = load %struct.session*, %struct.session** %4
%16 = load %struct.listnode*, %struct.listnode** %5
%17 = getelementptr inbounds [10000 x i8], [10000 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [10000 x i8], [10000 x i8]* %8, i64 0, i64 0
%19 = call i32 @set_list_item(%struct.session* %15, %struct.listnode* %16, i8* %17, i8* %18)
%20 = load %struct.session*, %struct.session** %4
ret %struct.session* %20
}

LLVM IR (-O2):
%struct.session = type { i32 }
%struct.listnode = type { i32 }
define %struct.session* @array_set(%struct.session* returned %0, %struct.listnode* %1, i8* %2) {
%4 = alloca [10000 x i8]
%5 = alloca [10000 x i8]
%6 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 0
%8 = call i8* @get_arg_in_braces(i8* %2, i8* %6, i32 0)
%9 = call i8* @get_arg_in_braces(i8* %8, i8* %7, i32 1)
%10 = call i32 @set_list_item(%struct.session* %0, %struct.listnode* %1, i8* %6, i8* %7)
ret %struct.session* %0
}