xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  fprintf(stderr, "pktout for this platform not built\n");
  return -1;
}


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    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"pktout for this platform not built\0A\00"
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 i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"pktout for this platform not built\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
void tux3_xattrdirty(struct inode *inode) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define void @tux3_xattrdirty(%struct.inode* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return islower(c) ? c - 65 : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x41(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -65
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dispVector();
int /*<<< orphan*/ makeVector();
int /*<<< orphan*/ modVector(int, int);
int /*<<< orphan*/ mulVector(int);
int main() {
  makeVector();
  dispVector();
  modVector(1, 4);
  dispVector();
  mulVector(12);
  dispVector();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <makeVector@plt>
mov    $0x0,%al
call   1040 <dispVector@plt>
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <modVector@plt>
mov    $0x0,%al
call   1040 <dispVector@plt>
mov    $0xc,%edi
call   1050 <mulVector@plt>
mov    $0x0,%al
call   1040 <dispVector@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <makeVector@plt>
xor    %eax,%eax
call   1040 <dispVector@plt>
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <modVector@plt>
xor    %eax,%eax
call   1040 <dispVector@plt>
mov    $0xc,%edi
call   1050 <mulVector@plt>
xor    %eax,%eax
call   1040 <dispVector@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @makeVector()
%3 = call i32 (...) @dispVector()
%4 = call i32 @modVector(i32 1, i32 4)
%5 = call i32 (...) @dispVector()
%6 = call i32 @mulVector(i32 12)
%7 = call i32 (...) @dispVector()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @makeVector()
%2 = tail call i32 (...) @dispVector()
%3 = tail call i32 @modVector(i32 1, i32 4)
%4 = tail call i32 (...) @dispVector()
%5 = tail call i32 @mulVector(i32 12)
%6 = tail call i32 (...) @dispVector()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ suicidef_with_perror(char *, char const *);
void suicide_with_perror(const char *message) {
  if (message == NULL)
    suicidef_with_perror(NULL, NULL);
  else
    suicidef_with_perror("%s", message);
}


x86 assembly (clang, -O0):
<suicide_with_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1138 <suicide_with_perror+0x28>
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <suicidef_with_perror@plt>
jmp    1148 <suicide_with_perror+0x38>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <suicidef_with_perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suicide_with_perror>:
test   %rdi,%rdi
je     1124 <suicide_with_perror+0x14>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <suicidef_with_perror@plt>
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <suicidef_with_perror@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @suicide_with_perror(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @suicidef_with_perror(i8* null, i8* null)
br label %7
5: ; preds = %1
%6 = tail call i32 @suicidef_with_perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progName, int errNo) {
  fprintf(stderr, "usage: %s lnkCmdFile\n", progName);
  if (errNo) {
    exit(errNo);
  }
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0xc(%rbp)
je     115a <usage+0x3a>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
test   %ebx,%ebx
jne    1141 <usage+0x21>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"usage: %s lnkCmdFile\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"usage: %s lnkCmdFile\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @exit(i32 %1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scull_cleanup_module();
int /*<<< orphan*/ scull_init_module();
void loader() {
  scull_init_module();
  scull_cleanup_module();
}


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

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

LLVM IR (-O0):
define void @loader() {
%1 = call i32 (...) @scull_init_module()
%2 = call i32 (...) @scull_cleanup_module()
ret void
}

LLVM IR (-O2):
define void @loader() {
%1 = tail call i32 (...) @scull_init_module()
%2 = tail call i32 (...) @scull_cleanup_module()
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int strlen(char *);
int unrem(char *regel) {
  char *c;
  c = strchr(regel, '#');
  if (c != NULL)
    c[0] = 0;
  return (strlen(regel));
}


x86 assembly (clang, -O0):
<unrem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <unrem+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unrem>:
push   %rbx
mov    %rdi,%rbx
mov    $0x23,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1136 <unrem+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @unrem(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 35)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i32 @strlen(i8* %0)
ret i32 %6
}
/* Variables and functions */
int PAPI_state(int, int *);
void PAPIF_STATE(int *EventSet, int *status, int *check) {
  *check = PAPI_state(*EventSet, status);
}


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

x86 assembly (clang, -O2):
<PAPIF_STATE>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_state@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_STATE(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** %4
%8 = load i32, i32* %7
%9 = load i32*, i32** %5
%10 = call i32 @PAPI_state(i32 %8, i32* %9)
%11 = load i32*, i32** %6
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @PAPIF_STATE(i32* nocapture %0, i32* %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @PAPI_state(i32 %4, i32* %1)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t bytes) {
  void *p = realloc(ptr, bytes);
  if (!p) {
    puts("Failed: "
         "xrealloc");
    exit(-1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <xrealloc+0x42>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Failed: xrealloc\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [17 x i8] c"Failed: xrealloc\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret i8* %3
}
void periodic_10Hz_demo(void) { {}; }


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

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

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

LLVM IR (-O2):
define void @periodic_10Hz_demo() {
ret void
}
/* Variables and functions */
double log(double);
void log_on_vec(double *vec, int length) {
  int i;
  for (i = 0; i < length; i++)
    vec[i] = log(vec[i]);
}


x86 assembly (clang, -O0):
<log_on_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <log_on_vec+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <log@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <log_on_vec+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_on_vec>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <log_on_vec+0x3a>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
call   1030 <log@plt>
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <log_on_vec+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @log_on_vec(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call double @log(double %9)
store double %10, double* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t xlat_addr32(void *base, uint64_t offs) {
  uint64_t out;
  asm(".byte 0x67 \n\t"
      "xlat"
      : "=a"(out)
      : "b"(base), "0"(offs));
  return out;
}


x86 assembly (clang, -O0):
<xlat_addr32>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x18(%rbp),%rax
xlat   %ds:(%ebx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlat_addr32>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
xlat   %ds:(%ebx)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xlat_addr32(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* asm ".byte 0x67 \0A\09xlat", "={ax},{bx},0,~{dirflag},~{fpsr},~{flags}"(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @xlat_addr32(i8* readnone %0, i8* readnone %1) {
%3 = tail call i8* asm ".byte 0x67 \0A\09xlat", "={ax},{bx},0,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
__attribute__((always_, unused)) uint16_t psnip_builtin_bswap16(uint16_t v) {
  return ((v & (((uint16_t)0xff) << 8)) >> 8) | ((v & (((uint16_t)0xff))) << 8);
}


x86 assembly (clang, -O0):
<psnip_builtin_bswap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<psnip_builtin_bswap16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @psnip_builtin_bswap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @psnip_builtin_bswap16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
void foo328() {}


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

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

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

LLVM IR (-O2):
define void @foo328() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void decl_func1(int cmpfn()) { printf("cmpfn=%lx\n", (long)cmpfn); }


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

x86 assembly (clang, -O2):
<decl_func1>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"cmpfn=%lx\0A\00"
define void @decl_func1(i32 (...)* %0) {
%2 = alloca i32 (...)*
store i32 (...)* %0, i32 (...)** %2
%3 = load i32 (...)*, i32 (...)** %2
%4 = ptrtoint i32 (...)* %3 to i64
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %4)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"cmpfn=%lx\0A\00"
define void @decl_func1(i32 (...)* %0) {
%2 = ptrtoint i32 (...)* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
/* Variables and functions */
scalar_t__ wasintr();
long write(int, void *, int);
long iwrite(int f, void *a, int n) {
  long m;
  m = write(f, a, n);
  if (m < 0 && wasintr())
    return n;
  return m;
}


x86 assembly (clang, -O0):
<iwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <write@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jge    116e <iwrite+0x4e>
mov    $0x0,%al
call   1030 <wasintr@plt>
cmp    $0x0,%rax
je     116e <iwrite+0x4e>
movslq -0x1c(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <iwrite+0x56>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iwrite>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
call   1040 <write@plt>
mov    %rax,%rbx
test   %rax,%rax
jns    1143 <iwrite+0x23>
xor    %eax,%eax
call   1030 <wasintr@plt>
test   %rax,%rax
movslq %ebp,%rax
cmovne %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @iwrite(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = tail call i64 (...) @wasintr()
%8 = icmp eq i64 %7, 0
%9 = sext i32 %2 to i64
%10 = select i1 %8, i64 %4, i64 %9
br label %11
11: ; preds = %6, %3
%12 = phi i64 [ %4, %3 ], [ %10, %6 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_arr(int *a, unsigned int s) {
  unsigned int i;
  for (i = 0; i < s; i++) {
    printf(" %i,", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1158 <print_arr+0x48>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_arr+0x16>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c" %i,\00"
define void @print_arr(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void calc_diff_kernel(diff_kernel) float diff_kernel[5];
{
  diff_kernel[0] = -1.0 / 12.0;
  diff_kernel[1] = 8.0 / 12.0;
  diff_kernel[2] = 0.0;
  diff_kernel[3] = -8.0 / 12.0;
  diff_kernel[4] = 1.0 / 12.0;
}


x86 assembly (clang, -O0):
<calc_diff_kernel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xef8(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0xee4(%rip),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0xec3(%rip),%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
movss  0xeae(%rip),%xmm0
movss  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_diff_kernel>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movl   $0x3daaaaab,0x10(%rdi)
ret

LLVM IR (-O0):
define void @calc_diff_kernel(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0xBFB5555560000000, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0x3FE5555560000000, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 0xBFE5555560000000, float* %10
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 4
store float 0x3FB5555560000000, float* %12
ret void
}

LLVM IR (-O2):
define void @calc_diff_kernel(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to <4 x float>*
store <4 x float> <float 0xBFB5555560000000, float 0x3FE5555560000000, float 0.000000e+00, float 0xBFE5555560000000>, <4 x float>* %2
%3 = getelementptr inbounds float, float* %0, i64 4
store float 0x3FB5555560000000, float* %3
ret void
}
void CFGMR3InsertInteger(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3InsertInteger() {
ret void
}
void radish_wait_message(void *state) {}


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

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

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

LLVM IR (-O2):
define void @radish_wait_message(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ this_comparison_is_true();
void bla1gt(int var) {
  if (var + 10 > INT_MIN + 9)
    this_comparison_is_true();
}


x86 assembly (clang, -O0):
<bla1gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
add    $0x9,%ecx
cmp    %ecx,%eax
jle    113c <bla1gt+0x2c>
mov    $0x0,%al
call   1030 <this_comparison_is_true@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla1gt>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jle    111c <bla1gt+0xc>
ret
xor    %eax,%eax
jmp    1030 <this_comparison_is_true@plt>

LLVM IR (-O0):
@INT_MIN = global i32 0
define void @bla1gt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 10
%5 = load i32, i32* @INT_MIN
%6 = add nsw i32 %5, 9
%7 = icmp sgt i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @this_comparison_is_true()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define void @bla1gt(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = icmp sgt i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @this_comparison_is_true()
br label %6
6: ; preds = %4, %1
ret void
}
void add_wait_queue_exclusive(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<add_wait_queue_exclusive>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_wait_queue_exclusive>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.add_wait_queue_exclusive = [25 x i8] c"add_wait_queue_exclusive\00"
define void @add_wait_queue_exclusive() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.add_wait_queue_exclusive, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.add_wait_queue_exclusive = [25 x i8] c"add_wait_queue_exclusive\00"
define void @add_wait_queue_exclusive() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.add_wait_queue_exclusive, i64 0, i64 0))
ret void
}
void __noop(void) { (void)0; }


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

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

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

LLVM IR (-O2):
define void @__noop() {
ret void
}
unsigned int f26(unsigned int x, long int y) {
  return (x >> (8 * sizeof(unsigned int) - y)) ^ (x << y);
}


x86 assembly (clang, -O0):
<f26>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f26>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f26(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub i64 32, %6
%8 = trunc i64 %7 to i32
%9 = lshr i32 %5, %8
%10 = load i32, i32* %3
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = shl i32 %10, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f26(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 32, %3
%5 = lshr i32 %0, %4
%6 = shl i32 %0, %3
%7 = xor i32 %5, %6
ret i32 %7
}
/* Type definitions */
struct ivals_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assemble_write_mmio(struct ivals_context *, int, int,
                                       unsigned int);
void assemble_write_tram(struct ivals_context *ctx, unsigned int offset,
                         unsigned int value) {
  assemble_write_mmio(ctx, 0x130, 4, offset);
  assemble_write_mmio(ctx, 0x134, 4, value);
}


x86 assembly (clang, -O0):
<assemble_write_tram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x130,%esi
mov    $0x4,%edx
call   1030 <assemble_write_mmio@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
mov    $0x134,%esi
mov    $0x4,%edx
call   1030 <assemble_write_mmio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble_write_tram>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%ecx
mov    %rdi,%rbx
mov    $0x130,%esi
mov    $0x4,%edx
call   1030 <assemble_write_mmio@plt>
mov    %rbx,%rdi
mov    $0x134,%esi
mov    $0x4,%edx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <assemble_write_mmio@plt>

LLVM IR (-O0):
%struct.ivals_context = type { i32 }
define void @assemble_write_tram(%struct.ivals_context* %0, i32 %1, i32 %2) {
%4 = alloca %struct.ivals_context*
%5 = alloca i32
%6 = alloca i32
store %struct.ivals_context* %0, %struct.ivals_context** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.ivals_context*, %struct.ivals_context** %4
%8 = load i32, i32* %5
%9 = call i32 @assemble_write_mmio(%struct.ivals_context* %7, i32 304, i32 4, i32 %8)
%10 = load %struct.ivals_context*, %struct.ivals_context** %4
%11 = load i32, i32* %6
%12 = call i32 @assemble_write_mmio(%struct.ivals_context* %10, i32 308, i32 4, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.ivals_context = type { i32 }
define void @assemble_write_tram(%struct.ivals_context* %0, i32 %1, i32 %2) {
%4 = tail call i32 @assemble_write_mmio(%struct.ivals_context* %0, i32 304, i32 4, i32 %1)
%5 = tail call i32 @assemble_write_mmio(%struct.ivals_context* %0, i32 308, i32 4, i32 %2)
ret void
}
void foo() { printf("%s()\n", __PRETTY_FUNCTION__); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s()\0A\00"
@__PRETTY_FUNCTION__.foo = [11 x i8] c"void foo()\00"
define void @foo() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__PRETTY_FUNCTION__.foo, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s()\0A\00"
@__PRETTY_FUNCTION__.foo = [11 x i8] c"void foo()\00"
define void @foo() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__PRETTY_FUNCTION__.foo, i64 0, i64 0))
ret void
}
void outl(unsigned int v, unsigned short p) {
  asm volatile("outl %1,%0" ::"d"(p), "a"(v));
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%dx
mov    -0x4(%rbp),%eax
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outl(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @outl(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $1,$0", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void xlatb() { db(0xD7); }


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

x86 assembly (clang, -O2):
<xlatb>:
mov    $0xd7,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @xlatb() {
%1 = call i32 @db(i32 215)
ret void
}

LLVM IR (-O2):
define void @xlatb() {
%1 = tail call i32 @db(i32 215)
ret void
}
double g2(double x, double y) { return x + y; }


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @g2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @g2(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
f(short *p) {
  short x = *p;
  return (--x < 0);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0xa(%rbp)
cwtl
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movzwl (%rdi),%eax
add    $0xffffffff,%eax
movzwl %ax,%eax
shr    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @f(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = load i16, i16* %4
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = add i16 %6, -1
store i16 %7, i16* %3
%8 = sext i16 %7 to i32
%9 = icmp slt i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = add i16 %2, -1
%4 = lshr i16 %3, 15
%5 = zext i16 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void ps_rotate(FILE *ps, int bPlus) {
  if (bPlus)
    fprintf(ps, "612.5 0 translate 90 rotate\n");
  else
    fprintf(ps, "-90 rotate -612.5 0 translate\n");
}


x86 assembly (clang, -O0):
<ps_rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113e <ps_rotate+0x2e>
mov    -0x8(%rbp),%rdi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
jmp    114e <ps_rotate+0x3e>
mov    -0x8(%rbp),%rdi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_rotate>:
mov    %rdi,%rcx
test   %esi,%esi
je     112d <ps_rotate+0x1d>
lea    0xee2(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>
lea    0xee9(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"612.5 0 translate 90 rotate\0A\00"
@.str.1 = [31 x i8] c"-90 rotate -612.5 0 translate\0A\00"
define void @ps_rotate(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %13
10: ; preds = %2
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"612.5 0 translate 90 rotate\0A\00"
@.str.1 = [31 x i8] c"-90 rotate -612.5 0 translate\0A\00"
define void @ps_rotate(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 28, i64 1, i32* %0)
br label %8
6: ; preds = %2
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i64 30, i64 1, i32* %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int __simc(int, int, int, int);
int simc_poll(int fd) {
  long timeval[2] = {0, 0};
  return __simc(29, fd, 1, (int)&timeval);
}


x86 assembly (clang, -O0):
<simc_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%esi
lea    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    $0x1d,%edi
mov    $0x1,%edx
call   1030 <__simc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simc_poll>:
sub    $0x18,%rsp
mov    %edi,%esi
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rcx
mov    $0x1d,%edi
mov    $0x1,%edx
call   1030 <__simc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @simc_poll(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i64]
store i32 %0, i32* %2
%4 = bitcast [2 x i64]* %3 to i8*
%5 = load i32, i32* %2
%6 = ptrtoint [2 x i64]* %3 to i32
%7 = call i32 @__simc(i32 29, i32 %5, i32 1, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @simc_poll(i32 %0) {
%2 = alloca [2 x i64]
%3 = bitcast [2 x i64]* %2 to i8*
%4 = ptrtoint [2 x i64]* %2 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @__simc(i32 29, i32 %0, i32 1, i32 %5)
ret i32 %6
}
int fun520() { return 520; }


x86 assembly (clang, -O0):
<fun520>:
push   %rbp
mov    %rsp,%rbp
mov    $0x208,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun520() {
ret i32 520
}

LLVM IR (-O2):
define i32 @fun520() {
ret i32 520
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ test_clear_page_dirty(struct page *);
void clear_page_dirty(struct page *page) { test_clear_page_dirty(page); }


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

x86 assembly (clang, -O2):
<clear_page_dirty>:
jmp    1030 <test_clear_page_dirty@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @clear_page_dirty(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = load %struct.page*, %struct.page** %2
%4 = call i32 @test_clear_page_dirty(%struct.page* %3)
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @clear_page_dirty(%struct.page* %0) {
%2 = tail call i32 @test_clear_page_dirty(%struct.page* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void setLessOrEqual() {
  emitln("setle\t%%al");
  emitln("neg\t%%al\t#change 1 to -1");
  emitln("movsx\t%%al,%%eax\t#extend al to eax");
}


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

x86 assembly (clang, -O2):
<setLessOrEqual>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <emitln@plt>
lea    0xee7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xef4(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"setle\09%%al\00"
@.str.1 = [25 x i8] c"neg\09%%al\09#change 1 to -1\00"
@.str.2 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @setLessOrEqual() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitln(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"setle\09%%al\00"
@.str.1 = [25 x i8] c"neg\09%%al\09#change 1 to -1\00"
@.str.2 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @setLessOrEqual() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *freopen(char const *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ *stdout;
FILE *redirect(const char *outfile) {
  if (outfile) {
    if (freopen(outfile, "w", stdout) == NULL) {
      perror("comparator");
      exit(1);
    }
  }
  return (stdout);
}


x86 assembly (clang, -O0):
<redirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1186 <redirect+0x56>
mov    -0x8(%rbp),%rdi
mov    0x2e8e(%rip),%rax
mov    (%rax),%rdx
lea    0xea4(%rip),%rsi
call   1030 <freopen@plt>
cmp    $0x0,%rax
jne    1181 <redirect+0x51>
lea    0xe90(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1186 <redirect+0x56>
mov    0x2e53(%rip),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redirect>:
push   %rax
test   %rdi,%rdi
je     1151 <redirect+0x21>
mov    0x2ea3(%rip),%rax
mov    (%rax),%rdx
lea    0xeb9(%rip),%rsi
call   1030 <freopen@plt>
test   %rax,%rax
je     115d <redirect+0x2d>
mov    0x2e88(%rip),%rax
mov    (%rax),%rax
pop    %rcx
ret
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@stdout = global i32* null
@.str.1 = [11 x i8] c"comparator\00"
define i32* @redirect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i32*, i32** @stdout
%8 = call i32* @freopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %5
br label %14
14: ; preds = %13, %1
%15 = load i32*, i32** @stdout
ret i32* %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@stdout = global i32* null
@.str.1 = [11 x i8] c"comparator\00"
define i32* @redirect(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i32*, i32** @stdout
%5 = tail call i32* @freopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3, %1
%11 = load i32*, i32** @stdout
ret i32* %11
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_sub_flt(float *, float, float);
float xil_fpo_sub_flt(float a, float b) {
  float res_flt;
  xip_fpo_sub_flt(&res_flt, a, b);
  return res_flt;
}


x86 assembly (clang, -O0):
<xil_fpo_sub_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    -0xc(%rbp),%rdi
call   1030 <xip_fpo_sub_flt@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_sub_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_sub_flt@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @xil_fpo_sub_flt(float %0, float %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call i32 @xip_fpo_sub_flt(float* %3, float %0, float %1)
%6 = load float, float* %3
ret float %6
}