xunge/DecIR huggingface dataset:
/* Type definitions */
struct lexer {
  int dummy;
};

/* Variables and functions */
int lexer_next_peek(struct lexer *);
int lexer_read_literal_quoted(struct lexer *);
int lexer_read_literal_unquoted(struct lexer *);
int lexer_read_literal(struct lexer *lx) {
  int c = lexer_next_peek(lx);
  if (c == '\'')
    return lexer_read_literal_quoted(lx);
  else
    return lexer_read_literal_unquoted(lx);
}


x86 assembly (clang, -O0):
<lexer_read_literal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <lexer_next_peek@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x27,-0x14(%rbp)
jne    1163 <lexer_read_literal+0x33>
mov    -0x10(%rbp),%rdi
call   1050 <lexer_read_literal_quoted@plt>
mov    %eax,-0x4(%rbp)
jmp    116f <lexer_read_literal+0x3f>
mov    -0x10(%rbp),%rdi
call   1030 <lexer_read_literal_unquoted@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lexer_read_literal>:
push   %rbx
mov    %rdi,%rbx
call   1040 <lexer_next_peek@plt>
mov    %rbx,%rdi
cmp    $0x27,%eax
jne    1147 <lexer_read_literal+0x17>
pop    %rbx
jmp    1050 <lexer_read_literal_quoted@plt>
pop    %rbx
jmp    1030 <lexer_read_literal_unquoted@plt>

LLVM IR (-O0):
%struct.lexer = type { i32 }
define i32 @lexer_read_literal(%struct.lexer* %0) {
%2 = alloca i32
%3 = alloca %struct.lexer*
%4 = alloca i32
store %struct.lexer* %0, %struct.lexer** %3
%5 = load %struct.lexer*, %struct.lexer** %3
%6 = call i32 @lexer_next_peek(%struct.lexer* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 39
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load %struct.lexer*, %struct.lexer** %3
%11 = call i32 @lexer_read_literal_quoted(%struct.lexer* %10)
store i32 %11, i32* %2
br label %15
12: ; preds = %1
%13 = load %struct.lexer*, %struct.lexer** %3
%14 = call i32 @lexer_read_literal_unquoted(%struct.lexer* %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.lexer = type { i32 }
define i32 @lexer_read_literal(%struct.lexer* %0) {
%2 = tail call i32 @lexer_next_peek(%struct.lexer* %0)
%3 = icmp eq i32 %2, 39
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lexer_read_literal_quoted(%struct.lexer* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @lexer_read_literal_unquoted(%struct.lexer* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SHR_L_IMM(int reg, int count) {
  addbyte(0xc1);
  addbyte(0xc0 | reg | 0x28);
  addbyte(count);
}


x86 assembly (clang, -O0):
<SHR_L_IMM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xc1,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x28,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHR_L_IMM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xc1,%edi
call   1030 <addbyte@plt>
or     $0xe8,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SHR_L_IMM(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 193)
%6 = load i32, i32* %3
%7 = or i32 192, %6
%8 = or i32 %7, 40
%9 = call i32 @addbyte(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @addbyte(i32 %10)
ret void
}

LLVM IR (-O2):
define void @SHR_L_IMM(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 193)
%4 = or i32 %0, 232
%5 = tail call i32 @addbyte(i32 %4)
%6 = tail call i32 @addbyte(i32 %1)
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ perror_exit(char *);
void *check_malloc(int size) {
  void *p = malloc(size);
  if (p == NULL) {
    perror_exit("malloc failed");
  }
  return p;
}


x86 assembly (clang, -O0):
<check_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <check_malloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <perror_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <check_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <perror_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"malloc failed\00"
define i8* @check_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"malloc failed\00"
define noalias i8* @check_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void foo_2_1_2_1_1_1_1_1_1() {}


x86 assembly (clang, -O0):
<foo_2_1_2_1_1_1_1_1_1>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_2_1_2_1_1_1_1_1_1>:
ret

LLVM IR (-O0):
define void @foo_2_1_2_1_1_1_1_1_1() {
ret void
}

LLVM IR (-O2):
define void @foo_2_1_2_1_1_1_1_1_1() {
ret void
}
void _rtld_atfork_post(int *locks) {}


x86 assembly (clang, -O0):
<_rtld_atfork_post>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rtld_atfork_post>:
ret

LLVM IR (-O0):
define void @_rtld_atfork_post(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret void
}

LLVM IR (-O2):
define void @_rtld_atfork_post(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int __u8;

/* Variables and functions */
scalar_t__ INET_ECN_is_capable(int);
__u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) {
  outer &= ~3;
  if (INET_ECN_is_capable(inner))
    outer |= (inner & 3);
  return outer;
}


x86 assembly (clang, -O0):
<INET_ECN_encapsulate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffffc,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <INET_ECN_is_capable@plt>
cmp    $0x0,%rax
je     1145 <INET_ECN_encapsulate+0x35>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INET_ECN_encapsulate>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
and    $0xfffffffc,%ebp
mov    %esi,%edi
call   1030 <INET_ECN_is_capable@plt>
and    $0x3,%ebx
xor    %ecx,%ecx
test   %rax,%rax
cmovne %ebx,%ecx
or     %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @INET_ECN_encapsulate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, -4
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = call i64 @INET_ECN_is_capable(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = and i32 %11, 3
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
br label %15
15: ; preds = %10, %2
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @INET_ECN_encapsulate(i32 %0, i32 %1) {
%3 = and i32 %0, -4
%4 = tail call i64 @INET_ECN_is_capable(i32 %1)
%5 = icmp eq i64 %4, 0
%6 = and i32 %1, 3
%7 = select i1 %5, i32 0, i32 %6
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ stuff(int);
void hooray_1() { stuff(1); }


x86 assembly (clang, -O0):
<hooray_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <stuff@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hooray_1>:
mov    $0x1,%edi
jmp    1030 <stuff@plt>

LLVM IR (-O0):
define void @hooray_1() {
%1 = call i32 @stuff(i32 1)
ret void
}

LLVM IR (-O2):
define void @hooray_1() {
%1 = tail call i32 @stuff(i32 1)
ret void
}
void g_node_last_child() {}


x86 assembly (clang, -O0):
<g_node_last_child>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_node_last_child>:
ret

LLVM IR (-O0):
define void @g_node_last_child() {
ret void
}

LLVM IR (-O2):
define void @g_node_last_child() {
ret void
}
/* Variables and functions */
int f468(int *);
int f469(int *p) { return f468(p); }


x86 assembly (clang, -O0):
<f469>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <f468@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f469>:
jmp    1030 <f468@plt>

LLVM IR (-O0):
define i32 @f469(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f468(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @f469(i32* %0) {
%2 = tail call i32 @f468(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_CS(int *CS, int num) {
  int ii;
  for (ii = 0; ii < num; ii++) {
    printf("%d", CS[ii]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_CS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_CS+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_CS+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_CS>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_CS+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_CS+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_CS(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print_CS(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
char const *getenv(char *);
const char *IoTHubAccount_GetIoTHubConnString(void) {
  return getenv("IOTHUB_CONNECTION_STRING");
}


x86 assembly (clang, -O0):
<IoTHubAccount_GetIoTHubConnString>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <getenv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IoTHubAccount_GetIoTHubConnString>:
lea    0xee9(%rip),%rdi
jmp    1030 <getenv@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"IOTHUB_CONNECTION_STRING\00"
define i8* @IoTHubAccount_GetIoTHubConnString() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [25 x i8] c"IOTHUB_CONNECTION_STRING\00"
define i8* @IoTHubAccount_GetIoTHubConnString() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void ff_thread_video_encode_frame() {}


x86 assembly (clang, -O0):
<ff_thread_video_encode_frame>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_thread_video_encode_frame>:
ret

LLVM IR (-O0):
define void @ff_thread_video_encode_frame() {
ret void
}

LLVM IR (-O2):
define void @ff_thread_video_encode_frame() {
ret void
}
int addTwo(int x, int y) { return x + 2; }


x86 assembly (clang, -O0):
<addTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addTwo>:
lea    0x2(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @addTwo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @addTwo(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_RemoteIOClient_RemoteInput_InputKeyDown(void *);
int /*<<< orphan*/ printf(char *, int);
void UpnpRemoteIOClient_RemoteInput_InputKeyDown(void *upnptoken, int key) {
  printf("Invoke: UpnpRemoteIOClient_RemoteInput_InputKeyDown(%d);\r\n", key);
  UpnpResponse_RemoteIOClient_RemoteInput_InputKeyDown(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpRemoteIOClient_RemoteInput_InputKeyDown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_RemoteIOClient_RemoteInput_InputKeyDown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_RemoteInput_InputKeyDown>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_RemoteIOClient_RemoteInput_InputKeyDown@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Invoke: UpnpRemoteIOClient_RemoteInput_InputKeyDown(%d);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteInput_InputKeyDown(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputKeyDown(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"Invoke: UpnpRemoteIOClient_RemoteInput_InputKeyDown(%d);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteInput_InputKeyDown(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputKeyDown(i8* %0)
ret void
}
void foo557(int p) {}


x86 assembly (clang, -O0):
<foo557>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo557>:
ret

LLVM IR (-O0):
define void @foo557(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo557(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
bool dziala(pid_t p) {
  if (!kill(p, 0)) {
    return true;
  } else
    return false;
}


x86 assembly (clang, -O0):
<dziala>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <kill@plt>
cmp    $0x0,%eax
jne    113a <dziala+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <dziala+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dziala>:
push   %rax
xor    %esi,%esi
call   1030 <kill@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dziala(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @kill(i32 %4, i32 0)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @dziala(i32 %0) {
%2 = tail call i32 @kill(i32 %0, i32 0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef char *pid_t;

/* Variables and functions */
pid_t getppid(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(64));
  do {
    return (pid_t)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<getppid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getppid>:
mov    $0x40,%eax
int    $0x80
ret

LLVM IR (-O0):
define i8* @getppid() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 64)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %3
ret i8* %5
}

LLVM IR (-O2):
define i8* @getppid() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 64)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ test_1();
int main(int argc, char *argv[]) {
  test_1();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_1()
ret i32 0
}
/* Variables and functions */
scalar_t__ memmem(char const *, int /*<<< orphan*/, char const *,
                  int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *strstr(const char *haystack, const char *needle) {
  return (char *)memmem(haystack, strlen(haystack), needle, strlen(needle));
}


x86 assembly (clang, -O0):
<strstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
call   1040 <memmem@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <memmem@plt>

LLVM IR (-O0):
define i8* @strstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i64 @memmem(i8* %5, i32 %7, i8* %8, i32 %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @strstr(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i64 @memmem(i8* %0, i32 %3, i8* %1, i32 %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
void delay(int count) {
  volatile int j = 0;
  for (j = 0; j < count; j++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1134 <delay+0x34>
jmp    1126 <delay+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <delay+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jge    111f <delay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
store volatile i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load volatile i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load volatile i32, i32* %3
%11 = add nsw i32 %10, 1
store volatile i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp slt i32 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
void LookAt() {
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
}


x86 assembly (clang, -O0):
<LookAt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LookAt>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glLoadIdentity@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @LookAt() {
%1 = load i32, i32* @GL_PROJECTION
%2 = call i32 @glMatrixMode(i32 %1)
%3 = call i32 (...) @glLoadIdentity()
%4 = load i32, i32* @GL_MODELVIEW
%5 = call i32 @glMatrixMode(i32 %4)
%6 = call i32 (...) @glLoadIdentity()
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @LookAt() {
%1 = load i32, i32* @GL_PROJECTION
%2 = tail call i32 @glMatrixMode(i32 %1)
%3 = tail call i32 (...) @glLoadIdentity()
%4 = load i32, i32* @GL_MODELVIEW
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ activate_view(int /*<<< orphan*/);
int /*<<< orphan*/ buffer_from_file(char *);
int /*<<< orphan*/ create_view(int /*<<< orphan*/);
char *get_input(char *);
void open_action() {
  char *fname = get_input("f:");
  activate_view(create_view(buffer_from_file(fname)));
}


x86 assembly (clang, -O0):
<open_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1060 <get_input@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <buffer_from_file@plt>
mov    %eax,%edi
call   1050 <create_view@plt>
mov    %eax,%edi
call   1030 <activate_view@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_action>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1060 <get_input@plt>
mov    %rax,%rdi
call   1040 <buffer_from_file@plt>
mov    %eax,%edi
call   1050 <create_view@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <activate_view@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"f:\00"
define void @open_action() {
%1 = alloca i8*
%2 = call i8* @get_input(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @buffer_from_file(i8* %3)
%5 = call i32 @create_view(i32 %4)
%6 = call i32 @activate_view(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"f:\00"
define void @open_action() {
%1 = tail call i8* @get_input(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @buffer_from_file(i8* %1)
%3 = tail call i32 @create_view(i32 %2)
%4 = tail call i32 @activate_view(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ROR16(int /*<<< orphan*/, int);
int /*<<< orphan*/ SA1Absolute(int);
void Op6EM0(void) { ROR16(SA1Absolute(3), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op6EM0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1030 <ROR16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op6EM0>:
push   %rax
mov    $0x3,%edi
call   1040 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1030 <ROR16@plt>

LLVM IR (-O0):
define void @Op6EM0() {
%1 = call i32 @SA1Absolute(i32 3)
%2 = call i32 @ROR16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op6EM0() {
%1 = tail call i32 @SA1Absolute(i32 3)
%2 = tail call i32 @ROR16(i32 %1, i32 16777215)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ioeta_free(int /*<<< orphan*/ *);
void test_free_of_null_is_ok(void) { ioeta_free(NULL); }


x86 assembly (clang, -O0):
<test_free_of_null_is_ok>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <ioeta_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_free_of_null_is_ok>:
xor    %edi,%edi
jmp    1030 <ioeta_free@plt>

LLVM IR (-O0):
define void @test_free_of_null_is_ok() {
%1 = call i32 @ioeta_free(i32* null)
ret void
}

LLVM IR (-O2):
define void @test_free_of_null_is_ok() {
%1 = tail call i32 @ioeta_free(i32* null)
ret void
}
/* Variables and functions */
char *strdup_n(char const *, int);
char *qstrndup(const char *string, int len) { return strdup_n(string, len); }


x86 assembly (clang, -O0):
<qstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strdup_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qstrndup>:
jmp    1030 <strdup_n@plt>

LLVM IR (-O0):
define i8* @qstrndup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @strdup_n(i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @qstrndup(i8* %0, i32 %1) {
%3 = tail call i8* @strdup_n(i8* %0, i32 %1)
ret i8* %3
}
__attribute__((noreturn)) void hang() {
  for (;;)
    __asm__("hlt");
}


x86 assembly (clang, -O0):
<hang>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <hang+0x9>
hlt
jmp    1109 <hang+0x9>

x86 assembly (clang, -O2):
<hang>:
hlt
jmp    1100 <hang>

LLVM IR (-O0):
define void @hang() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @hang() {
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ tabela_ascii(int, int);
int main() {
  tabela_ascii(32, 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x20,%edi
mov    $0x64,%esi
call   1030 <tabela_ascii@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20,%edi
mov    $0x64,%esi
call   1030 <tabela_ascii@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @tabela_ascii(i32 32, i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @tabela_ascii(i32 32, i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_extra_buttons_line(char);
int /*<<< orphan*/ print_6_buttons_line(char);
void print_extra_buttons_line(char id, char type) {
  if (type) {
    print_6_buttons_line(id);
  } else {
    clear_extra_buttons_line(id);
  }
}


x86 assembly (clang, -O0):
<print_extra_buttons_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     114c <print_extra_buttons_line+0x2c>
movsbl -0x1(%rbp),%edi
call   1040 <print_6_buttons_line@plt>
jmp    1155 <print_extra_buttons_line+0x35>
movsbl -0x1(%rbp),%edi
call   1030 <clear_extra_buttons_line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_extra_buttons_line>:
movsbl %dil,%edi
test   %sil,%sil
je     112e <print_extra_buttons_line+0xe>
jmp    1040 <print_6_buttons_line@plt>
jmp    1030 <clear_extra_buttons_line@plt>

LLVM IR (-O0):
define void @print_extra_buttons_line(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8, i8* %3
%9 = call i32 @print_6_buttons_line(i8 signext %8)
br label %13
10: ; preds = %2
%11 = load i8, i8* %3
%12 = call i32 @clear_extra_buttons_line(i8 signext %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
define void @print_extra_buttons_line(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @print_6_buttons_line(i8 signext %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @clear_extra_buttons_line(i8 signext %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InitElementSoundInfo();
int /*<<< orphan*/ InitGameModeSoundInfo();
int /*<<< orphan*/ InitPlayLevelSound();
int /*<<< orphan*/ InitSoundInfo();
void ReinitializeSounds() {
  InitSoundInfo();
  InitElementSoundInfo();
  InitGameModeSoundInfo();
  InitPlayLevelSound();
}


x86 assembly (clang, -O0):
<ReinitializeSounds>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <InitSoundInfo@plt>
mov    $0x0,%al
call   1030 <InitElementSoundInfo@plt>
mov    $0x0,%al
call   1060 <InitGameModeSoundInfo@plt>
mov    $0x0,%al
call   1040 <InitPlayLevelSound@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReinitializeSounds>:
push   %rax
xor    %eax,%eax
call   1050 <InitSoundInfo@plt>
xor    %eax,%eax
call   1030 <InitElementSoundInfo@plt>
xor    %eax,%eax
call   1060 <InitGameModeSoundInfo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <InitPlayLevelSound@plt>

LLVM IR (-O0):
define void @ReinitializeSounds() {
%1 = call i32 (...) @InitSoundInfo()
%2 = call i32 (...) @InitElementSoundInfo()
%3 = call i32 (...) @InitGameModeSoundInfo()
%4 = call i32 (...) @InitPlayLevelSound()
ret void
}

LLVM IR (-O2):
define void @ReinitializeSounds() {
%1 = tail call i32 (...) @InitSoundInfo()
%2 = tail call i32 (...) @InitElementSoundInfo()
%3 = tail call i32 (...) @InitGameModeSoundInfo()
%4 = tail call i32 (...) @InitPlayLevelSound()
ret void
}
void empty_func_to_make_compiler_happy() {}


x86 assembly (clang, -O0):
<empty_func_to_make_compiler_happy>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_func_to_make_compiler_happy>:
ret

LLVM IR (-O0):
define void @empty_func_to_make_compiler_happy() {
ret void
}

LLVM IR (-O2):
define void @empty_func_to_make_compiler_happy() {
ret void
}
void encodeDmaWaitForPeri(void) {}


x86 assembly (clang, -O0):
<encodeDmaWaitForPeri>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodeDmaWaitForPeri>:
ret

LLVM IR (-O0):
define void @encodeDmaWaitForPeri() {
ret void
}

LLVM IR (-O2):
define void @encodeDmaWaitForPeri() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WrXError(int, char *);
int AddrXError(int Num, char *Param) {
  WrXError(Num, Param);
  return -1;
}


x86 assembly (clang, -O0):
<AddrXError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <WrXError@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddrXError>:
push   %rax
call   1030 <WrXError@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @AddrXError(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @WrXError(i32 %5, i8* %6)
ret i32 -1
}

LLVM IR (-O2):
define i32 @AddrXError(i32 %0, i8* %1) {
%3 = tail call i32 @WrXError(i32 %0, i8* %1)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ tokenizer_error_print();
int /*<<< orphan*/ tokenizer_next();
int tokenizer_token();
void accept(int token) {
  if (token != tokenizer_token()) {

    ;
    tokenizer_error_print();
    exit(1);
  };
  tokenizer_next();
}


x86 assembly (clang, -O0):
<accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <tokenizer_token@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
je     1176 <accept+0x36>
mov    $0x0,%al
call   1040 <tokenizer_error_print@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1060 <tokenizer_next@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <tokenizer_token@plt>
cmp    %ebx,%eax
jne    1156 <accept+0x16>
xor    %eax,%eax
pop    %rbx
jmp    1060 <tokenizer_next@plt>
xor    %eax,%eax
call   1040 <tokenizer_error_print@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @accept(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @tokenizer_token()
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (...) @tokenizer_error_print()
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = call i32 (...) @tokenizer_next()
ret void
}

LLVM IR (-O2):
define void @accept(i32 %0) {
%2 = tail call i32 (...) @tokenizer_token()
%3 = icmp eq i32 %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 (...) @tokenizer_error_print()
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 (...) @tokenizer_next()
ret void
}
void plugin_close(void) {}


x86 assembly (clang, -O0):
<plugin_close>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_close>:
ret

LLVM IR (-O0):
define void @plugin_close() {
ret void
}

LLVM IR (-O2):
define void @plugin_close() {
ret void
}
/* Variables and functions */
int TCSAFLUSH;
int termios_tcsflush(void) { return TCSAFLUSH; }


x86 assembly (clang, -O0):
<termios_tcsflush>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<termios_tcsflush>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@TCSAFLUSH = global i32 0
define i32 @termios_tcsflush() {
%1 = load i32, i32* @TCSAFLUSH
ret i32 %1
}

LLVM IR (-O2):
@TCSAFLUSH = global i32 0
define i32 @termios_tcsflush() {
%1 = load i32, i32* @TCSAFLUSH
ret i32 %1
}
/* Variables and functions */
int log_set_verbose(int);
int verbose_cmd(int nargs, char **args) { return log_set_verbose(1); }


x86 assembly (clang, -O0):
<verbose_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <log_set_verbose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verbose_cmd>:
mov    $0x1,%edi
jmp    1030 <log_set_verbose@plt>

LLVM IR (-O0):
define i32 @verbose_cmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @log_set_verbose(i32 1)
ret i32 %5
}

LLVM IR (-O2):
define i32 @verbose_cmd(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @log_set_verbose(i32 1)
ret i32 %3
}
int _hash_string_efficient(const char *str, int M) {
  int hash = 0, a = 127;
  for (; *str != '\0'; str++) {
    hash = (a * hash + *str) % M;
  }
  return hash;
}


x86 assembly (clang, -O0):
<_hash_string_efficient>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x7f,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <_hash_string_efficient+0x51>
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1119 <_hash_string_efficient+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash_string_efficient>:
mov    (%rdi),%al
test   %al,%al
je     112d <_hash_string_efficient+0x2d>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movsbl %al,%ecx
mov    %edx,%eax
shl    $0x7,%eax
sub    %edx,%eax
add    %ecx,%eax
cltd
idiv   %esi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <_hash_string_efficient+0x10>
mov    %edx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_hash_string_efficient(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 127, i32* %6
br label %7
7: ; preds = %22, %2
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %7
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = mul nsw i32 %13, %14
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = add nsw i32 %15, %18
%20 = load i32, i32* %4
%21 = srem i32 %19, %20
store i32 %21, i32* %5
br label %22
22: ; preds = %12
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %7
25: ; preds = %7
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @_hash_string_efficient(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i8* [ %13, %5 ], [ %0, %2 ]
%8 = phi i32 [ %12, %5 ], [ 0, %2 ]
%9 = sext i8 %6 to i32
%10 = mul nsw i32 %8, 127
%11 = add nsw i32 %10, %9
%12 = srem i32 %11, %1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %17
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
size_t append_ascii_hex_sub(uint8_t *dst, uint8_t arg) {
  if (arg == 1) {
    dst[0] = 0xfe;
    dst[1] = 0x09;
    return 2;
  }
  dst[0] = 0x80;
  dst[1] = 0x29;
  dst[2] = arg;
  return 3;
}


x86 assembly (clang, -O0):
<append_ascii_hex_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1137 <append_ascii_hex_sub+0x37>
mov    -0x10(%rbp),%rax
movl   $0xfe,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x9,0x4(%rax)
movq   $0x2,-0x8(%rbp)
jmp    115e <append_ascii_hex_sub+0x5e>
mov    -0x10(%rbp),%rax
movl   $0x80,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x29,0x4(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
movq   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_ascii_hex_sub>:
cmp    $0x1,%esi
jne    1119 <append_ascii_hex_sub+0x19>
movl   $0xfe,(%rdi)
mov    $0x2,%eax
mov    $0x9,%ecx
mov    %ecx,0x4(%rdi)
ret
movl   $0x80,(%rdi)
mov    %esi,0x8(%rdi)
mov    $0x3,%eax
mov    $0x29,%ecx
mov    %ecx,0x4(%rdi)
ret

LLVM IR (-O0):
define i64 @append_ascii_hex_sub(i32* %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 254, i32* %10
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 9, i32* %12
store i64 2, i64* %3
br label %21
13: ; preds = %2
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 128, i32* %15
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32 41, i32* %17
%18 = load i32, i32* %5
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 2
store i32 %18, i32* %20
store i64 3, i64* %3
br label %21
21: ; preds = %13, %8
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @append_ascii_hex_sub(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %5
4: ; preds = %2
store i32 254, i32* %0
br label %7
5: ; preds = %2
store i32 128, i32* %0
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %1, i32* %6
br label %7
7: ; preds = %5, %4
%8 = phi i32 [ 9, %4 ], [ 41, %5 ]
%9 = phi i64 [ 2, %4 ], [ 3, %5 ]
%10 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %8, i32* %10
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, unsigned int);
void f1() {
  int size = 12;
  char src[12] = "helloworld";
  char dest[12];
  memcpy(dest, src, (unsigned)size);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xc,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
sub    $0x18,%rsp
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f1.src = [12 x i8] c"helloworld\00\00"
define void @f1() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
store i32 12, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* %1
%8 = call i32 @memcpy(i8* %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@__const.f1.src = [12 x i8] c"helloworld\00\00"
define void @f1() {
%1 = alloca [12 x i8]
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %3, i32 12)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (double)t.tv_sec + (double)t.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
/* Variables and functions */
unsigned char read_max(int);
unsigned char dip() { return read_max(0x2); }


x86 assembly (clang, -O0):
<dip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <read_max@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dip>:
mov    $0x2,%edi
jmp    1030 <read_max@plt>

LLVM IR (-O0):
define zeroext i8 @dip() {
%1 = call zeroext i8 @read_max(i32 2)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @dip() {
%1 = tail call zeroext i8 @read_max(i32 2)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void STEST903(int v) {
  printf("C903:(%d):(5):Call by value from literal\n", v);
}


x86 assembly (clang, -O0):
<STEST903>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STEST903>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"C903:(%d):(5):Call by value from literal\0A\00"
define void @STEST903(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"C903:(%d):(5):Call by value from literal\0A\00"
define void @STEST903(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
scalar_t__ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int open(const char *file, int flags, ...) {
  return (int)syscall(5, (uint)file, (uint)flags, 0);
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x5,%edi
xor    %ecx,%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x5,%edi
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
%7 = load i32, i32* %4
%8 = call i64 @syscall(i32 5, i32 %6, i32 %7, i32 0)
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1, ...) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i64 @syscall(i32 5, i32 %4, i32 %1, i32 0)
%6 = trunc i64 %5 to i32
ret i32 %6
}
void signal_handler(int signal) { (void)signal; }


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
ret

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
ret void
}