#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*/ set_error(int);
int grid_get_data_from_id(int *row_dim, int *col_dim, int *bombs, int id) {
  if (id == 0) {
    *row_dim = *col_dim = 8;
    *bombs = 10;
  } else if (id == 1) {
    *row_dim = *col_dim = 12;
    *bombs = 26;
  } else if (id == 2) {
    *row_dim = 16;
    *col_dim = 24;
    *bombs = 60;
  } else {
    set_error((8));
    return (!(0));
  }
  return (0);
}


x86 assembly (clang, -O0):
<grid_get_data_from_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1154 <grid_get_data_from_id+0x44>
mov    -0x18(%rbp),%rax
movl   $0x8,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x8,(%rax)
mov    -0x20(%rbp),%rax
movl   $0xa,(%rax)
jmp    11ce <grid_get_data_from_id+0xbe>
cmpl   $0x1,-0x24(%rbp)
jne    1181 <grid_get_data_from_id+0x71>
mov    -0x18(%rbp),%rax
movl   $0xc,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xc,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1a,(%rax)
jmp    11c9 <grid_get_data_from_id+0xb9>
cmpl   $0x2,-0x24(%rbp)
jne    11ae <grid_get_data_from_id+0x9e>
mov    -0x10(%rbp),%rax
movl   $0x10,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x18,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x3c,(%rax)
jmp    11c4 <grid_get_data_from_id+0xb4>
mov    $0x8,%edi
call   1030 <set_error@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d5 <grid_get_data_from_id+0xc5>
jmp    11c9 <grid_get_data_from_id+0xb9>
jmp    11ce <grid_get_data_from_id+0xbe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_get_data_from_id>:
push   %rax
cmp    $0x2,%ecx
je     1133 <grid_get_data_from_id+0x23>
cmp    $0x1,%ecx
je     1147 <grid_get_data_from_id+0x37>
test   %ecx,%ecx
jne    115d <grid_get_data_from_id+0x4d>
movl   $0x8,(%rsi)
movl   $0x8,(%rdi)
movl   $0xa,(%rdx)
jmp    1159 <grid_get_data_from_id+0x49>
movl   $0x10,(%rdi)
movl   $0x18,(%rsi)
movl   $0x3c,(%rdx)
jmp    1159 <grid_get_data_from_id+0x49>
movl   $0xc,(%rsi)
movl   $0xc,(%rdi)
movl   $0x1a,(%rdx)
xor    %eax,%eax
pop    %rcx
ret
mov    $0x8,%edi
call   1030 <set_error@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @grid_get_data_from_id(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i32*, i32** %7
store i32 8, i32* %13
%14 = load i32*, i32** %6
store i32 8, i32* %14
%15 = load i32*, i32** %8
store i32 10, i32* %15
br label %34
16: ; preds = %4
%17 = load i32, i32* %9
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32*, i32** %7
store i32 12, i32* %20
%21 = load i32*, i32** %6
store i32 12, i32* %21
%22 = load i32*, i32** %8
store i32 26, i32* %22
br label %33
23: ; preds = %16
%24 = load i32, i32* %9
%25 = icmp eq i32 %24, 2
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = load i32*, i32** %6
store i32 16, i32* %27
%28 = load i32*, i32** %7
store i32 24, i32* %28
%29 = load i32*, i32** %8
store i32 60, i32* %29
br label %32
30: ; preds = %23
%31 = call i32 @set_error(i32 8)
store i32 1, i32* %5
br label %35
32: ; preds = %26
br label %33
33: ; preds = %32, %19
br label %34
34: ; preds = %33, %12
store i32 0, i32* %5
br label %35
35: ; preds = %34, %30
%36 = load i32, i32* %5
ret i32 %36
}

LLVM IR (-O2):
define i32 @grid_get_data_from_id(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3) {
switch i32 %3, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %4
store i32 8, i32* %1
store i32 8, i32* %0
store i32 10, i32* %2
br label %10
6: ; preds = %4
store i32 12, i32* %1
store i32 12, i32* %0
store i32 26, i32* %2
br label %10
7: ; preds = %4
store i32 16, i32* %0
store i32 24, i32* %1
store i32 60, i32* %2
br label %10
8: ; preds = %4
%9 = tail call i32 @set_error(i32 8)
br label %10
10: ; preds = %5, %7, %6, %8
%11 = phi i32 [ 1, %8 ], [ 0, %6 ], [ 0, %7 ], [ 0, %5 ]
ret i32 %11
}