#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 */
char **xcalloc(int, int);
char *xstrdup(char const *);
void set_browser(char ***list, int idx, const char *browser, const char *type) {
  list[idx] = xcalloc(2, sizeof(char *));
  list[idx][0] = xstrdup(browser);
  list[idx][1] = xstrdup(type);
}


x86 assembly (clang, -O0):
<set_browser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x2,%edi
mov    $0x8,%esi
call   1040 <xcalloc@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdi
call   1030 <xstrdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdi
call   1030 <xstrdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %rcx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_browser>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2,%edi
mov    $0x8,%esi
call   1040 <xcalloc@plt>
movslq %ebp,%rbp
mov    %rax,(%rbx,%rbp,8)
mov    %r15,%rdi
call   1030 <xstrdup@plt>
mov    (%rbx,%rbp,8),%rcx
mov    %rax,(%rcx)
mov    %r14,%rdi
call   1030 <xstrdup@plt>
mov    (%rbx,%rbp,8),%rcx
mov    %rax,0x8(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @set_browser(i8*** %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8***
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8*** %0, i8**** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = call i8** @xcalloc(i32 2, i32 8)
%10 = load i8***, i8**** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8**, i8*** %10, i64 %12
store i8** %9, i8*** %13
%14 = load i8*, i8** %7
%15 = call i8* @xstrdup(i8* %14)
%16 = load i8***, i8**** %5
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8**, i8*** %16, i64 %18
%20 = load i8**, i8*** %19
%21 = getelementptr inbounds i8*, i8** %20, i64 0
store i8* %15, i8** %21
%22 = load i8*, i8** %8
%23 = call i8* @xstrdup(i8* %22)
%24 = load i8***, i8**** %5
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8**, i8*** %24, i64 %26
%28 = load i8**, i8*** %27
%29 = getelementptr inbounds i8*, i8** %28, i64 1
store i8* %23, i8** %29
ret void
}

LLVM IR (-O2):
define void @set_browser(i8*** nocapture %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i8** @xcalloc(i32 2, i32 8)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8**, i8*** %0, i64 %6
store i8** %5, i8*** %7
%8 = tail call i8* @xstrdup(i8* %2)
%9 = load i8**, i8*** %7
store i8* %8, i8** %9
%10 = tail call i8* @xstrdup(i8* %3)
%11 = load i8**, i8*** %7
%12 = getelementptr inbounds i8*, i8** %11, i64 1
store i8* %10, i8** %12
ret void
}