#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*/ printf(char *, int);
void func_2c(int *const *i) {
  printf("func_2c : %d >> ", **i);
  {
    int bkup = **i;
    **i = 10;
    printf("%d >> ", **i);
    **i = bkup;
  }
  {
    int *const *bkup = i;
    int x = 30;
    int *y = &x;
    int *const *z = &y;
    i = z;
    printf("%d\n", **i);
    i = bkup;
  }
}


x86 assembly (clang, -O0):
<func_2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0xa,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1e,-0x1c(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_2c>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%rax
mov    (%rax),%ebp
movl   $0xa,(%rax)
lea    0xed1(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    (%rbx),%rax
mov    %ebp,(%rax)
lea    0xec2(%rip),%rdi
mov    $0x1e,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"func_2c : %d >> \00"
@.str.1 = [7 x i8] c"%d >> \00"
@.str.2 = [4 x i8] c"%d\0A\00"
define void @func_2c(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32*, i32** %0
%6 = load i32, i32* %5
store i32 10, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 10)
%8 = load i32*, i32** %0
store i32 %6, i32* %8
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 30)
ret void
}