xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int main() {
  initscr();
  printw("Hello, nCurses World");
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe93(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xea1(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Hello, nCurses World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 @printw(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @refresh()
%5 = call i32 (...) @getch()
%6 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Hello, nCurses World\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @getch()
%5 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare_strings(const void *name1, const void *name2) {
  const char *name1_ = *(const char **)name1;
  const char *name2_ = *(const char **)name2;
  return strcmp(name1_, name2_);
}


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

x86 assembly (clang, -O2):
<compare_strings>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare_strings(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_strings(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int make_async(int s) {
  int n;
  if ((n = fcntl(s, F_GETFL)) < 0 || fcntl(s, F_SETFL, n | O_NONBLOCK) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<make_async>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1162 <make_async+0x52>
mov    -0x8(%rbp),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2e98(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
cmp    $0x0,%eax
jge    116e <make_async+0x5e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <make_async+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_async>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1149 <make_async+0x39>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb1(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fcntl@plt>
sar    $0x1f,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @make_async(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 (i32, i32, ...) @fcntl(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %1
%10 = load i32, i32* %3
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %4
%13 = load i32, i32* @O_NONBLOCK
%14 = or i32 %12, %13
%15 = call i32 (i32, i32, ...) @fcntl(i32 %10, i32 %11, i32 %14)
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %9, %1
store i32 -1, i32* %2
br label %19
18: ; preds = %9
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @make_async(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %8)
%10 = ashr i32 %9, 31
br label %11
11: ; preds = %5, %1
%12 = phi i32 [ -1, %1 ], [ %10, %5 ]
ret i32 %12
}
void SetHiPri(void) {}


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

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

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

LLVM IR (-O2):
define void @SetHiPri() {
ret void
}
void update_busy(struct au_wkq *wkq, struct au_wkinfo *wkinfo) {}


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

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

LLVM IR (-O0):
%struct.au_wkq = type opaque
%struct.au_wkinfo = type opaque
define void @update_busy(%struct.au_wkq* %0, %struct.au_wkinfo* %1) {
%3 = alloca %struct.au_wkq*
%4 = alloca %struct.au_wkinfo*
store %struct.au_wkq* %0, %struct.au_wkq** %3
store %struct.au_wkinfo* %1, %struct.au_wkinfo** %4
ret void
}

LLVM IR (-O2):
%struct.au_wkq = type opaque
%struct.au_wkinfo = type opaque
define void @update_busy(%struct.au_wkq* nocapture %0, %struct.au_wkinfo* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_ws(char *ptr) {
  while (isspace(*ptr)) {
    ptr++;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<skip_ws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skip_ws+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_ws+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_ws>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_ws+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_ws(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ msgaddstr(char *);
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
int msgvprintw(const char *fmt, va_list ap) {
  char outtext[1024];
  int r = vsnprintf(outtext, 1024, fmt, ap);
  msgaddstr(outtext);
  return r;
}


x86 assembly (clang, -O0):
<msgvprintw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    %eax,-0x414(%rbp)
lea    -0x410(%rbp),%rdi
call   1040 <msgaddstr@plt>
mov    -0x414(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgvprintw>:
push   %rbp
push   %rbx
sub    $0x408,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <msgaddstr@plt>
mov    %ebp,%eax
add    $0x408,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @msgvprintw(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1024 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @vsnprintf(i8* %7, i32 1024, i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%12 = call i32 @msgaddstr(i8* %11)
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @msgvprintw(i8* nocapture %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @vsnprintf(i8* %4, i32 1024, i8* %0, i32 %1)
%6 = call i32 @msgaddstr(i8* %4)
ret i32 %5
}
void XSetIconSizes() {}


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

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

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

LLVM IR (-O2):
define void @XSetIconSizes() {
ret void
}
/* Variables and functions */
int cmpxchg(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ futex(int *, int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *, int /*<<< orphan*/);
scalar_t__ xchg(int *, int);
void flock(int *val) {
  int n;
  if ((n = cmpxchg(val, 0, 1)) == 0)
    return;
  while (xchg(val, 2) != 0)
    futex(val, 0, 2, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<flock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <cmpxchg@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    115d <flock+0x2d>
jmp    119b <flock+0x6b>
jmp    1162 <flock+0x32>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <xchg@plt>
cmp    $0x0,%rax
je     119b <flock+0x6b>
mov    -0x8(%rbp),%rdi
xor    %r9d,%r9d
mov    $0x2,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r9d,%esi
mov    %r8,%rcx
call   1050 <futex@plt>
jmp    1162 <flock+0x32>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flock>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <cmpxchg@plt>
test   %eax,%eax
je     117b <flock+0x4b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <xchg@plt>
test   %rax,%rax
je     117b <flock+0x4b>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1050 <futex@plt>
jmp    1150 <flock+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @flock(i32* %0) {
%2 = tail call i32 @cmpxchg(i32* %0, i32 0, i32 1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i64 @xchg(i32* %0, i32 2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4, %7
%8 = tail call i32 @futex(i32* %0, i32 0, i32 2, i32* null, i32* null, i32 0)
%9 = tail call i64 @xchg(i32* %0, i32 2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7, %4, %1
ret void
}
int dlna_get_audio_profile_mpeg4(int channels, int bitrate, char *profile,
                                 char *mimeType) {
  return -1;
}


x86 assembly (clang, -O0):
<dlna_get_audio_profile_mpeg4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dlna_get_audio_profile_mpeg4(i32 %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 -1
}
int execute_flistxattr() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_flistxattr() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ ucdn_mirror(scalar_t__);
int ucdn_get_mirrored(uint32_t code) { return ucdn_mirror(code) != code; }


x86 assembly (clang, -O0):
<ucdn_get_mirrored>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ucdn_mirror@plt>
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucdn_get_mirrored>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ucdn_mirror@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ucdn_get_mirrored(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @ucdn_mirror(i64 %3)
%5 = load i64, i64* %2
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ucdn_get_mirrored(i64 %0) {
%2 = tail call i64 @ucdn_mirror(i64 %0)
%3 = icmp ne i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ setleu32(int *, int, int);
void gen(uint8_t *b, uint32_t *buflen, uint8_t pkglen, uint32_t pgn,
         uint8_t prio, uint8_t src, uint8_t dest) {
  b[0] = 0x02 | (0 << 5);
  b[1] = (uint8_t)pkglen;
  setleu32(b, 2, pgn);
  setleu32(b, 6, 12);
}


x86 assembly (clang, -O0):
<gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    $0x2,%esi
call   1030 <setleu32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
mov    $0xc,%edx
call   1030 <setleu32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen>:
push   %rbx
mov    %rdi,%rbx
movl   $0x2,(%rdi)
mov    %edx,0x4(%rdi)
mov    $0x2,%esi
mov    %ecx,%edx
call   1030 <setleu32@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0xc,%edx
pop    %rbx
jmp    1030 <setleu32@plt>

LLVM IR (-O0):
define void @gen(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32*, i32** %8
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 2, i32* %16
%17 = load i32, i32* %10
%18 = load i32*, i32** %8
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 %17, i32* %19
%20 = load i32*, i32** %8
%21 = load i32, i32* %11
%22 = call i32 @setleu32(i32* %20, i32 2, i32 %21)
%23 = load i32*, i32** %8
%24 = call i32 @setleu32(i32* %23, i32 6, i32 12)
ret void
}

LLVM IR (-O2):
define void @gen(i32* %0, i32* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
store i32 2, i32* %0
%8 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %2, i32* %8
%9 = tail call i32 @setleu32(i32* %0, i32 2, i32 %3)
%10 = tail call i32 @setleu32(i32* %0, i32 6, i32 12)
ret void
}
/* Type definitions */
struct d3_album {
  int dummy;
};

/* Variables and functions */
struct d3_album *mls(int, int);
struct d3_album *album(int i, int p) {
  return mls(i, p);
}


x86 assembly (clang, -O0):
<album>:
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 <mls@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<album>:
jmp    1030 <mls@plt>

LLVM IR (-O0):
%struct.d3_album = type { i32 }
define %struct.d3_album* @album(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 %struct.d3_album* @mls(i32 %5, i32 %6)
ret %struct.d3_album* %7
}

LLVM IR (-O2):
%struct.d3_album = type { i32 }
define %struct.d3_album* @album(i32 %0, i32 %1) {
%3 = tail call %struct.d3_album* @mls(i32 %0, i32 %1)
ret %struct.d3_album* %3
}
int test_imm_33int8_mem(signed char *val) {
  return ((*val) & (-0x33 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_33int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffcd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_33int8_mem>:
testb  $0xcd,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_33int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -51
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int agc2cpu(int Input) {
  if (0 != (040000 & Input))
    return (-(037777 & ~Input));
  else
    return (037777 & Input);
}


x86 assembly (clang, -O0):
<agc2cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x4000,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1132 <agc2cpu+0x32>
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    $0x3fff,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <agc2cpu+0x3d>
mov    -0x8(%rbp),%eax
and    $0x3fff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<agc2cpu>:
mov    %edi,%ecx
or     $0xffffc000,%ecx
add    $0x1,%ecx
mov    %edi,%eax
and    $0x3fff,%eax
test   $0x4000,%edi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @agc2cpu(i32 %0) {
%2 = and i32 %0, 16384
%3 = icmp eq i32 %2, 0
%4 = or i32 %0, -16384
%5 = add nsw i32 %4, 1
%6 = and i32 %0, 16383
%7 = select i1 %3, i32 %6, i32 %5
ret i32 %7
}
/* Variables and functions */
long long strtoll(char const *, char **, int);
long long strtoq(const char *nptr, char **endptr, int base) {
  return strtoll(nptr, endptr, base);
}


x86 assembly (clang, -O0):
<strtoq>:
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
call   1030 <strtoll@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoq>:
jmp    1030 <strtoll@plt>

LLVM IR (-O0):
define i64 @strtoq(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i64 @strtoll(i8* %7, i8** %8, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtoq(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoll(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ bdclose();
void fd_close(void) { bdclose(); }


x86 assembly (clang, -O0):
<fd_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bdclose@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fd_close() {
%1 = call i32 (...) @bdclose()
ret void
}

LLVM IR (-O2):
define void @fd_close() {
%1 = tail call i32 (...) @bdclose()
ret void
}
void ff_hevc_put_hevc_bi_epel_hv24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv24_12_sse4() {
ret void
}
int Check_PWM(int duty) {
  if (duty > 100)
    return 100;
  if (duty < 0)
    return 0;
  return duty;
}


x86 assembly (clang, -O0):
<Check_PWM>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jle    111d <Check_PWM+0x1d>
movl   $0x64,-0x4(%rbp)
jmp    1139 <Check_PWM+0x39>
cmpl   $0x0,-0x8(%rbp)
jge    1133 <Check_PWM+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1139 <Check_PWM+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Check_PWM>:
xor    %ecx,%ecx
test   %edi,%edi
cmovns %edi,%ecx
cmp    $0x64,%ecx
mov    $0x64,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Check_PWM(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
%4 = icmp ult i32 %3, 100
%5 = select i1 %4, i32 %3, i32 100
ret i32 %5
}
/* Type definitions */
struct MIDITypeSpec {
  int dummy;
};
struct MIDIPort {
  int dummy;
};

/* Variables and functions */
int MIDIPortReceiveFrom(struct MIDIPort *, int /*<<< orphan*/ *,
                        struct MIDITypeSpec *, void *);
int MIDIPortReceive(struct MIDIPort *port, struct MIDITypeSpec *type,
                    void *object) {
  return MIDIPortReceiveFrom(port, NULL, type, object);
}


x86 assembly (clang, -O0):
<MIDIPortReceive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <MIDIPortReceiveFrom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIDIPortReceive>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <MIDIPortReceiveFrom@plt>

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

LLVM IR (-O2):
%struct.MIDIPort = type { i32 }
%struct.MIDITypeSpec = type { i32 }
define i32 @MIDIPortReceive(%struct.MIDIPort* %0, %struct.MIDITypeSpec* %1, i8* %2) {
%4 = tail call i32 @MIDIPortReceiveFrom(%struct.MIDIPort* %0, i32* null, %struct.MIDITypeSpec* %1, i8* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t read_uint32(char *bgof_value) {
  uint32_t result = 0;
  memcpy(&result, bgof_value, sizeof(result));
  return ntohl(result);
}


x86 assembly (clang, -O0):
<read_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint32>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <ntohl@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @read_uint32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @ntohl(i32 %5)
ret i32 %6
}
/* Variables and functions */
scalar_t__ isalpha(int const);
scalar_t__ isdigit(int const);
int isalnum(const int c) { return isalpha(c) || isdigit(c); }


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isalnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct sysfs_class {
  int dummy;
};

/* Variables and functions */
struct sysfs_class *sysfs_open_class(const char *name) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.sysfs_class = type { i32 }
define %struct.sysfs_class* @sysfs_open_class(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.sysfs_class* null
}

LLVM IR (-O2):
%struct.sysfs_class = type { i32 }
define noalias %struct.sysfs_class* @sysfs_open_class(i8* nocapture readnone %0) {
ret %struct.sysfs_class* null
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __mmfree(void *x, void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<__mmfree>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__mmfree(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void __wrpkru(unsigned int pkru) {
  unsigned int eax = pkru;
  unsigned int ecx = 0;
  unsigned int edx = 0;
  do {
    if (4 <= 0)
      sigsafe_printf("%s() changing %08x to %08x\n", __func__, __rdpkru(),
                     pkru);
  } while (0);
  asm volatile(".byte 0x0f,0x01,0xef\n\t" : : "a"(eax), "c"(ecx), "d"(edx));
  assert(pkru == __rdpkru());
}


x86 assembly (clang, -O0):
<__wrpkru>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    1144 <__wrpkru+0x24>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
wrpkru
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <__rdpkru@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrpkru>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
xor    %ecx,%ecx
xor    %edx,%edx
wrpkru
xor    %eax,%eax
call   1030 <__rdpkru@plt>
xor    %edi,%edi
cmp    %ebx,%eax
sete   %dil
xor    %eax,%eax
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @__wrpkru(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %1
br label %8
8: ; preds = %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %2
%13 = call i32 (...) @__rdpkru()
%14 = icmp eq i32 %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %15)
ret void
}

LLVM IR (-O2):
define void @__wrpkru(i32 %0) {
tail call void asm sideeffect ".byte 0x0f,0x01,0xef\0A\09", "{ax},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 0, i32 0)
%2 = tail call i32 (...) @__rdpkru()
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %4)
ret void
}
void gtk_list_store_set_value() {}


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

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

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

LLVM IR (-O2):
define void @gtk_list_store_set_value() {
ret void
}
int do_xfrm(int argc, char **argv) { return 0; }


x86 assembly (clang, -O0):
<do_xfrm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @do_xfrm(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void RTPathSetOwner(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathSetOwner() {
ret void
}
int test_imm_75int16_reg(short val) {
  return ((val) & (0x75 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_75int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x75,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_75int16_reg>:
test   $0x75,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_75int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 117
%6 = icmp ne i32 %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_75int16_reg(i16 signext %0) {
%2 = and i16 %0, 117
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ iconv_t;

/* Variables and functions */
int /*<<< orphan*/ iconv_close(scalar_t__);
scalar_t__ iconv_open(char *, char *);
int iconv_check_one(char *from, char *to) {
  iconv_t id;
  id = iconv_open(from, to);
  if (id == (iconv_t)(-1))
    return 1;
  iconv_close(id);
  return 0;
}


x86 assembly (clang, -O0):
<iconv_check_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <iconv_open@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0xffffffffffffffff,-0x20(%rbp)
jne    1158 <iconv_check_one+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1168 <iconv_check_one+0x48>
mov    -0x20(%rbp),%rdi
call   1030 <iconv_close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iconv_check_one>:
push   %rax
call   1040 <iconv_open@plt>
cmp    $0xffffffffffffffff,%rax
je     1138 <iconv_check_one+0x18>
mov    %rax,%rdi
call   1030 <iconv_close@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @iconv_check_one(i8* %0, i8* %1) {
%3 = tail call i64 @iconv_open(i8* %0, i8* %1)
%4 = icmp eq i64 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @iconv_close(i64 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help02(void) {
  printf("  a                 assemble starting at PC\n");
  printf("  a  <addr>         assemble starting at <addr>\n");
}


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

x86 assembly (clang, -O2):
<help02>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [45 x i8] c" a assemble starting at PC\0A\00"
@.str.1 = [49 x i8] c" a <addr> assemble starting at <addr>\0A\00"
define void @help02() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c" a assemble starting at PC\00"
@str.2 = [48 x i8] c" a <addr> assemble starting at <addr>\00"
define void @help02() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct cfs_binheap_node {
  int dummy;
};
struct cfs_binheap {
  int dummy;
};

/* Variables and functions */
struct cfs_binheap_node *cfs_binheap_find(struct cfs_binheap *,
                                          int /*<<< orphan*/);
struct cfs_binheap_node *cfs_binheap_root(struct cfs_binheap *h) {
  return cfs_binheap_find(h, 0);
}


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

x86 assembly (clang, -O2):
<cfs_binheap_root>:
xor    %esi,%esi
jmp    1030 <cfs_binheap_find@plt>

LLVM IR (-O0):
%struct.cfs_binheap_node = type { i32 }
%struct.cfs_binheap = type { i32 }
define %struct.cfs_binheap_node* @cfs_binheap_root(%struct.cfs_binheap* %0) {
%2 = alloca %struct.cfs_binheap*
store %struct.cfs_binheap* %0, %struct.cfs_binheap** %2
%3 = load %struct.cfs_binheap*, %struct.cfs_binheap** %2
%4 = call %struct.cfs_binheap_node* @cfs_binheap_find(%struct.cfs_binheap* %3, i32 0)
ret %struct.cfs_binheap_node* %4
}

LLVM IR (-O2):
%struct.cfs_binheap_node = type { i32 }
%struct.cfs_binheap = type { i32 }
define %struct.cfs_binheap_node* @cfs_binheap_root(%struct.cfs_binheap* %0) {
%2 = tail call %struct.cfs_binheap_node* @cfs_binheap_find(%struct.cfs_binheap* %0, i32 0)
ret %struct.cfs_binheap_node* %2
}
/* Type definitions */
struct Shape {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ draw(struct Shape *);
int f1(struct Shape *pp) { draw(pp); }


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

x86 assembly (clang, -O2):
<f1>:
jmp    1030 <draw@plt>

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

LLVM IR (-O2):
%struct.Shape = type { i32 }
define i32 @f1(%struct.Shape* %0) {
%2 = tail call i32 @draw(%struct.Shape* %0)
ret i32 undef
}
/* Variables and functions */
int updateColour(char *, char *);
int updateDlColour(char *value) { return updateColour(value, "web.colour_dl"); }


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

x86 assembly (clang, -O2):
<updateDlColour>:
lea    0xee9(%rip),%rsi
jmp    1030 <updateColour@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"web.colour_dl\00"
define i32 @updateDlColour(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @updateColour(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [14 x i8] c"web.colour_dl\00"
define i32 @updateDlColour(i8* %0) {
%2 = tail call i32 @updateColour(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
main() {
  char a[2];
  char b = 65;
  a[0] = b;
  a[1] = b++;
  a[2] = '\0';
  puts(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x41,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x3(%rbp),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,-0x3(%rbp)
mov    %al,-0x1(%rbp)
movb   $0x0,0x0(%rbp)
lea    -0x2(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x4141,0x6(%rsp)
movb   $0x0,0x8(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [2 x i8]
%2 = alloca i8
store i8 65, i8* %2
%3 = load i8, i8* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 %3, i8* %4
%5 = load i8, i8* %2
%6 = add i8 %5, 1
store i8 %6, i8* %2
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 %5, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 2
store i8 0, i8* %8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 65, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 65, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 2
store i8 0, i8* %4
%5 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ asm_func();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void main() { printf("%ld\n", asm_func()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <asm_func@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <asm_func@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define void @main() {
%1 = call i32 (...) @asm_func()
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define void @main() {
%1 = tail call i32 (...) @asm_func()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int get_st1_prop();
int get_st2_prop();
int get_st3_value(void) { return get_st1_prop() + get_st2_prop(); }


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

x86 assembly (clang, -O2):
<get_st3_value>:
push   %rbx
xor    %eax,%eax
call   1030 <get_st1_prop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <get_st2_prop@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_st3_value() {
%1 = call i32 (...) @get_st1_prop()
%2 = call i32 (...) @get_st2_prop()
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_st3_value() {
%1 = tail call i32 (...) @get_st1_prop()
%2 = tail call i32 (...) @get_st2_prop()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int contact(int);
int formula(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int logicAddress;
  scanf("%d", &logicAddress);
  printf("[Formula] Physical Address: %X\n", formula(logicAddress));
  printf("[Contact] Physical Address: %X", contact(logicAddress));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1060 <formula@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <contact@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <formula@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <contact@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [32 x i8] c"[Formula] Physical Address: %X\0A\00"
@.str.2 = [31 x i8] c"[Contact] Physical Address: %X\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = call i32 @formula(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @contact(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [32 x i8] c"[Formula] Physical Address: %X\0A\00"
@.str.2 = [31 x i8] c"[Contact] Physical Address: %X\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @formula(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @contact(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}