#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 q1l() {
  int a[] = {11, 22, 33};
  int *b[3];
  int **p, **q, **r;
  b[0] = a;
  b[1] = a + 1;
  b[2] = a + 2;
  p = b;
  q = b + 1;
  r = b + 2;
  *p = *r--;
  --*q;
  printf("\n%s\n", "q1l ------");
  printf("%d %d %d\n", **p, **q, **r);
  return 1;
}


x86 assembly (clang, -O0):
<q1l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0xc(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
lea    -0xc(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
lea    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x48(%rbp)
mov    (%rax),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x40(%rbp),%rax
mov    (%rax),%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,(%rax)
lea    0xe72(%rip),%rdi
lea    0xe70(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edx
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q1l>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x21,%esi
mov    $0xb,%edx
mov    $0xb,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [11 x i8] c"q1l ------\00"
@.str.2 = [10 x i8] c"%d %d %d\0A\00"
define i32 @q1l() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 33, i32 11, i32 11)
ret i32 1
}