#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 */
void *malloc(int);
int main() {
  int i = 3;
  int j = 4;
  void *tmp = malloc(sizeof(int *) * 2);
  int *ptrI = &i;
  int *ptrj = &j;
  int **tmphelper = (int **)tmp;
  int **tmpfst = tmphelper;
  int **tmpsnd = tmphelper + 1;
  *tmpfst = ptrI;
  *tmpsnd = ptrj;
  int **other = (int **)tmp;
  int *snd = *(other + 1);
  if (**tmpfst == 3 && **tmpsnd == 4 && *snd == 4) {
    return 0;
  }
ERROR:
  goto ERROR;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
cmpl   $0x3,(%rax)
jne    11c6 <main+0xb6>
mov    -0x40(%rbp),%rax
mov    (%rax),%rax
cmpl   $0x4,(%rax)
jne    11c6 <main+0xb6>
mov    -0x50(%rbp),%rax
cmpl   $0x4,(%rax)
jne    11c6 <main+0xb6>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret
jmp    11cb <main+0xbb>
jmp    11cb <main+0xbb>

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32**
%8 = alloca i32**
%9 = alloca i32**
%10 = alloca i32**
%11 = alloca i32*
store i32 0, i32* %1
store i32 3, i32* %2
store i32 4, i32* %3
%12 = call i8* @malloc(i32 16)
store i8* %12, i8** %4
store i32* %2, i32** %5
store i32* %3, i32** %6
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32**
store i32** %14, i32*** %7
%15 = load i32**, i32*** %7
store i32** %15, i32*** %8
%16 = load i32**, i32*** %7
%17 = getelementptr inbounds i32*, i32** %16, i64 1
store i32** %17, i32*** %9
%18 = load i32*, i32** %5
%19 = load i32**, i32*** %8
store i32* %18, i32** %19
%20 = load i32*, i32** %6
%21 = load i32**, i32*** %9
store i32* %20, i32** %21
%22 = load i8*, i8** %4
%23 = bitcast i8* %22 to i32**
store i32** %23, i32*** %10
%24 = load i32**, i32*** %10
%25 = getelementptr inbounds i32*, i32** %24, i64 1
%26 = load i32*, i32** %25
store i32* %26, i32** %11
%27 = load i32**, i32*** %8
%28 = load i32*, i32** %27
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 3
br i1 %30, label %31, label %41
31: ; preds = %0
%32 = load i32**, i32*** %9
%33 = load i32*, i32** %32
%34 = load i32, i32* %33
%35 = icmp eq i32 %34, 4
br i1 %35, label %36, label %41
36: ; preds = %31
%37 = load i32*, i32** %11
%38 = load i32, i32* %37
%39 = icmp eq i32 %38, 4
br i1 %39, label %40, label %41
40: ; preds = %36
ret i32 0
41: ; preds = %36, %31, %0
br label %42
42: ; preds = %42, %41
br label %42
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}