#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 */
struct image {
  int dummy;
};
struct Rule {
  int dummy;
};

/* Variables and functions */
struct image *create_black_image(int, int);
int *css_find_number_prop(struct Rule *, char *);
struct image *make_img(struct Rule *world) {
  int *width_ptr = css_find_number_prop(world, "width");
  int *height_ptr = css_find_number_prop(world, "height");
  int width = width_ptr ? *width_ptr : 400;
  int height = height_ptr ? *height_ptr : 400;
  return create_black_image(width, height);
}


x86 assembly (clang, -O0):
<make_img>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <css_find_number_prop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1040 <css_find_number_prop@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <make_img+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    117a <make_img+0x5a>
mov    $0x190,%eax
mov    %eax,-0x24(%rbp)
jmp    117a <make_img+0x5a>
mov    -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1199 <make_img+0x79>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
jmp    11a6 <make_img+0x86>
mov    $0x190,%eax
mov    %eax,-0x28(%rbp)
jmp    11a6 <make_img+0x86>
mov    -0x28(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <create_black_image@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_img>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1040 <css_find_number_prop@plt>
mov    %rax,%r14
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
call   1040 <css_find_number_prop@plt>
mov    $0x190,%esi
mov    $0x190,%edi
test   %r14,%r14
je     1157 <make_img+0x37>
mov    (%r14),%edi
test   %rax,%rax
je     115e <make_img+0x3e>
mov    (%rax),%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <create_black_image@plt>

LLVM IR (-O0):
%struct.image = type { i32 }
%struct.Rule = type { i32 }
@.str = [6 x i8] c"width\00"
@.str.1 = [7 x i8] c"height\00"
define %struct.image* @make_img(%struct.Rule* %0) {
%2 = alloca %struct.Rule*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store %struct.Rule* %0, %struct.Rule** %2
%7 = load %struct.Rule*, %struct.Rule** %2
%8 = call i32* @css_find_number_prop(%struct.Rule* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %3
%9 = load %struct.Rule*, %struct.Rule** %2
%10 = call i32* @css_find_number_prop(%struct.Rule* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %4
%11 = load i32*, i32** %3
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
br label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %13
%18 = phi i32 [ %15, %13 ], [ 400, %16 ]
store i32 %18, i32* %5
%19 = load i32*, i32** %4
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32*, i32** %4
%23 = load i32, i32* %22
br label %25
24: ; preds = %17
br label %25
25: ; preds = %24, %21
%26 = phi i32 [ %23, %21 ], [ 400, %24 ]
store i32 %26, i32* %6
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = call %struct.image* @create_black_image(i32 %27, i32 %28)
ret %struct.image* %29
}

LLVM IR (-O2):
%struct.image = type { i32 }
%struct.Rule = type { i32 }
@.str = [6 x i8] c"width\00"
@.str.1 = [7 x i8] c"height\00"
define %struct.image* @make_img(%struct.Rule* %0) {
%2 = tail call i32* @css_find_number_prop(%struct.Rule* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32* @css_find_number_prop(%struct.Rule* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %2, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load i32, i32* %2
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ 400, %1 ]
%9 = icmp eq i32* %3, null
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = load i32, i32* %3
br label %12
12: ; preds = %7, %10
%13 = phi i32 [ %11, %10 ], [ 400, %7 ]
%14 = tail call %struct.image* @create_black_image(i32 %8, i32 %13)
ret %struct.image* %14
}