xunge/DecIR huggingface dataset:
unsigned long b2m(unsigned long blk) { return blk * 0x200; }


x86 assembly (clang, -O0):
<b2m>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x9,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b2m>:
mov    %rdi,%rax
shl    $0x9,%rax
ret

LLVM IR (-O0):
define i64 @b2m(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 512
ret i64 %4
}

LLVM IR (-O2):
define i64 @b2m(i64 %0) {
%2 = shl i64 %0, 9
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_set1_pd(double);
__m128d test_mm_set1_pd(double A) { return _mm_set1_pd(A); }


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

x86 assembly (clang, -O2):
<test_mm_set1_pd>:
jmp    1030 <_mm_set1_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_set1_pd(double %0) {
%2 = tail call i32 @_mm_set1_pd(double %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int parse_args(int, char **, int /*<<< orphan*/ *, int /*<<< orphan*/ **);
int /*<<< orphan*/ read_ts(int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  uint16_t pid;
  FILE *tsfile;
  int rv = parse_args(argc, argv, &pid, &tsfile);
  if (rv != 0) {
    return rv;
  }
  read_ts(tsfile, pid);
  fclose(tsfile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <parse_args@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1172 <main+0x42>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118e <main+0x5e>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <read_ts@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1050 <parse_args@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1162 <main+0x32>
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%esi
call   1030 <read_ts@plt>
mov    0x8(%rsp),%rdi
call   1040 <fclose@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32** %4 to i8*
%7 = call i32 @parse_args(i32 %0, i8** %1, i32* %3, i32** %4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = load i32, i32* %3
%12 = call i32 @read_ts(i32* %10, i32 %11)
%13 = load i32*, i32** %4
%14 = call i32 @fclose(i32* %13)
br label %15
15: ; preds = %2, %9
ret i32 %7
}
int main() {
  int x;
  x = 1;
  x = x & 3;
  return x - 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int h(int x) { return x; }


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

x86 assembly (clang, -O2):
<h>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @h(i32 returned %0) {
ret i32 %0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int fd;
};
struct epoll_event {
  int events;
  TYPE_1__ data;
};

/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_MOD;
int /*<<< orphan*/ epoll_ctl(int, int /*<<< orphan*/, int,
                             struct epoll_event *);
void modify_event(int epollfd, int fd, int state) {
  struct epoll_event ev;
  ev.events = state;
  ev.data.fd = fd;
  epoll_ctl(epollfd, EPOLL_CTL_MOD, fd, &ev);
}


x86 assembly (clang, -O0):
<modify_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
lea    -0x18(%rbp),%rcx
call   1030 <epoll_ctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modify_event>:
push   %rax
mov    %esi,%eax
mov    %edx,(%rsp)
mov    %esi,0x4(%rsp)
mov    0x2ebf(%rip),%rcx
mov    (%rcx),%esi
mov    %rsp,%rcx
mov    %eax,%edx
call   1030 <epoll_ctl@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.epoll_event = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@EPOLL_CTL_MOD = global i32 0
define void @modify_event(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.epoll_event
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %5
%11 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %7, i32 0, i32 1
%12 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %11, i32 0, i32 0
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = load i32, i32* @EPOLL_CTL_MOD
%15 = load i32, i32* %5
%16 = call i32 @epoll_ctl(i32 %13, i32 %14, i32 %15, %struct.epoll_event* %7)
ret void
}

LLVM IR (-O2):
%struct.epoll_event = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@EPOLL_CTL_MOD = global i32 0
define void @modify_event(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.epoll_event
%5 = bitcast %struct.epoll_event* %4 to i8*
%6 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %4, i64 0, i32 0
store i32 %2, i32* %6
%7 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %4, i64 0, i32 1, i32 0
store i32 %1, i32* %7
%8 = load i32, i32* @EPOLL_CTL_MOD
%9 = call i32 @epoll_ctl(i32 %0, i32 %8, i32 %1, %struct.epoll_event* %4)
ret void
}
/* Variables and functions */
scalar_t__ gethostname(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char name[64];
  if (gethostname(name, 64) < 0) {
    perror("gethostname");
  }
  printf("%s\n", name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x40,%esi
call   1050 <gethostname@plt>
cmp    $0x0,%rax
jge    1163 <main+0x33>
lea    0xea2(%rip),%rdi
call   1040 <perror@plt>
lea    -0x50(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    %rsp,%rdi
mov    $0x40,%esi
call   1050 <gethostname@plt>
test   %rax,%rax
js     115c <main+0x2c>
lea    0xebf(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
jmp    1146 <main+0x16>

LLVM IR (-O0):
@.str = [12 x i8] c"gethostname\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i64 @gethostname(i8* %3, i32 64)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"gethostname\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i64 @gethostname(i8* %2, i32 64)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void check_errno(const char *where) {
  if (errno) {
    perror(where);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
cmpq   $0x0,(%rax)
je     1150 <check_errno+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_errno>:
push   %rax
mov    0x2eb8(%rip),%rax
cmpq   $0x0,(%rax)
jne    1130 <check_errno+0x10>
pop    %rax
ret
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
define void @check_errno(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@errno = global i64 0
define void @check_errno(i8* nocapture %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
char *d_s(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, ...);
int slength(char *);
int main() {
  char *s;
  printf("Enter a string: ");
  s = d_s(s);
  printf("String length = [%d]\n", slength(s));
  free(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <d_s@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <slength@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
call   1050 <d_s@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <slength@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a string: \00"
@.str.1 = [22 x i8] c"String length = [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i8* @d_s(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @slength(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a string: \00"
@.str.1 = [22 x i8] c"String length = [%d]\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @d_s(i8* undef)
%3 = tail call i32 @slength(i8* %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
char *get_os();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("OS: %s\n", get_os());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_os@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"OS: %s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* (...) @get_os()
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"OS: %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @get_os()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
void Interp5(unsigned char *pc, int c1, int c2) {
  c1 &= 0xfefefe;
  c2 &= 0xfefefe;
  *((int *)pc) = (c1 + c2) >> 1;
}


x86 assembly (clang, -O0):
<Interp5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfefefe,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0xfefefe,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
sar    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp5>:
and    $0xfefefe,%esi
and    $0xfefefe,%edx
add    %esi,%edx
shr    %edx
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
define void @Interp5(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = and i32 %7, 16711422
store i32 %8, i32* %5
%9 = load i32, i32* %6
%10 = and i32 %9, 16711422
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = ashr i32 %13, 1
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
store i32 %14, i32* %16
ret void
}

LLVM IR (-O2):
define void @Interp5(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = and i32 %1, 16711422
%5 = and i32 %2, 16711422
%6 = add nuw nsw i32 %5, %4
%7 = lshr exact i32 %6, 1
%8 = bitcast i8* %0 to i32*
store i32 %7, i32* %8
ret void
}
double ho_recognize_font_1_four(const double *array_in) {
  double return_value = 0.0;
  return return_value;
}


x86 assembly (clang, -O0):
<ho_recognize_font_1_four>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_recognize_font_1_four>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ho_recognize_font_1_four(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
store double 0.000000e+00, double* %3
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @ho_recognize_font_1_four(double* nocapture readnone %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(const char *cmd) {
  printf("USAGE: %s [-i num_progs] [-h]\n", cmd);
  printf("       -i num_progs      # number of progs of the test\n");
  printf("       -h                # help\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"USAGE: %s [-i num_progs] [-h]\0A\00"
@.str.1 = [56 x i8] c" -i num_progs # number of progs of the test\0A\00"
@.str.2 = [33 x i8] c" -h # help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"USAGE: %s [-i num_progs] [-h]\0A\00"
@str = [55 x i8] c" -i num_progs # number of progs of the test\00"
@str.3 = [32 x i8] c" -h # help\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ serial_data_avail();
int /*<<< orphan*/ serial_read_byte();
void serial_purge() {
  while (serial_data_avail())
    serial_read_byte();
}


x86 assembly (clang, -O0):
<serial_purge>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <serial_purge+0x9>
mov    $0x0,%al
call   1030 <serial_data_avail@plt>
cmp    $0x0,%rax
je     1146 <serial_purge+0x26>
mov    $0x0,%al
call   1040 <serial_read_byte@plt>
jmp    1129 <serial_purge+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_purge>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <serial_data_avail@plt>
test   %rax,%rax
je     1145 <serial_purge+0x25>
xor    %eax,%eax
call   1040 <serial_read_byte@plt>
jmp    1130 <serial_purge+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @serial_purge() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @serial_data_avail()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 (...) @serial_read_byte()
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @serial_purge() {
%1 = tail call i64 (...) @serial_data_avail()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @serial_read_byte()
%5 = tail call i64 (...) @serial_data_avail()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret void
}
__attribute__((no)) long nondet_long() {}


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

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

LLVM IR (-O0):
define i64 @nondet_long() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @nondet_long() {
ret i64 undef
}
/* Variables and functions */
int unit_instance_is_valid(char const *);
int unit_prefix_and_instance_is_valid(const char *p) {
  return unit_instance_is_valid(p);
}


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

x86 assembly (clang, -O2):
<unit_prefix_and_instance_is_valid>:
jmp    1030 <unit_instance_is_valid@plt>

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

LLVM IR (-O2):
define i32 @unit_prefix_and_instance_is_valid(i8* %0) {
%2 = tail call i32 @unit_instance_is_valid(i8* %0)
ret i32 %2
}
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char getPresentVoltage(unsigned char id) {
  return dxl_read_byte(id, (42));
}


x86 assembly (clang, -O0):
<getPresentVoltage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2a,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_byte@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPresentVoltage>:
mov    $0x2a,%esi
jmp    1030 <dxl_read_byte@plt>

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

LLVM IR (-O2):
define zeroext i8 @getPresentVoltage(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 42)
ret i8 %2
}
void pd_set_host_mode(int enable) {}


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

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

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

LLVM IR (-O2):
define void @pd_set_host_mode(i32 %0) {
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR73_set(void) { return U_WMRCORENONE_set("U_WMR73"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR73\00"
define i8* @U_WMR73_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
char **fun1() {
  static char *p = "Linux";
  return &p;
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
lea    0x2f19(%rip),%rax
ret

LLVM IR (-O0):
@fun1.p = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@.str = [6 x i8] c"Linux\00"
define i8** @fun1() {
ret i8** @fun1.p
}

LLVM IR (-O2):
@fun1.p = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
@.str = [6 x i8] c"Linux\00"
define i8** @fun1() {
ret i8** @fun1.p
}
void *f4_1(void *a, int b) { return (a -= b); }


x86 assembly (clang, -O0):
<f4_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_1>:
mov    %rdi,%rax
movslq %esi,%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @f4_1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = sext i32 %5 to i64
%8 = sub i64 0, %7
%9 = getelementptr i8, i8* %6, i64 %8
store i8* %9, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @f4_1(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = sub nsw i64 0, %3
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
int test21() {
  int i;
  if (i)
    return 0;
  else if (1)
    return 2;
}


x86 assembly (clang, -O0):
<test21>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,-0x8(%rbp)
je     111a <test21+0x1a>
movl   $0x0,-0x4(%rbp)
jmp    1121 <test21+0x21>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test21() {
ret i32 2
}
void __attribute__((retain)) f1(void) {}


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

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

LLVM IR (-O0):
@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @f1 to i8*)], section "llvm.metadata"
define void @f1() {
ret void
}

LLVM IR (-O2):
@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @f1 to i8*)], section "llvm.metadata"
define void @f1() {
ret void
}
void drop_privs(void) {}


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

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

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

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

/* Variables and functions */
int safe_atou16_full(char const *, int, int /*<<< orphan*/ *);
int safe_atoux16(const char *s, uint16_t *ret) {
  return safe_atou16_full(s, 16, ret);
}


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

x86 assembly (clang, -O2):
<safe_atoux16>:
mov    %rsi,%rdx
mov    $0x10,%esi
jmp    1030 <safe_atou16_full@plt>

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

LLVM IR (-O2):
define i32 @safe_atoux16(i8* %0, i32* %1) {
%3 = tail call i32 @safe_atou16_full(i8* %0, i32 16, i32* %1)
ret i32 %3
}
/* Variables and functions */
int tracepoint_probe_register(char *, void *);
__attribute__((always_)) int
register_trace_module_load(void (*probe)(struct module *mod)) {
  return tracepoint_probe_register("module_load", (void *)probe);
}


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

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

LLVM IR (-O0):
%struct.module = type opaque
@.str = [12 x i8] c"module_load\00"
define i32 @register_trace_module_load(void (%struct.module*)* %0) {
%2 = alloca void (%struct.module*)*
store void (%struct.module*)* %0, void (%struct.module*)** %2
%3 = load void (%struct.module*)*, void (%struct.module*)** %2
%4 = bitcast void (%struct.module*)* %3 to i8*
%5 = call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.module = type opaque
@.str = [12 x i8] c"module_load\00"
define i32 @register_trace_module_load(void (%struct.module*)* %0) {
%2 = bitcast void (%struct.module*)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ rand0();
int main(void) {
  int count;
  for (count = 0; count < 5; count++)
    printf("%hd\n", rand0());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1163 <main+0x43>
mov    $0x0,%al
call   1040 <rand0@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 (...) @rand0()
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @rand0()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @rand0()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @rand0()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @rand0()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @rand0()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AddDIPad();
int /*<<< orphan*/ AddDIStart();
int /*<<< orphan*/ AddPAD();
long AddSource();
scalar_t__ McResCtrl_GetRegVal(int, int /*<<< orphan*/);
signed long McPacket_AddPathSet(void) {
  signed long sdRet = ((signed long)0);
  if (McResCtrl_GetRegVal((0x00000000UL), (0)) == 0) {
    AddDIPad();
    AddPAD();
    sdRet = AddSource();
    if (sdRet == ((signed long)0)) {
      AddDIStart();
    }
  }
  return sdRet;
}


x86 assembly (clang, -O0):
<McPacket_AddPathSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1060 <McResCtrl_GetRegVal@plt>
cmp    $0x0,%rax
jne    11a3 <McPacket_AddPathSet+0x53>
mov    $0x0,%al
call   1050 <AddDIPad@plt>
mov    $0x0,%al
call   1040 <AddPAD@plt>
mov    $0x0,%al
call   1070 <AddSource@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    119e <McPacket_AddPathSet+0x4e>
mov    $0x0,%al
call   1030 <AddDIStart@plt>
jmp    11a3 <McPacket_AddPathSet+0x53>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<McPacket_AddPathSet>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
xor    %esi,%esi
call   1060 <McResCtrl_GetRegVal@plt>
test   %rax,%rax
jne    1187 <McPacket_AddPathSet+0x37>
xor    %eax,%eax
call   1050 <AddDIPad@plt>
xor    %eax,%eax
call   1040 <AddPAD@plt>
xor    %eax,%eax
call   1070 <AddSource@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1187 <McPacket_AddPathSet+0x37>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <AddDIStart@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @McPacket_AddPathSet() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i64 @McResCtrl_GetRegVal(i32 0, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %0
%5 = call i32 (...) @AddDIPad()
%6 = call i32 (...) @AddPAD()
%7 = call i64 (...) @AddSource()
store i64 %7, i64* %1
%8 = load i64, i64* %1
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = call i32 (...) @AddDIStart()
br label %12
12: ; preds = %10, %4
br label %13
13: ; preds = %12, %0
%14 = load i64, i64* %1
ret i64 %14
}

LLVM IR (-O2):
define i64 @McPacket_AddPathSet() {
%1 = tail call i64 @McResCtrl_GetRegVal(i32 0, i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i32 (...) @AddDIPad()
%5 = tail call i32 (...) @AddPAD()
%6 = tail call i64 (...) @AddSource()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 (...) @AddDIStart()
br label %10
10: ; preds = %3, %8, %0
%11 = phi i64 [ 0, %8 ], [ %6, %3 ], [ 0, %0 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ accept_loop(int);
int /*<<< orphan*/ exit(int);
int listen(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void serve(int sockfd) {
  if (listen(sockfd, 0) == -1) {
    perror("Cannot listen");
    exit(1);
  }
  accept_loop(sockfd);
}


x86 assembly (clang, -O0):
<serve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <listen@plt>
cmp    $0xffffffff,%eax
jne    1174 <serve+0x34>
lea    0xe9b(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%edi
call   1030 <accept_loop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serve>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1040 <listen@plt>
cmp    $0xffffffff,%eax
je     1157 <serve+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <accept_loop@plt>
lea    0xea2(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"Cannot listen\00"
define void @serve(i32 %0) {
%2 = tail call i32 @listen(i32 %0, i32 0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @accept_loop(i32 %0)
ret void
}
void g6() {}


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

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

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

LLVM IR (-O2):
define void @g6() {
ret void
}
/* Type definitions */
struct dynarray {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dynarray_align(struct dynarray *, unsigned long);
void *dynarray_alloc_nr(struct dynarray *, unsigned long);
void *dynarray_alloc_nr_aligned(struct dynarray *da, unsigned long nr,
                                unsigned long align) {
  dynarray_align(da, align);
  return dynarray_alloc_nr(da, nr);
}


x86 assembly (clang, -O0):
<dynarray_alloc_nr_aligned>:
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    -0x18(%rbp),%rsi
call   1040 <dynarray_align@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <dynarray_alloc_nr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynarray_alloc_nr_aligned>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1040 <dynarray_align@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <dynarray_alloc_nr@plt>

LLVM IR (-O0):
%struct.dynarray = type { i32 }
define i8* @dynarray_alloc_nr_aligned(%struct.dynarray* %0, i64 %1, i64 %2) {
%4 = alloca %struct.dynarray*
%5 = alloca i64
%6 = alloca i64
store %struct.dynarray* %0, %struct.dynarray** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load %struct.dynarray*, %struct.dynarray** %4
%8 = load i64, i64* %6
%9 = call i32 @dynarray_align(%struct.dynarray* %7, i64 %8)
%10 = load %struct.dynarray*, %struct.dynarray** %4
%11 = load i64, i64* %5
%12 = call i8* @dynarray_alloc_nr(%struct.dynarray* %10, i64 %11)
ret i8* %12
}

LLVM IR (-O2):
%struct.dynarray = type { i32 }
define i8* @dynarray_alloc_nr_aligned(%struct.dynarray* %0, i64 %1, i64 %2) {
%4 = tail call i32 @dynarray_align(%struct.dynarray* %0, i64 %2)
%5 = tail call i8* @dynarray_alloc_nr(%struct.dynarray* %0, i64 %1)
ret i8* %5
}
void I2CMasterControl(unsigned long ulBase, unsigned long ulCmd) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) = ulCmd;
}


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

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

LLVM IR (-O0):
define void @I2CMasterControl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 4
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterControl(i64 %0, i64 %1) {
%3 = add i64 %0, 4
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Type definitions */
struct media_ctrl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ find_first_device(struct media_ctrl *);
void media_ctrl_open(struct media_ctrl *mc) { find_first_device(mc); }


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

x86 assembly (clang, -O2):
<media_ctrl_open>:
jmp    1030 <find_first_device@plt>

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

LLVM IR (-O2):
%struct.media_ctrl = type { i32 }
define void @media_ctrl_open(%struct.media_ctrl* %0) {
%2 = tail call i32 @find_first_device(%struct.media_ctrl* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int recur(int i) {
  int j = i;
  printf("recur call %d: stack@ %p\n", i, j);
  if (i > 0) {
    return recur(i - 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<recur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1160 <recur+0x40>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <recur@plt>
mov    %eax,-0x4(%rbp)
jmp    1167 <recur+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recur>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
test   %ebx,%ebx
jle    1155 <recur+0x45>
add    $0x1,%ebx
lea    0xecc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x2(%rbx),%edx
mov    %r14,%rdi
mov    %edx,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1140 <recur+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"recur call %d: stack@ %p\0A\00"
define i32 @recur(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @recur(i32 %13)
store i32 %14, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [26 x i8] c"recur call %d: stack@ %p\0A\00"
define i32 @recur(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %0)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %6)
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %1
ret i32 0
}
int xglobnoWeak(int i) { return i * 32; }


x86 assembly (clang, -O0):
<xglobnoWeak>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xglobnoWeak>:
mov    %edi,%eax
shl    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @xglobnoWeak(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 32
ret i32 %4
}

LLVM IR (-O2):
define i32 @xglobnoWeak(i32 %0) {
%2 = shl nsw i32 %0, 5
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int __attribute__((weak)) pthread_mutex_lock(pthread_mutex_t *mutex) {
  (void)mutex;
  return 0;
}


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

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

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

LLVM IR (-O2):
define weak i32 @pthread_mutex_lock(i32* %0) {
ret i32 0
}
unsigned int turn(unsigned int a) {
  unsigned char b[4];
  unsigned char *p = (unsigned char *)(&a);
  b[3] = *p++;
  b[2] = *p++;
  b[1] = *p++;
  b[0] = *p;
  return *(unsigned int *)(&b[0]);
}


x86 assembly (clang, -O0):
<turn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x6(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x7(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @turn(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
%4 = alloca i8*
store i32 %0, i32* %2
%5 = bitcast i32* %2 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
%8 = load i8, i8* %6
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %8, i8* %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8, i8* %10
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %12, i8* %13
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
%16 = load i8, i8* %14
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %16, i8* %17
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %19, i8* %20
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%22 = bitcast i8* %21 to i32*
%23 = load i32, i32* %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @turn(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void gtk_icon_theme_set_custom_theme() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_set_custom_theme() {
ret void
}
void StubBug(const char *msg) { (void)msg; }


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

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

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

LLVM IR (-O2):
define void @StubBug(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ guiput_(char *, float *, int *, int *, int *);
void GUIPUT(char *aname, float *array, int *dimx, int *dimy, int *dimz) {
  guiput_(aname, array, dimx, dimy, dimz);
}


x86 assembly (clang, -O0):
<GUIPUT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <guiput_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GUIPUT>:
jmp    1030 <guiput_@plt>

LLVM IR (-O0):
define void @GUIPUT(i8* %0, float* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca float*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i8* %0, i8** %6
store float* %1, float** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i8*, i8** %6
%12 = load float*, float** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @guiput_(i8* %11, float* %12, i32* %13, i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @GUIPUT(i8* %0, float* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @guiput_(i8* %0, float* %1, i32* %2, i32* %3, i32* %4)
ret void
}