#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int major_code;
  int minor_code;
};
typedef TYPE_1__ XNoExposeEvent;
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
#define X_CopyArea 129
#define X_CopyPlane 128
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void do_NoExpose(FILE *out_f, XEvent *eventp) {
  XNoExposeEvent *e = (XNoExposeEvent *)eventp;
  char *m;
  char mdummy[10];
  switch (e->major_code) {
  case X_CopyArea:
    m = "CopyArea";
    break;
  case X_CopyPlane:
    m = "CopyPlane";
    break;
  default:
    m = mdummy;
    sprintf(mdummy, "%d", e->major_code);
    break;
  }
  fprintf(out_f, "    major %s, minor %d\n", m, e->minor_code);
  return;
}


x86 assembly (clang, -O0):
<do_NoExpose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
sub    $0x80,%eax
je     1174 <do_NoExpose+0x54>
jmp    1151 <do_NoExpose+0x31>
mov    -0x30(%rbp),%eax
sub    $0x81,%eax
jne    1184 <do_NoExpose+0x64>
jmp    1164 <do_NoExpose+0x44>
lea    0xe95(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11a2 <do_NoExpose+0x82>
lea    0xe8e(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11a2 <do_NoExpose+0x82>
lea    -0x2a(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x2a(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe76(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
lea    0xe5e(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_NoExpose>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%edx
cmp    $0x81,%edx
je     114a <do_NoExpose+0x2a>
cmp    $0x80,%edx
jne    1153 <do_NoExpose+0x33>
lea    0xec1(%rip),%r15
jmp    1167 <do_NoExpose+0x47>
lea    0xeaf(%rip),%r15
jmp    1167 <do_NoExpose+0x47>
lea    0x6(%rsp),%r15
lea    0xeb4(%rip),%rsi
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    0x4(%rbx),%ecx
lea    0xea5(%rip),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32, i32 }
@.str = [9 x i8] c"CopyArea\00"
@.str.1 = [10 x i8] c"CopyPlane\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [24 x i8] c" major %s, minor %d\0A\00"
define void @do_NoExpose(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.TYPE_2__*
%6 = alloca i8*
%7 = alloca [10 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %4
%9 = bitcast i32* %8 to %struct.TYPE_2__*
store %struct.TYPE_2__* %9, %struct.TYPE_2__** %5
%10 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 0
%12 = load i32, i32* %11
switch i32 %12, label %15 [
i32 129, label %13
i32 128, label %14
]
13: ; preds = %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %6
br label %22
14: ; preds = %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %6
br label %22
15: ; preds = %2
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
store i8* %16, i8** %6
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%18 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%19 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %18, i32 0, i32 0
%20 = load i32, i32* %19
%21 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %15, %14, %13
%23 = load i32*, i32** %3
%24 = load i8*, i8** %6
%25 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%26 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %25, i32 0, i32 1
%27 = load i32, i32* %26
%28 = call i32 @fprintf(i32* %23, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %24, i32 %27)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"CopyArea\00"
@.str.1 = [10 x i8] c"CopyPlane\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [24 x i8] c" major %s, minor %d\0A\00"
define void @do_NoExpose(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %1
switch i32 %5, label %7 [
i32 129, label %9
i32 128, label %6
]
6: ; preds = %2
br label %9
7: ; preds = %2
%8 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %5)
br label %9
9: ; preds = %2, %7, %6
%10 = phi i8* [ %4, %7 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), %6 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %2 ]
%11 = getelementptr inbounds i32, i32* %1, i64 1
%12 = load i32, i32* %11
%13 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %10, i32 %12)
ret void
}