#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 user_data {
  int dummy;
};
struct sslbuffer_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ssleventcb(struct sslbuffer_t *sslbuffer, int event, void *ctx) {
  struct user_data *user_data;
  user_data = (struct user_data *)ctx;
  printf("ssleventcb: got event=%d\n", event);
  switch (event) {
  case 1:
    printf("Connected\n");
    break;
  default:
    printf("ssleventcb: unrecognized event: %d\n", event);
    break;
  }
}


x86 assembly (clang, -O0):
<ssleventcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
jne    1160 <ssleventcb+0x50>
jmp    114d <ssleventcb+0x3d>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1171 <ssleventcb+0x61>
mov    -0xc(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssleventcb>:
push   %rbx
mov    %esi,%ebx
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebx
jne    1143 <ssleventcb+0x23>
lea    0xf01(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xed0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.sslbuffer_t = type { i32 }
%struct.user_data = type { i32 }
@.str = [26 x i8] c"ssleventcb: got event=%d\0A\00"
@.str.1 = [11 x i8] c"Connected\0A\00"
@.str.2 = [36 x i8] c"ssleventcb: unrecognized event: %d\0A\00"
define void @ssleventcb(%struct.sslbuffer_t* %0, i32 %1, i8* %2) {
%4 = alloca %struct.sslbuffer_t*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.user_data*
store %struct.sslbuffer_t* %0, %struct.sslbuffer_t** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.user_data*
store %struct.user_data* %9, %struct.user_data** %7
%10 = load i32, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %5
switch i32 %12, label %15 [
i32 1, label %13
]
13: ; preds = %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %18
15: ; preds = %3
%16 = load i32, i32* %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %13
ret void
}

LLVM IR (-O2):
%struct.sslbuffer_t = type { i32 }
@.str = [26 x i8] c"ssleventcb: got event=%d\0A\00"
@.str.2 = [36 x i8] c"ssleventcb: unrecognized event: %d\0A\00"
@str = [10 x i8] c"Connected\00"
define void @ssleventcb(%struct.sslbuffer_t* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
%5 = icmp eq i32 %1, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %10
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %1)
br label %10
10: ; preds = %8, %6
ret void
}