xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sincosf(float, float *, float *);
float sincosf_wrap(float x) {
  float s, c;
  sincosf(x, &s, &c);
  return s + c;
}


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

x86 assembly (clang, -O2):
<sincosf_wrap>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <sincosf@plt>
movss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @sincosf_wrap(float %0) {
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = call i32 @sincosf(float %0, float* %2, float* %3)
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fadd float %7, %8
ret float %9
}
unsigned short htons(unsigned short n) {
  unsigned short h;
  unsigned char *c = (unsigned char *)&n;
  ((unsigned char *)&h)[0] = c[1];
  ((unsigned char *)&h)[1] = c[0];
  return h;
}


x86 assembly (clang, -O0):
<htons>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x3(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htons>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @htons(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %2
%5 = bitcast i16* %2 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = bitcast i16* %3 to i8*
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = bitcast i16* %3 to i8*
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @htons(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
void gtk_widget_set_redraw_on_allocate() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_set_redraw_on_allocate() {
ret void
}
void LoadRoomNames(char *arrRooms[]) {
  int i;
  for (i = 0; i < 7; ++i) {
  }
}


x86 assembly (clang, -O0):
<LoadRoomNames>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    112c <LoadRoomNames+0x2c>
jmp    111e <LoadRoomNames+0x1e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <LoadRoomNames+0xf>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @LoadRoomNames(i8** nocapture %0) {
ret void
}
/* Variables and functions */
int close(int const);
int /*<<< orphan*/ shutdown(int const, int);
int /*<<< orphan*/ valid_sfd(int const);
int socket_close(const int sfd) {
  if (!valid_sfd(sfd))
    return -1;
  shutdown(sfd, 0x01 | 0x02);
  int error = 0;
  error = close(sfd);
  return error;
}


x86 assembly (clang, -O0):
<socket_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <valid_sfd@plt>
cmp    $0x0,%eax
jne    1158 <socket_close+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <socket_close+0x4d>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1030 <shutdown@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_close>:
push   %rbx
mov    %edi,%ebx
call   1050 <valid_sfd@plt>
test   %eax,%eax
je     1150 <socket_close+0x20>
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @socket_close(i32 %0) {
%2 = tail call i32 @valid_sfd(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @shutdown(i32 %0, i32 3)
%6 = tail call i32 @close(i32 %0)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ini_getdouble_default(double *, char *);
double ini_getdouble_default_def(char *param, double def) {
  double value;
  if (!ini_getdouble_default(&value, param))
    return def;
  return value;
}


x86 assembly (clang, -O0):
<ini_getdouble_default_def>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdi
call   1030 <ini_getdouble_default@plt>
cmp    $0x0,%eax
jne    1146 <ini_getdouble_default_def+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1150 <ini_getdouble_default_def+0x40>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_getdouble_default_def>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rsi
lea    0x10(%rsp),%rdi
call   1030 <ini_getdouble_default@plt>
movsd  0x8(%rsp),%xmm0
test   %eax,%eax
je     1137 <ini_getdouble_default_def+0x27>
movsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @ini_getdouble_default_def(i8* %0, double %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i32 @ini_getdouble_default(double* %3, i8* %0)
%6 = icmp eq i32 %5, 0
%7 = load double, double* %3
%8 = select i1 %6, double %1, double %7
ret double %8
}
void __attribute__((preserve_most)) foo(void *ptr) {}


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

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

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

LLVM IR (-O2):
define preserve_mostcc void @foo(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int __cmpfunc(void *user_data, const void *a, const void *b, size_t size) {
  return (*((const int *)a) - *((const int *)b));
}


x86 assembly (clang, -O0):
<__cmpfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cmpfunc>:
mov    (%rsi),%eax
sub    (%rdx),%eax
ret

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

LLVM IR (-O2):
define i32 @__cmpfunc(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2, i64 %3) {
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = bitcast i8* %2 to i32*
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}
int isatty(fd) {
  if (fd == 0 || fd == 1 || fd == 2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1125 <isatty+0x25>
cmpl   $0x1,-0x8(%rbp)
je     1125 <isatty+0x25>
cmpl   $0x2,-0x8(%rbp)
jne    1131 <isatty+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <isatty+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int execlpe(const char *path, const char *argv0, ...) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<execlpe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<execlpe>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @execlpe(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @execlpe(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(int /*<<< orphan*/, size_t);
void *ecalloc(uint32_t nelm, size_t nsize) {
  void *p = calloc(nelm, nsize);
  if (!p)
    abort();
  return p;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <ecalloc+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     112d <ecalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @ecalloc(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i32 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @ecalloc(i32 %0, i64 %1) {
%3 = tail call i8* @calloc(i32 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
int repeatValuemax(int delta, int maxValue) {
  int newDelta;
  newDelta = delta;
  while (newDelta < 0) {
    newDelta += maxValue;
  }
  while (newDelta >= maxValue) {
    newDelta -= maxValue;
  }
  return newDelta;
}


x86 assembly (clang, -O0):
<repeatValuemax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1128 <repeatValuemax+0x28>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1110 <repeatValuemax+0x10>
jmp    112d <repeatValuemax+0x2d>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1149 <repeatValuemax+0x49>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <repeatValuemax+0x2d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeatValuemax>:
mov    %edi,%eax
mov    %esi,%ecx
neg    %ecx
cs nopw 0x0(%rax,%rax,1)
add    %esi,%eax
mov    %ecx,%edx
add    %eax,%edx
js     1110 <repeatValuemax+0x10>
nopl   0x0(%rax,%rax,1)
sub    %esi,%eax
cmp    %esi,%eax
jge    1120 <repeatValuemax+0x20>
ret

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

LLVM IR (-O2):
define i32 @repeatValuemax(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = icmp slt i32 %4, 0
%6 = add nsw i32 %4, %1
br i1 %5, label %3, label %7
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ %4, %3 ]
%9 = icmp slt i32 %8, %1
%10 = sub nsw i32 %8, %1
br i1 %9, label %11, label %7
11: ; preds = %7
ret i32 %8
}
void sws_getIdentityVec() {}


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

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

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

LLVM IR (-O2):
define void @sws_getIdentityVec() {
ret void
}
int xtensa_b4const(v)
int v;
{
  switch (v) {
  case -1:
  case 1:
  case 2:
  case 3:
  case 4:
  case 5:
  case 6:
  case 7:
  case 8:
  case 10:
  case 12:
  case 16:
  case 32:
  case 64:
  case 128:
  case 256: {
    return 1;
  } break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<xtensa_b4const>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xffffffff,%eax
je     11aa <xtensa_b4const+0xaa>
jmp    111b <xtensa_b4const+0x1b>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x8,%eax
jb     11aa <xtensa_b4const+0xaa>
jmp    112f <xtensa_b4const+0x2f>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
je     11aa <xtensa_b4const+0xaa>
jmp    1140 <xtensa_b4const+0x40>
mov    -0xc(%rbp),%eax
sub    $0xc,%eax
je     11aa <xtensa_b4const+0xaa>
jmp    1151 <xtensa_b4const+0x51>
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
je     11aa <xtensa_b4const+0xaa>
jmp    1162 <xtensa_b4const+0x62>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     11aa <xtensa_b4const+0xaa>
jmp    1173 <xtensa_b4const+0x73>
mov    -0xc(%rbp),%eax
sub    $0x40,%eax
je     11aa <xtensa_b4const+0xaa>
jmp    1184 <xtensa_b4const+0x84>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
je     11aa <xtensa_b4const+0xaa>
jmp    1197 <xtensa_b4const+0x97>
mov    -0xc(%rbp),%eax
sub    $0x100,%eax
jne    11b6 <xtensa_b4const+0xb6>
jmp    11aa <xtensa_b4const+0xaa>
movl   $0x1,-0x4(%rbp)
jmp    11bd <xtensa_b4const+0xbd>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_b4const>:
mov    $0x1,%eax
lea    0x1(%rdi),%ecx
cmp    $0x81,%ecx
ja     1121 <xtensa_b4const+0x21>
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
ret
cmp    $0x100,%edi
je     1120 <xtensa_b4const+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @xtensa_b4const(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 -1, label %5
i32 1, label %5
i32 2, label %5
i32 3, label %5
i32 4, label %5
i32 5, label %5
i32 6, label %5
i32 7, label %5
i32 8, label %5
i32 10, label %5
i32 12, label %5
i32 16, label %5
i32 32, label %5
i32 64, label %5
i32 128, label %5
i32 256, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @xtensa_b4const(i32 %0) {
switch i32 %0, label %2 [
i32 -1, label %3
i32 1, label %3
i32 2, label %3
i32 3, label %3
i32 4, label %3
i32 5, label %3
i32 6, label %3
i32 7, label %3
i32 8, label %3
i32 10, label %3
i32 12, label %3
i32 16, label %3
i32 32, label %3
i32 64, label %3
i32 128, label %3
i32 256, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ IOoutput(int, int);
void SetIOchip(int chip_no) { IOoutput(chip_no, 0xFF); }


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

x86 assembly (clang, -O2):
<SetIOchip>:
mov    $0xff,%esi
jmp    1030 <IOoutput@plt>

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

LLVM IR (-O2):
define void @SetIOchip(i32 %0) {
%2 = tail call i32 @IOoutput(i32 %0, i32 255)
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int get_time_ms(void) {
  struct timespec tp;
  clock_gettime(CLOCK_MONOTONIC, &tp);
  return tp.tv_sec * 1000 + tp.tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<get_time_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_ms>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @get_time_ms() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @get_time_ms() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %10, %7
ret i32 %11
}
int test_imm_44int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x44 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_44int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 292057776128
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ is_all_num(char *, int);
scalar_t__ is_last_char_valid(char *, int);
int is_valid(char id[], int len) {
  if (is_all_num(id, len - 1) && is_last_char_valid(id, len)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1030 <is_all_num@plt>
cmp    $0x0,%rax
je     116a <is_valid+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <is_last_char_valid@plt>
cmp    $0x0,%rax
je     116a <is_valid+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <is_valid+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
lea    -0x1(%r14),%esi
call   1030 <is_all_num@plt>
test   %rax,%rax
je     1150 <is_valid+0x30>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <is_last_char_valid@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1152 <is_valid+0x32>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @is_valid(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i32, i32* %5
%8 = sub nsw i32 %7, 1
%9 = call i64 @is_all_num(i8* %6, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i64 @is_last_char_valid(i8* %12, i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 1, i32* %3
br label %18
17: ; preds = %11, %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_valid(i8* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i64 @is_all_num(i8* %0, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i64 @is_last_char_valid(i8* %0, i32 %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6, %2
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
char getchar();
extern char get_char() { return getchar(); }


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

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

LLVM IR (-O0):
define signext i8 @get_char() {
%1 = call signext i8 (...) @getchar()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @get_char() {
%1 = tail call signext i8 (...) @getchar()
ret i8 %1
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void textmode_setcursor(int x, int y) {
  uint16_t location = y * 80 + x;
  outb(0x3D4, 14);
  outb(0x3D5, location >> 8);
  outb(0x3D4, 15);
  outb(0x3D5, location);
}


x86 assembly (clang, -O0):
<textmode_setcursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x50,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
mov    -0xc(%rbp),%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textmode_setcursor>:
push   %rbx
lea    (%rsi,%rsi,4),%ebx
shl    $0x4,%ebx
add    %edi,%ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
mov    %ebx,%esi
sar    $0x8,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @textmode_setcursor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 80
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
store i32 %9, i32* %5
%10 = call i32 @outb(i32 980, i32 14)
%11 = load i32, i32* %5
%12 = ashr i32 %11, 8
%13 = call i32 @outb(i32 981, i32 %12)
%14 = call i32 @outb(i32 980, i32 15)
%15 = load i32, i32* %5
%16 = call i32 @outb(i32 981, i32 %15)
ret void
}

LLVM IR (-O2):
define void @textmode_setcursor(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 80
%4 = add nsw i32 %3, %0
%5 = tail call i32 @outb(i32 980, i32 14)
%6 = ashr i32 %4, 8
%7 = tail call i32 @outb(i32 981, i32 %6)
%8 = tail call i32 @outb(i32 980, i32 15)
%9 = tail call i32 @outb(i32 981, i32 %4)
ret void
}
void NoBoil() {}


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

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

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

LLVM IR (-O2):
define void @NoBoil() {
ret void
}
int ti_crossany_start(double const *options) {
  (void)options;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_crossany_start(double* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t len = 0;
  while (s[len] != '\0')
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_append(struct list_head *, struct list_head *);
scalar_t__ list_empty(struct list_head *);
void list_append(struct list_head *list, struct list_head *head) {
  if (list_empty(list))
    return;
  __list_append(list, head);
}


x86 assembly (clang, -O0):
<list_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <list_empty@plt>
cmp    $0x0,%rax
je     1148 <list_append+0x28>
jmp    1155 <list_append+0x35>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__list_append@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_append>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <list_empty@plt>
test   %rax,%rax
je     113c <list_append+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__list_append@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_append(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i64 @list_empty(%struct.list_head* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = load %struct.list_head*, %struct.list_head** %3
%11 = load %struct.list_head*, %struct.list_head** %4
%12 = call i32 @__list_append(%struct.list_head* %10, %struct.list_head* %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_append(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i64 @list_empty(%struct.list_head* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @__list_append(%struct.list_head* %0, %struct.list_head* %1)
br label %7
7: ; preds = %2, %5
ret void
}
int BTSHASP_PushLinenum() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @BTSHASP_PushLinenum() {
ret i32 0
}
int test4(int d) { return (d ^ 1) & 1; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @test4(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
void gtk_layout_set_vadjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_layout_set_vadjustment() {
ret void
}
/* Variables and functions */
int PnameDef();
PlogicNameDef() {
  int b = -1;
  ;
  b = PnameDef();
  return (b);
}


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

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

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

LLVM IR (-O2):
define i32 @PlogicNameDef() {
%1 = tail call i32 (...) @PnameDef()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ request_ctl_init();
void setup(void) { request_ctl_init(); }


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

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

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

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 (...) @request_ctl_init()
ret void
}
void tlbtrace_toggle(void) {}


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

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

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

LLVM IR (-O2):
define void @tlbtrace_toggle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int toes;
  toes = 10;
  printf("toes is %d, toes squared is %d, toes cubed is %d", toes, toes * toes,
         toes * toes * toes);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
mov    $0x64,%edx
mov    $0x3e8,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"toes is %d, toes squared is %d, toes cubed is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %6, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"toes is %d, toes squared is %d, toes cubed is %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 10, i32 100, i32 1000)
ret i32 0
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int inet_aton(char const *, struct in_addr *);
int netcat_inet_pton(int af, const char *src, void *dst) {
  int ret;
  ret = inet_aton(src, (struct in_addr *)dst);
  return ret;
}


x86 assembly (clang, -O0):
<netcat_inet_pton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <inet_aton@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netcat_inet_pton>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <inet_aton@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @netcat_inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to %struct.in_addr*
%11 = call i32 @inet_aton(i8* %8, %struct.in_addr* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @netcat_inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.in_addr*
%5 = tail call i32 @inet_aton(i8* %1, %struct.in_addr* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long EPIWriteFIFOCountGet(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x400D0000);
  return ((*((volatile unsigned long *)(ulBase + 0x00000204))));
}


x86 assembly (clang, -O0):
<EPIWriteFIFOCountGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x400d0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x204(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIWriteFIFOCountGet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400d0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x204(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @EPIWriteFIFOCountGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074593792
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 516
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @EPIWriteFIFOCountGet(i64 %0) {
%2 = icmp eq i64 %0, 1074593792
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 516
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}
/* Variables and functions */
int atoi(char *);
int SCClAtoi(char *number) { return atoi(number); }


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

x86 assembly (clang, -O2):
<SCClAtoi>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @SCClAtoi(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
void gtk_settings_set_double_property() {}


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

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

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

LLVM IR (-O2):
define void @gtk_settings_set_double_property() {
ret void
}
/* Variables and functions */
scalar_t__ errChkdMalloc(int);
char *allocHolderMemory(int gridSize) {
  return (char *)errChkdMalloc((4 + 4 + 1) * (gridSize * gridSize));
}


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

x86 assembly (clang, -O2):
<allocHolderMemory>:
imul   %edi,%edi
lea    (%rdi,%rdi,8),%edi
jmp    1030 <errChkdMalloc@plt>

LLVM IR (-O0):
define i8* @allocHolderMemory(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = mul nsw i32 9, %5
%7 = call i64 @errChkdMalloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @allocHolderMemory(i32 %0) {
%2 = mul i32 %0, 9
%3 = mul i32 %2, %0
%4 = tail call i64 @errChkdMalloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ printf(char *, char);
void test_const_2(void) {
  char *const p_a = malloc(1), *p_b = malloc(1);
  *p_a = 'a';
  printf("*p_a"
         " = %c\n",
         (*p_a));
  *p_a = 'b';
  printf("*p_a"
         " = %c\n",
         (*p_a));
  *p_b = 'b';
  printf("*p_a"
         " = %c\n",
         (*p_a));
}


x86 assembly (clang, -O0):
<test_const_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x8(%rbp),%rax
lea    0xeaa(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movb   $0x62,(%rax)
mov    -0x8(%rbp),%rax
lea    0xe90(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movb   $0x62,(%rax)
mov    -0x8(%rbp),%rax
lea    0xe76(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_const_2>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"*p_a = %c\0A\00"
define void @test_const_2() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 1)
store i8* %3, i8** %1
%4 = call i8* @malloc(i32 1)
store i8* %4, i8** %2
%5 = load i8*, i8** %1
store i8 97, i8* %5
%6 = load i8*, i8** %1
%7 = load i8, i8* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = load i8*, i8** %1
store i8 98, i8* %9
%10 = load i8*, i8** %1
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %11)
%13 = load i8*, i8** %2
store i8 98, i8* %13
%14 = load i8*, i8** %1
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %15)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"*p_a = %c\0A\00"
define void @test_const_2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext 97)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext 98)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext 98)
ret void
}
const char *protobuf_c_version(void) { return "1.3.0"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.3.0\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.3.0\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct passwd_test_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __passwd_test_data_clear(struct passwd_test_data *);
void __passwd_test_data_destroy(struct passwd_test_data *td) {
  __passwd_test_data_clear(td);
}


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

x86 assembly (clang, -O2):
<__passwd_test_data_destroy>:
jmp    1030 <__passwd_test_data_clear@plt>

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

LLVM IR (-O2):
%struct.passwd_test_data = type { i32 }
define void @__passwd_test_data_destroy(%struct.passwd_test_data* %0) {
%2 = tail call i32 @__passwd_test_data_clear(%struct.passwd_test_data* %0)
ret void
}
/* Type definitions */
struct cbuf {
  int dummy;
};

/* Variables and functions */
size_t cbuf_capacity(struct cbuf const *);
size_t cbuf_size(struct cbuf const *);
size_t cbuf_avail_size(const struct cbuf *cbuf) {
  return cbuf_capacity(cbuf) - cbuf_size(cbuf);
}


x86 assembly (clang, -O0):
<cbuf_avail_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cbuf_capacity@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cbuf_size@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf_avail_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <cbuf_capacity@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <cbuf_size@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.cbuf = type { i32 }
define i64 @cbuf_avail_size(%struct.cbuf* %0) {
%2 = alloca %struct.cbuf*
store %struct.cbuf* %0, %struct.cbuf** %2
%3 = load %struct.cbuf*, %struct.cbuf** %2
%4 = call i64 @cbuf_capacity(%struct.cbuf* %3)
%5 = load %struct.cbuf*, %struct.cbuf** %2
%6 = call i64 @cbuf_size(%struct.cbuf* %5)
%7 = sub i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.cbuf = type { i32 }
define i64 @cbuf_avail_size(%struct.cbuf* %0) {
%2 = tail call i64 @cbuf_capacity(%struct.cbuf* %0)
%3 = tail call i64 @cbuf_size(%struct.cbuf* %0)
%4 = sub i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ notimplemented(char *);
void __svgalib_driverplanar16_nothing(void) {
  {
    notimplemented("planar 16 color mode primitive");
    return;
  };
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"planar 16 color mode primitive\00"
define void @__svgalib_driverplanar16_nothing() {
%1 = call i32 @notimplemented(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"planar 16 color mode primitive\00"
define void @__svgalib_driverplanar16_nothing() {
%1 = tail call i32 @notimplemented(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void end_doc(FILE *fp) { fprintf(fp, "\033%%-12345X@PJL EOJ\r\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\1B%%-12345X@PJL EOJ\0D\0A\00"
define void @end_doc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"\1B%%-12345X@PJL EOJ\0D\0A\00"
define void @end_doc(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}