xunge/DecIR huggingface dataset:
/* Variables and functions */
int CDROM_AUDIO_PAUSED;
int cd_hw_status();
int cd_paused(void) {
  int pause = cd_hw_status();
  if (CDROM_AUDIO_PAUSED == pause)
    return 1;
  return (!1);
}


x86 assembly (clang, -O0):
<cd_paused>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <cd_hw_status@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    1140 <cd_paused+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1147 <cd_paused+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_paused>:
push   %rax
xor    %eax,%eax
call   1030 <cd_hw_status@plt>
mov    0x2ed1(%rip),%rdx
xor    %ecx,%ecx
cmp    %eax,(%rdx)
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@CDROM_AUDIO_PAUSED = global i32 0
define i32 @cd_paused() {
%1 = tail call i32 (...) @cd_hw_status()
%2 = load i32, i32* @CDROM_AUDIO_PAUSED
%3 = icmp eq i32 %2, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FTSENT;

/* Variables and functions */
int birthcmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
int revbirthcmp(const FTSENT *a, const FTSENT *b) { return (birthcmp(b, a)); }


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

x86 assembly (clang, -O2):
<revbirthcmp>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <birthcmp@plt>

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

LLVM IR (-O2):
define i32 @revbirthcmp(i32* %0, i32* %1) {
%3 = tail call i32 @birthcmp(i32* %1, i32* %0)
ret i32 %3
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_routing(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_routing>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_routing(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_routing(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void ExttProjectAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttProjectAuxTable() {
ret void
}
int evhttp_valid_response_code(int code) {
  if (code == 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<evhttp_valid_response_code>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <evhttp_valid_response_code+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <evhttp_valid_response_code+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evhttp_valid_response_code>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @evhttp_valid_response_code(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ swapchar(char *, char, char);
void fixslashes(char *pOriginal) { swapchar(pOriginal, '\\', '/'); }


x86 assembly (clang, -O0):
<fixslashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
mov    $0x2f,%edx
call   1030 <swapchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixslashes>:
mov    $0x5c,%esi
mov    $0x2f,%edx
jmp    1030 <swapchar@plt>

LLVM IR (-O0):
define void @fixslashes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @swapchar(i8* %3, i8 signext 92, i8 signext 47)
ret void
}

LLVM IR (-O2):
define void @fixslashes(i8* %0) {
%2 = tail call i32 @swapchar(i8* %0, i8 signext 92, i8 signext 47)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_draw_arc() { exit(1); }


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

x86 assembly (clang, -O2):
<caml_gr_draw_arc>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_draw_arc() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_draw_arc() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct sockaddr_un {
  int /*<<< orphan*/ sun_path;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct sockaddr_un const *);
char *strdup(int /*<<< orphan*/);
char *tow_unix_socket_address_alloc_description(
    struct sockaddr_un const *socket_address) {
  assert(socket_address);
  return strdup(socket_address->sun_path);
}


x86 assembly (clang, -O0):
<tow_unix_socket_address_alloc_description>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tow_unix_socket_address_alloc_description>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <strdup@plt>

LLVM IR (-O0):
%struct.sockaddr_un = type { i32 }
define i8* @tow_unix_socket_address_alloc_description(%struct.sockaddr_un* %0) {
%2 = alloca %struct.sockaddr_un*
store %struct.sockaddr_un* %0, %struct.sockaddr_un** %2
%3 = load %struct.sockaddr_un*, %struct.sockaddr_un** %2
%4 = call i32 @assert(%struct.sockaddr_un* %3)
%5 = load %struct.sockaddr_un*, %struct.sockaddr_un** %2
%6 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i8* @strdup(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32 }
define i8* @tow_unix_socket_address_alloc_description(%struct.sockaddr_un* %0) {
%2 = tail call i32 @assert(%struct.sockaddr_un* %0)
%3 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i8* @strdup(i32 %4)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct strbuf {
  int dummy;
};

/* Variables and functions */
int strbuf_vprintf_internal(struct strbuf *, char const *, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int strbuf_vprintf(struct strbuf *sb, const char *format, va_list ap) {
  return strbuf_vprintf_internal(sb, format, ap, 0);
}


x86 assembly (clang, -O0):
<strbuf_vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <strbuf_vprintf_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbuf_vprintf>:
xor    %ecx,%ecx
jmp    1030 <strbuf_vprintf_internal@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define i32 @strbuf_vprintf(%struct.strbuf* %0, i8* %1, i32 %2) {
%4 = alloca %struct.strbuf*
%5 = alloca i8*
%6 = alloca i32
store %struct.strbuf* %0, %struct.strbuf** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.strbuf*, %struct.strbuf** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @strbuf_vprintf_internal(%struct.strbuf* %7, i8* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define i32 @strbuf_vprintf(%struct.strbuf* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strbuf_vprintf_internal(%struct.strbuf* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int *);
void fixnum(int min, int max, int *n) {
  assert(n);
  if (*n < min) {
    *n = min;
  }
  if (*n > max) {
    *n = max;
  }
}


x86 assembly (clang, -O0):
<fixnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jge    1143 <fixnum+0x33>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jle    115b <fixnum+0x4b>
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixnum>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <assert@plt>
mov    (%rbx),%eax
cmp    %ebp,%eax
cmovl  %ebp,%eax
jl     1132 <fixnum+0x22>
cmp    %r14d,%eax
jle    113b <fixnum+0x2b>
cmp    %r14d,%eax
cmovg  %r14d,%eax
mov    %eax,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fixnum(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = call i32 @assert(i32* %7)
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i32, i32* %4
%15 = load i32*, i32** %6
store i32 %14, i32* %15
br label %16
16: ; preds = %13, %3
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = load i32, i32* %5
%20 = icmp sgt i32 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = load i32, i32* %5
%23 = load i32*, i32** %6
store i32 %22, i32* %23
br label %24
24: ; preds = %21, %16
ret void
}

LLVM IR (-O2):
define void @fixnum(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @assert(i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, %0
%7 = select i1 %6, i32 %0, i32 %5
%8 = icmp sgt i32 %7, %1
%9 = or i1 %6, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = select i1 %8, i32 %1, i32 %7
store i32 %11, i32* %2
br label %12
12: ; preds = %3, %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ strlcat(char *, char *, int);
int strnlen(char *, int);
void add_number(int i, char *result) {
  char number[10];
  if (strnlen(result, sizeof(result)) < 1) {
    itoa(i, number);
    strlcat(result, number, sizeof(result));
  }
}


x86 assembly (clang, -O0):
<add_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1040 <strnlen@plt>
cmp    $0x1,%eax
jge    1174 <add_number+0x44>
mov    -0x4(%rbp),%edi
lea    -0x1a(%rbp),%rsi
call   1050 <itoa@plt>
mov    -0x10(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strlcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_number>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    $0x8,%esi
call   1040 <strnlen@plt>
test   %eax,%eax
jg     116d <add_number+0x3d>
lea    0x6(%rsp),%r14
mov    %ebp,%edi
mov    %r14,%rsi
call   1050 <itoa@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1030 <strlcat@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @add_number(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [10 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strnlen(i8* %6, i32 8)
%8 = icmp slt i32 %7, 1
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i32, i32* %3
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%12 = call i32 @itoa(i32 %10, i8* %11)
%13 = load i8*, i8** %4
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%15 = call i32 @strlcat(i8* %13, i8* %14, i32 8)
br label %16
16: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @add_number(i32 %0, i8* %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @strnlen(i8* %1, i32 8)
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @itoa(i32 %0, i8* %4)
%9 = call i32 @strlcat(i8* %1, i8* %4, i32 8)
br label %10
10: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _ndelay(int);
void _udelay(unsigned int n) {
  while (n >= 10) {
    _ndelay(10000);
    n -= 10;
  }
  while (n-- > 0) {
    _ndelay(1000);
  }
}


x86 assembly (clang, -O0):
<_udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jb     113d <_udelay+0x2d>
mov    $0x2710,%edi
call   1030 <_ndelay@plt>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <_udelay+0xb>
jmp    1142 <_udelay+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jbe    1165 <_udelay+0x55>
mov    $0x3e8,%edi
call   1030 <_ndelay@plt>
jmp    1142 <_udelay+0x32>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_udelay>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jb     1132 <_udelay+0x22>
nopl   0x0(%rax,%rax,1)
mov    $0x2710,%edi
call   1030 <_ndelay@plt>
add    $0xfffffff6,%ebx
cmp    $0x9,%ebx
ja     1120 <_udelay+0x10>
test   %ebx,%ebx
je     114f <_udelay+0x3f>
cs nopw 0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <_ndelay@plt>
add    $0xffffffff,%ebx
jne    1140 <_udelay+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @_udelay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp uge i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 @_ndelay(i32 10000)
%8 = load i32, i32* %2
%9 = sub i32 %8, 10
store i32 %9, i32* %2
br label %3
10: ; preds = %3
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %2
%13 = add i32 %12, -1
store i32 %13, i32* %2
%14 = icmp ugt i32 %12, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @_ndelay(i32 1000)
br label %11
17: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @_udelay(i32 %0) {
%2 = icmp ugt i32 %0, 9
br i1 %2, label %6, label %3
3: ; preds = %6, %1
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %11
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %0, %1 ]
%8 = tail call i32 @_ndelay(i32 10000)
%9 = add i32 %7, -10
%10 = icmp ugt i32 %9, 9
br i1 %10, label %6, label %3
11: ; preds = %3, %11
%12 = phi i32 [ %13, %11 ], [ %4, %3 ]
%13 = add i32 %12, -1
%14 = tail call i32 @_ndelay(i32 1000)
%15 = icmp eq i32 %13, 0
br i1 %15, label %16, label %11
16: ; preds = %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printarg(int param1) {
  printf("Fifty five is %d\n", param1);
  return;
}


x86 assembly (clang, -O0):
<printarg>:
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):
<printarg>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Fifty five is %d\0A\00"
define void @printarg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Fifty five is %d\0A\00"
define void @printarg(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StartConnection(char **);
int /*<<< orphan*/ getchar();
int main(int argc, char *argv[]) {
  StartConnection(argv);
  getchar();
  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    -0x10(%rbp),%rdi
call   1040 <StartConnection@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdi
call   1040 <StartConnection@plt>
xor    %eax,%eax
call   1030 <getchar@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 = load i8**, i8*** %5
%7 = call i32 @StartConnection(i8** %6)
%8 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @StartConnection(i8** %1)
%4 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mpga_set_copyright(uint8_t *p_mpga) { p_mpga[3] |= 0x80; }


x86 assembly (clang, -O0):
<mpga_set_copyright>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
or     $0x80,%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_set_copyright>:
orb    $0x80,0xc(%rdi)
ret

LLVM IR (-O0):
define void @mpga_set_copyright(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = or i32 %5, 128
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mpga_set_copyright(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = or i32 %3, 128
store i32 %4, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_REQ;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ **);
int /*<<< orphan*/ X509_REQ_it;
X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req) {
  return ASN1_item_d2i_fp(&X509_REQ_it, fp, req);
}


x86 assembly (clang, -O0):
<d2i_X509_REQ_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2ec9(%rip),%rdi
call   1030 <ASN1_item_d2i_fp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_X509_REQ_fp>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2edb(%rip),%rdi
jmp    1030 <ASN1_item_d2i_fp@plt>

LLVM IR (-O0):
@X509_REQ_it = global i32 0
define i32* @d2i_X509_REQ_fp(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 = load i32**, i32*** %4
%7 = call i32* @ASN1_item_d2i_fp(i32* @X509_REQ_it, i32* %5, i32** %6)
ret i32* %7
}

LLVM IR (-O2):
@X509_REQ_it = global i32 0
define i32* @d2i_X509_REQ_fp(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_fp(i32* @X509_REQ_it, i32* %0, i32** %1)
ret i32* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int ehrpwm_pwm_start(int /*<<< orphan*/);
int mdaq_pwm_start(uint8_t channel) { return ehrpwm_pwm_start(channel); }


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

x86 assembly (clang, -O2):
<mdaq_pwm_start>:
jmp    1030 <ehrpwm_pwm_start@plt>

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

LLVM IR (-O2):
define i32 @mdaq_pwm_start(i32 %0) {
%2 = tail call i32 @ehrpwm_pwm_start(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ irc_topic(char *, char *);
char *strtok(char *, char *);
void child_topic(char *p) {
  char *chan, *topic;
  chan = strtok(p, " ");
  topic = strtok(NULL, "");
  irc_topic(chan, topic);
}


x86 assembly (clang, -O0):
<child_topic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb6(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <irc_topic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_topic>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rsi
xor    %edi,%edi
call   1030 <strtok@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <irc_topic@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @child_topic(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @irc_topic(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @child_topic(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @irc_topic(i8* %2, i8* %3)
ret void
}
int my_isblank(char c) {
  return c == '\t' || c == ' ' || c == '\r' || c == '\n';
}


x86 assembly (clang, -O0):
<my_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <my_isblank+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <my_isblank+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <my_isblank+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isblank>:
cmp    $0x20,%dil
ja     1120 <my_isblank+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    1120 <my_isblank+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @my_isblank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 9
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @my_isblank(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int iHxFaceSeparateSaleCheck(unsigned char *psRid, unsigned char *pszPan,
                             int iPanSeqNo, unsigned char *pszAmount) {
  return (99);
}


x86 assembly (clang, -O0):
<iHxFaceSeparateSaleCheck>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x63,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iHxFaceSeparateSaleCheck>:
mov    $0x63,%eax
ret

LLVM IR (-O0):
define i32 @iHxFaceSeparateSaleCheck(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret i32 99
}

LLVM IR (-O2):
define i32 @iHxFaceSeparateSaleCheck(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ singlogdeinit_();
int singlogdeinitonce() {
  { singlogdeinit_(); }
}


x86 assembly (clang, -O0):
<singlogdeinitonce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <singlogdeinit_@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<singlogdeinitonce>:
xor    %eax,%eax
jmp    1030 <singlogdeinit_@plt>

LLVM IR (-O0):
define i32 @singlogdeinitonce() {
%1 = alloca i32
%2 = call i32 (...) @singlogdeinit_()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @singlogdeinitonce() {
%1 = tail call i32 (...) @singlogdeinit_()
ret i32 undef
}
int _tc_dummyfunc(void) { return 0; }


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

x86 assembly (clang, -O2):
<_tc_dummyfunc>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_tc_dummyfunc() {
ret i32 0
}

LLVM IR (-O2):
define i32 @_tc_dummyfunc() {
ret i32 0
}
int szyfr(int buf[4]) {
  int i;
  int j = 0;
  for (i = 0; i < 4; i++) {
    j = (j << 8) | (buf[i] & 255);
  }
  return j;
}


x86 assembly (clang, -O0):
<szyfr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    114a <szyfr+0x4a>
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <szyfr+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<szyfr>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x18,%eax
movzbl %cl,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
shl    $0x8,%edx
movzwl %dx,%edx
or     %ecx,%edx
movzbl 0xc(%rdi),%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @szyfr(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32, i32* %4
%10 = shl i32 %9, 8
%11 = load i32*, i32** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = and i32 %15, 255
%17 = or i32 %10, %16
store i32 %17, i32* %4
br label %18
18: ; preds = %8
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %5
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @szyfr(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %2, 24
%8 = shl i32 %4, 16
%9 = and i32 %8, 16711680
%10 = or i32 %7, %9
%11 = shl i32 %6, 8
%12 = and i32 %11, 65280
%13 = or i32 %10, %12
%14 = getelementptr inbounds i32, i32* %0, i64 3
%15 = load i32, i32* %14
%16 = and i32 %15, 255
%17 = or i32 %16, %13
ret i32 %17
}
int SN_get_nb_iters(int *iparam) { return iparam[1]; }


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

x86 assembly (clang, -O2):
<SN_get_nb_iters>:
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @SN_get_nb_iters(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @SN_get_nb_iters(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
int lirc_t_max(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<lirc_t_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <lirc_t_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <lirc_t_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lirc_t_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @lirc_t_max(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 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @lirc_t_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
int SIGN_EXTEND_W_B(int reg) {
  addbyte(0x0f);
  addbyte(0xbe);
  addbyte(0xc0 | reg | (reg << 3));
  return reg;
}


x86 assembly (clang, -O0):
<SIGN_EXTEND_W_B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xbe,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIGN_EXTEND_W_B>:
push   %rbx
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xbe,%edi
call   1030 <addbyte@plt>
lea    0x0(,%rbx,8),%edi
or     %ebx,%edi
or     $0xc0,%edi
call   1030 <addbyte@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SIGN_EXTEND_W_B(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @addbyte(i32 15)
%4 = call i32 @addbyte(i32 190)
%5 = load i32, i32* %2
%6 = or i32 192, %5
%7 = load i32, i32* %2
%8 = shl i32 %7, 3
%9 = or i32 %6, %8
%10 = call i32 @addbyte(i32 %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @SIGN_EXTEND_W_B(i32 returned %0) {
%2 = tail call i32 @addbyte(i32 15)
%3 = tail call i32 @addbyte(i32 190)
%4 = shl i32 %0, 3
%5 = or i32 %4, %0
%6 = or i32 %5, 192
%7 = tail call i32 @addbyte(i32 %6)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ func();
int main() {
  func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func()
ret i32 0
}
/* Variables and functions */
char *malloc(int);
char *string_new() {
  char *buffer = malloc(sizeof(char) * 256);
  buffer[0] = '\0';
  return buffer;
}


x86 assembly (clang, -O0):
<string_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x100,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_new>:
push   %rax
mov    $0x100,%edi
call   1030 <malloc@plt>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @string_new() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 256)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 0, i8* %4
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @string_new() {
%1 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
store i8 0, i8* %1
ret i8* %1
}
/* Variables and functions */
void *memalign(size_t, size_t);
void *aligned_alloc(size_t boundary, size_t size) {
  return memalign(boundary, size);
}


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

x86 assembly (clang, -O2):
<aligned_alloc>:
jmp    1030 <memalign@plt>

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

LLVM IR (-O2):
define noalias i8* @aligned_alloc(i64 %0, i64 %1) {
%3 = tail call i8* @memalign(i64 %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int u_int64_t;
typedef int u_int32_t;
typedef scalar_t__ u_int;

/* Variables and functions */
scalar_t__ fls32(int);
u_int ffs64(u_int64_t v) {
  u_int32_t l;
  if ((l = v & 0xffffffff))
    return fls32(l);
  else if ((l = v >> 32))
    return 32 + fls32(l);
  else
    return 0;
}


x86 assembly (clang, -O0):
<ffs64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113e <ffs64+0x2e>
mov    -0x10(%rbp),%edi
call   1030 <fls32@plt>
mov    %rax,-0x8(%rbp)
jmp    1171 <ffs64+0x61>
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1169 <ffs64+0x59>
mov    -0x10(%rbp),%edi
call   1030 <fls32@plt>
add    $0x20,%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <ffs64+0x61>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs64>:
test   %edi,%edi
je     1119 <ffs64+0x9>
jmp    1030 <fls32@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @ffs64(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, -1
store i32 %6, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %4
%10 = call i64 @fls32(i32 %9)
store i64 %10, i64* %2
br label %20
11: ; preds = %1
%12 = load i32, i32* %3
%13 = ashr i32 %12, 32
store i32 %13, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* %4
%17 = call i64 @fls32(i32 %16)
%18 = add nsw i64 32, %17
store i64 %18, i64* %2
br label %20
19: ; preds = %11
store i64 0, i64* %2
br label %20
20: ; preds = %19, %15, %8
%21 = load i64, i64* %2
ret i64 %21
}

LLVM IR (-O2):
define i64 @ffs64(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @fls32(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ crc16_continue(int, int /*<<< orphan*/ const *,
                                  int /*<<< orphan*/);
uint16_t crc16(const uint8_t *buffer, uint32_t size) {
  return crc16_continue(0xFFFF, buffer, size);
}


x86 assembly (clang, -O0):
<crc16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0xffff,%edi
call   1030 <crc16_continue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc16>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xffff,%edi
jmp    1030 <crc16_continue@plt>

LLVM IR (-O0):
define i32 @crc16(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 = load i32, i32* %4
%7 = call i32 @crc16_continue(i32 65535, i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @crc16(i32* %0, i32 %1) {
%3 = tail call i32 @crc16_continue(i32 65535, i32* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int mutexattr_destroy(int /*<<< orphan*/ *);
int pthread_mutexattr_destroy(pthread_mutexattr_t *attr) {
  return mutexattr_destroy(attr);
}


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

x86 assembly (clang, -O2):
<pthread_mutexattr_destroy>:
jmp    1030 <mutexattr_destroy@plt>

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_destroy(i32* %0) {
%2 = tail call i32 @mutexattr_destroy(i32* %0)
ret i32 %2
}
void ResultIRQ_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @ResultIRQ_Interrupt() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank0Low(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m22_SetChrROMBank0();
void m22_setParamsBXX0(uint16_t addr, uint8_t val) {
  __setCHRBank0Low(addr, val);
  m22_SetChrROMBank0();
}


x86 assembly (clang, -O0):
<m22_setParamsBXX0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__setCHRBank0Low@plt>
mov    $0x0,%al
call   1040 <m22_SetChrROMBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m22_setParamsBXX0>:
push   %rax
call   1030 <__setCHRBank0Low@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <m22_SetChrROMBank0@plt>

LLVM IR (-O0):
define void @m22_setParamsBXX0(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 = load i32, i32* %4
%7 = call i32 @__setCHRBank0Low(i32 %5, i32 %6)
%8 = call i32 (...) @m22_SetChrROMBank0()
ret void
}

LLVM IR (-O2):
define void @m22_setParamsBXX0(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank0Low(i32 %0, i32 %1)
%4 = tail call i32 (...) @m22_SetChrROMBank0()
ret void
}
void sys_disable_interrupts(void) { asm volatile("cli" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @sys_disable_interrupts() {
tail call void asm sideeffect "cli", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ch;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned short *, int, int, int /*<<< orphan*/ *);
void gen_ascii(FILE *fp) {
  unsigned short ch = 0x20;
  for (; ch < 127; ch++) {
    fwrite(&ch, sizeof(ch), 1, fp);
  }
}


x86 assembly (clang, -O0):
<gen_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x20,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
cmp    $0x7f,%eax
jge    1157 <gen_ascii+0x47>
mov    -0x8(%rbp),%rcx
lea    -0xa(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    -0xa(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa(%rbp)
jmp    1122 <gen_ascii+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_ascii>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movw   $0x20,0x6(%rsp)
lea    0x6(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
movzwl 0x6(%rsp),%eax
add    $0x1,%eax
mov    %ax,0x6(%rsp)
cmp    $0x7f,%ax
jb     1130 <gen_ascii+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @gen_ascii(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
store i32* %0, i32** %2
store i16 32, i16* %3
br label %4
4: ; preds = %11, %1
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = icmp slt i32 %6, 127
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32*, i32** %2
%10 = call i32 @fwrite(i16* %3, i32 2, i32 1, i32* %9)
br label %11
11: ; preds = %8
%12 = load i16, i16* %3
%13 = add i16 %12, 1
store i16 %13, i16* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @gen_ascii(i32* nocapture %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
store i16 32, i16* %2
br label %4
4: ; preds = %1, %4
%5 = call i32 @fwrite(i16* %2, i32 2, i32 1, i32* %0)
%6 = load i16, i16* %2
%7 = add i16 %6, 1
store i16 %7, i16* %2
%8 = icmp ult i16 %7, 127
br i1 %8, label %4, label %9
9: ; preds = %4
ret void
}
int test_imm_93int64_midword_reg(long long val) {
  return ((val >> 16) & (0x93 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_93int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x93,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_93int64_midword_reg>:
test   $0x930000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_93int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 147
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_93int64_midword_reg(i64 %0) {
%2 = and i64 %0, 9633792
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int dcc_count_slashes(const char *path) {
  int i;
  int count = 0;
  for (i = 0; path[i]; i++) {
    if (path[i] == '/')
      count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<dcc_count_slashes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1159 <dcc_count_slashes+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1146 <dcc_count_slashes+0x46>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114b <dcc_count_slashes+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <dcc_count_slashes+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcc_count_slashes>:
xor    %eax,%eax
jmp    1117 <dcc_count_slashes+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x2f,%cl
je     1110 <dcc_count_slashes+0x10>
test   %cl,%cl
jne    1113 <dcc_count_slashes+0x13>
ret

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

LLVM IR (-O2):
define i32 @dcc_count_slashes(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 47, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
ret i32 %4
}
unsigned char ADC_Conversion(unsigned char Ch) {}


x86 assembly (clang, -O0):
<ADC_Conversion>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @ADC_Conversion(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %2
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @ADC_Conversion(i8 zeroext %0) {
ret i8 undef
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_macroname_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_macroname(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_macroname_rec(lexbuf, 1); });
}


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

x86 assembly (clang, -O2):
<Cyc_macroname>:
mov    $0x1,%esi
jmp    1030 <Cyc_macroname_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_macroname(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_macroname_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_macroname(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_macroname_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 1)
ret i32 %2
}
void ble_rsp_gap_connect_direct(
    const struct ble_msg_gap_connect_direct_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_gap_connect_direct_rsp_t = type opaque
define void @ble_rsp_gap_connect_direct(%struct.ble_msg_gap_connect_direct_rsp_t* %0) {
%2 = alloca %struct.ble_msg_gap_connect_direct_rsp_t*
store %struct.ble_msg_gap_connect_direct_rsp_t* %0, %struct.ble_msg_gap_connect_direct_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_gap_connect_direct_rsp_t = type opaque
define void @ble_rsp_gap_connect_direct(%struct.ble_msg_gap_connect_direct_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hello();
int /*<<< orphan*/ test();
int main() {
  test();
  hello();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test@plt>
mov    $0x0,%al
call   1030 <hello@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test()
%2 = call i32 (...) @hello()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 (...) @hello()
ret i32 0
}