#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*/ hdel(int ***);
int ***hget(int ***, int);
int ***hnew();
int /*<<< orphan*/ hset(int ***, int, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int(**table)[2] = hnew();
  hset(table, 10, 20);
  hset(table, 20, 30);
  hset(table, 30, 40);
  int(**a)[2] = hget(table, 10);
  int(**b)[2] = hget(table, 20);
  int(**c)[2] = hget(table, 30);
  printf("%d:%d\n", (**a)[0], (**a)[1]);
  printf("%d:%d\n", (**b)[0], (**b)[1]);
  printf("%d:%d\n", (**c)[0], (**c)[1]);
  hdel(table);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <hnew@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1050 <hset@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
mov    $0x1e,%edx
call   1050 <hset@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1e,%esi
mov    $0x28,%edx
call   1050 <hset@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1060 <hget@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1060 <hget@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1e,%esi
call   1060 <hget@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x4(%rax),%edx
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    0x4(%rax),%edx
lea    0xdee(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    0x4(%rax),%edx
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <hdel@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <hnew@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1050 <hset@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
mov    $0x1e,%edx
call   1050 <hset@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    $0x28,%edx
call   1050 <hset@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <hget@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0x14,%esi
call   1060 <hget@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1060 <hget@plt>
mov    %rax,%r12
mov    (%r14),%rax
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xe29(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%r15),%rax
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%r12),%rax
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1070 <hdel@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]**
%3 = alloca [2 x i32]**
%4 = alloca [2 x i32]**
%5 = alloca [2 x i32]**
store i32 0, i32* %1
%6 = call i32*** (...) @hnew()
%7 = bitcast i32*** %6 to [2 x i32]**
store [2 x i32]** %7, [2 x i32]*** %2
%8 = load [2 x i32]**, [2 x i32]*** %2
%9 = bitcast [2 x i32]** %8 to i32***
%10 = call i32 @hset(i32*** %9, i32 10, i32 20)
%11 = load [2 x i32]**, [2 x i32]*** %2
%12 = bitcast [2 x i32]** %11 to i32***
%13 = call i32 @hset(i32*** %12, i32 20, i32 30)
%14 = load [2 x i32]**, [2 x i32]*** %2
%15 = bitcast [2 x i32]** %14 to i32***
%16 = call i32 @hset(i32*** %15, i32 30, i32 40)
%17 = load [2 x i32]**, [2 x i32]*** %2
%18 = bitcast [2 x i32]** %17 to i32***
%19 = call i32*** @hget(i32*** %18, i32 10)
%20 = bitcast i32*** %19 to [2 x i32]**
store [2 x i32]** %20, [2 x i32]*** %3
%21 = load [2 x i32]**, [2 x i32]*** %2
%22 = bitcast [2 x i32]** %21 to i32***
%23 = call i32*** @hget(i32*** %22, i32 20)
%24 = bitcast i32*** %23 to [2 x i32]**
store [2 x i32]** %24, [2 x i32]*** %4
%25 = load [2 x i32]**, [2 x i32]*** %2
%26 = bitcast [2 x i32]** %25 to i32***
%27 = call i32*** @hget(i32*** %26, i32 30)
%28 = bitcast i32*** %27 to [2 x i32]**
store [2 x i32]** %28, [2 x i32]*** %5
%29 = load [2 x i32]**, [2 x i32]*** %3
%30 = load [2 x i32]*, [2 x i32]** %29
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 0
%32 = load i32, i32* %31
%33 = load [2 x i32]**, [2 x i32]*** %3
%34 = load [2 x i32]*, [2 x i32]** %33
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %34, i64 0, i64 1
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %36)
%38 = load [2 x i32]**, [2 x i32]*** %4
%39 = load [2 x i32]*, [2 x i32]** %38
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %39, i64 0, i64 0
%41 = load i32, i32* %40
%42 = load [2 x i32]**, [2 x i32]*** %4
%43 = load [2 x i32]*, [2 x i32]** %42
%44 = getelementptr inbounds [2 x i32], [2 x i32]* %43, i64 0, i64 1
%45 = load i32, i32* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %41, i32 %45)
%47 = load [2 x i32]**, [2 x i32]*** %5
%48 = load [2 x i32]*, [2 x i32]** %47
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %48, i64 0, i64 0
%50 = load i32, i32* %49
%51 = load [2 x i32]**, [2 x i32]*** %5
%52 = load [2 x i32]*, [2 x i32]** %51
%53 = getelementptr inbounds [2 x i32], [2 x i32]* %52, i64 0, i64 1
%54 = load i32, i32* %53
%55 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %50, i32 %54)
%56 = load [2 x i32]**, [2 x i32]*** %2
%57 = bitcast [2 x i32]** %56 to i32***
%58 = call i32 @hdel(i32*** %57)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d:%d\0A\00"
define i32 @main() {
%1 = tail call i32*** (...) @hnew()
%2 = tail call i32 @hset(i32*** %1, i32 10, i32 20)
%3 = tail call i32 @hset(i32*** %1, i32 20, i32 30)
%4 = tail call i32 @hset(i32*** %1, i32 30, i32 40)
%5 = tail call i32*** @hget(i32*** %1, i32 10)
%6 = bitcast i32*** %5 to [2 x i32]**
%7 = tail call i32*** @hget(i32*** %1, i32 20)
%8 = bitcast i32*** %7 to [2 x i32]**
%9 = tail call i32*** @hget(i32*** %1, i32 30)
%10 = bitcast i32*** %9 to [2 x i32]**
%11 = load [2 x i32]*, [2 x i32]** %6
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%15 = load i32, i32* %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15)
%17 = load [2 x i32]*, [2 x i32]** %8
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 0
%19 = load i32, i32* %18
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 1
%21 = load i32, i32* %20
%22 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %21)
%23 = load [2 x i32]*, [2 x i32]** %10
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %23, i64 0, i64 0
%25 = load i32, i32* %24
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %23, i64 0, i64 1
%27 = load i32, i32* %26
%28 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %27)
%29 = tail call i32 @hdel(i32*** %1)
ret i32 0
}