xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void set_timeout(struct timeval *timeout, int sec, int usec) {
  memset((void *)timeout, 0, sizeof(struct timeval));
  timeout->tv_sec = sec;
  timeout->tv_usec = usec;
}


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

x86 assembly (clang, -O2):
<set_timeout>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    %ebp,(%rbx)
mov    %r14d,0x4(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @set_timeout(%struct.timeval* %0, i32 %1, i32 %2) {
%4 = alloca %struct.timeval*
%5 = alloca i32
%6 = alloca i32
store %struct.timeval* %0, %struct.timeval** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = bitcast %struct.timeval* %7 to i8*
%9 = call i32 @memset(i8* %8, i32 0, i32 8)
%10 = load i32, i32* %5
%11 = load %struct.timeval*, %struct.timeval** %4
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
store i32 %10, i32* %12
%13 = load i32, i32* %6
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @set_timeout(%struct.timeval* %0, i32 %1, i32 %2) {
%4 = bitcast %struct.timeval* %0 to i8*
%5 = tail call i32 @memset(i8* %4, i32 0, i32 8)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i32 %2, i32* %7
ret void
}
/* Variables and functions */
int strlen(char const *);
int sndlib_strlen(const char *str) {
  if ((str) && (*str))
    return (strlen(str));
  return (0);
}


x86 assembly (clang, -O0):
<sndlib_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <sndlib_strlen+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <sndlib_strlen+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    114f <sndlib_strlen+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sndlib_strlen>:
test   %rdi,%rdi
je     111f <sndlib_strlen+0xf>
cmpb   $0x0,(%rdi)
je     111f <sndlib_strlen+0xf>
jmp    1030 <strlen@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sndlib_strlen(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8*, i8** %3
%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 = %6
%12 = load i8*, i8** %3
%13 = call i32 @strlen(i8* %12)
store i32 %13, i32* %2
br label %15
14: ; preds = %6, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @sndlib_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
br label %8
8: ; preds = %1, %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
uint32_t EndianCvt32(uint32_t x) {
  return (((x >> 24UL) & 0xff) | ((x << 24UL) & 0xff000000) |
          ((x >> 8UL) & 0xff00) | ((x << 8UL) & 0xff0000));
}


x86 assembly (clang, -O0):
<EndianCvt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    -0x8(%rbp),%rcx
shl    $0x18,%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
and    $0xff00,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x8,%rcx
and    $0xff0000,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EndianCvt32>:
mov    %rdi,%rax
bswap  %eax
ret

LLVM IR (-O0):
define i64 @EndianCvt32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 24
%5 = and i64 %4, 255
%6 = load i64, i64* %2
%7 = shl i64 %6, 24
%8 = and i64 %7, 4278190080
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = lshr i64 %10, 8
%12 = and i64 %11, 65280
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = shl i64 %14, 8
%16 = and i64 %15, 16711680
%17 = or i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @EndianCvt32(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *, int *, int);
int main() {
  int a[100], b[200];
  foo((int *)0, a, 100);
  foo(a, (int *)0, 200);
  foo(a, b, 50);
  foo(a, b, 20);
  return 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
mov    $0x64,%edx
call   1030 <foo@plt>
lea    -0x1a0(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xc8,%edx
call   1030 <foo@plt>
lea    -0x1a0(%rbp),%rdi
lea    -0x4c0(%rbp),%rsi
mov    $0x32,%edx
call   1030 <foo@plt>
lea    -0x1a0(%rbp),%rdi
lea    -0x4c0(%rbp),%rsi
mov    $0x14,%edx
call   1030 <foo@plt>
mov    $0x2,%eax
add    $0x4c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x4b8,%rsp
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x64,%edx
call   1030 <foo@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1030 <foo@plt>
lea    0x190(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x32,%edx
call   1030 <foo@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x14,%edx
call   1030 <foo@plt>
mov    $0x2,%eax
add    $0x4b8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca [200 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%5 = call i32 @foo(i32* null, i32* %4, i32 100)
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%7 = call i32 @foo(i32* %6, i32* null, i32 200)
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 0
%10 = call i32 @foo(i32* %8, i32* %9, i32 50)
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%12 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 0
%13 = call i32 @foo(i32* %11, i32* %12, i32 20)
ret i32 2
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i32]
%2 = alloca [200 x i32]
%3 = bitcast [100 x i32]* %1 to i8*
%4 = bitcast [200 x i32]* %2 to i8*
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%6 = call i32 @foo(i32* null, i32* %5, i32 100)
%7 = call i32 @foo(i32* %5, i32* null, i32 200)
%8 = getelementptr inbounds [200 x i32], [200 x i32]* %2, i64 0, i64 0
%9 = call i32 @foo(i32* %5, i32* %8, i32 50)
%10 = call i32 @foo(i32* %5, i32* %8, i32 20)
ret i32 2
}
void arraySort(int array[], int size) {}


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

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

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

LLVM IR (-O2):
define void @arraySort(i32* nocapture %0, i32 %1) {
ret void
}
int main() {
  int a, b;
  while (a != b) {
    if (a > b)
      a = a - b;
    else {
      b = b - a;
    }
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     113f <main+0x3f>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1131 <main+0x31>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113a <main+0x3a>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110b <main+0xb>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
struct p4_action *netconv_p4_action(struct p4_action *m) {
  return m;
}


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

x86 assembly (clang, -O2):
<netconv_p4_action>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.p4_action = type opaque
define %struct.p4_action* @netconv_p4_action(%struct.p4_action* %0) {
%2 = alloca %struct.p4_action*
store %struct.p4_action* %0, %struct.p4_action** %2
%3 = load %struct.p4_action*, %struct.p4_action** %2
ret %struct.p4_action* %3
}

LLVM IR (-O2):
%struct.p4_action = type opaque
define %struct.p4_action* @netconv_p4_action(%struct.p4_action* readnone returned %0) {
ret %struct.p4_action* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int scanf(char *, int *, int *);
int main() {
  int i, j, ret;
  ret = scanf("%d%d", &i, &j);
  printf("ret = %d\n%d\t%d\n", ret, i, j);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [16 x i8] c"ret = %d\0A%d\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [16 x i8] c"ret = %d\0A%d\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void host_free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<host_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @host_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_setgridlayout(int, int, int);
void j_setgridlayout(int arg0, int arg1, int arg2) {
  japi_setgridlayout(arg0, arg1, arg2);
}


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

x86 assembly (clang, -O2):
<j_setgridlayout>:
jmp    1030 <japi_setgridlayout@plt>

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

LLVM IR (-O2):
define void @j_setgridlayout(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @japi_setgridlayout(i32 %0, i32 %1, i32 %2)
ret void
}
unsigned long find_zero(unsigned long mask) {
  unsigned long ret;
  ret = (0x0ff0001 + mask) >> 23;
  ret &= mask;
  return ret;
}


x86 assembly (clang, -O0):
<find_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xff0001,%rax
shr    $0x17,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_zero>:
lea    0xff0001(%rdi),%rax
shr    $0x17,%rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @find_zero(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 16711681, %4
%6 = lshr i64 %5, 23
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = and i64 %8, %7
store i64 %9, i64* %3
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
define i64 @find_zero(i64 %0) {
%2 = add i64 %0, 16711681
%3 = lshr i64 %2, 23
%4 = and i64 %3, %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ I2CVMHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void I2CVMRequestUpdate() { UAVObjRequestUpdate(I2CVMHandle()); }


x86 assembly (clang, -O0):
<I2CVMRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <I2CVMHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CVMRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <I2CVMHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @I2CVMRequestUpdate() {
%1 = call i32 (...) @I2CVMHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @I2CVMRequestUpdate() {
%1 = tail call i32 (...) @I2CVMHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
void set_cfs_rq_curr(struct cfs_rq *cfs_rq, struct sched_entity *se) {}


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

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

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

LLVM IR (-O2):
%struct.cfs_rq = type opaque
%struct.sched_entity = type opaque
define void @set_cfs_rq_curr(%struct.cfs_rq* nocapture %0, %struct.sched_entity* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vsyslog(int, char const *, int /*<<< orphan*/);
void vsyslogp(int priority, const char *msgid, const char *sdfmt,
              const char *fmt, va_list ap) {
  vsyslog(priority, fmt, ap);
}


x86 assembly (clang, -O0):
<vsyslogp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <vsyslog@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsyslogp>:
mov    %r8d,%edx
mov    %rcx,%rsi
jmp    1030 <vsyslog@plt>

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

LLVM IR (-O2):
define void @vsyslogp(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* %3, i32 %4) {
%6 = tail call i32 @vsyslog(i32 %0, i8* %3, i32 %4)
ret void
}
void rem(void *a) {}


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

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

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

LLVM IR (-O2):
define void @rem(i8* nocapture %0) {
ret void
}
void set_dacr(unsigned long val) {
  asm("mrc p15, 0, %0, c3, c0, 0" : "=r"(val) : : "cc");
}


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

LLVM IR (-O0):
LLVM IR (-O2):
define void @set_dacr(i64 %0) {
%2 = tail call i64 asm "mrc p15, 0, $0, c3, c0, 0", "=r,~{cc},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void _start() { _exit(0); }


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @_start() {
%1 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int scsi_request(char *, unsigned char *, int *, int, int /*<<< orphan*/, int,
                 int, int /*<<< orphan*/, int, int /*<<< orphan*/, int,
                 int /*<<< orphan*/);
int mode_sense(unsigned char *buf, int *buflen) {
  int len = *buflen;
  if (len > 255)
    len = 255;
  return scsi_request("mode_sense(6)", buf, buflen, 6, 0, 0x01 | 0x10, 0x1A, 0,
                      0x01, 0, len, 0);
}


x86 assembly (clang, -O0):
<mode_sense>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xff,-0x14(%rbp)
jle    113d <mode_sense+0x2d>
movl   $0xff,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%eax
lea    0xeb1(%rip),%rdi
mov    $0x6,%ecx
xor    %r8d,%r8d
mov    $0x11,%r9d
movl   $0x1a,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x1,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    %eax,0x20(%rsp)
movl   $0x0,0x28(%rsp)
call   1030 <scsi_request@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_sense>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    (%rdx),%eax
cmp    $0xff,%eax
mov    $0xff,%r10d
cmovl  %eax,%r10d
lea    0xed1(%rip),%rdi
mov    $0x6,%ecx
xor    %r8d,%r8d
mov    $0x11,%r9d
push   $0x0
push   %r10
push   $0x0
push   $0x1
push   $0x0
push   $0x1a
call   1030 <scsi_request@plt>
add    $0x30,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"mode_sense(6)\00"
define i32 @mode_sense(i8* %0, i32* %1) {
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 255
%5 = select i1 %4, i32 %3, i32 255
%6 = tail call i32 @scsi_request(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i32* %1, i32 6, i32 0, i32 17, i32 26, i32 0, i32 1, i32 0, i32 %5, i32 0)
ret i32 %6
}
void foo589() {}


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

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

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

LLVM IR (-O2):
define void @foo589() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ begin(int /*<<< orphan*/);
int /*<<< orphan*/ end(int);
int main(int argc, const char *argv[]) {
  begin(0);
  end(1);
  if (argc)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <begin@plt>
mov    $0x1,%edi
call   1030 <end@plt>
cmpl   $0x0,-0x8(%rbp)
je     115d <main+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1164 <main+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <begin@plt>
mov    $0x1,%edi
call   1030 <end@plt>
xor    %eax,%eax
test   %ebx,%ebx
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @begin(i32 0)
%4 = tail call i32 @end(i32 1)
%5 = icmp eq i32 %0, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void local_to_vax_shorts_(unsigned short *sa, const int *n) { return; }


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

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

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

LLVM IR (-O2):
define void @local_to_vax_shorts_(i16* nocapture %0, i32* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XGraphicsExposeEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XGraphicsExposeEvent(void) {
  XGraphicsExposeEvent *_p =
      (XGraphicsExposeEvent *)malloc(sizeof(XGraphicsExposeEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XGraphicsExposeEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XGraphicsExposeEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XGraphicsExposeEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XGraphicsExposeEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XGraphicsExposeEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XGraphicsExposeEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *str) {
  size_t n = strlen(str) + 1;
  char *dup = malloc(n);
  if (dup) {
    strcpy(dup, str);
  }
  return dup;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1173 <strdup+0x43>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115a <strdup+0x2a>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_UTCTIME;

/* Variables and functions */
int /*<<< orphan*/ ASN1_UTCTIME_it;
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void ASN1_UTCTIME_free(ASN1_UTCTIME *a) {
  ASN1_item_free((ASN1_VALUE *)a, &ASN1_UTCTIME_it);
}


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

x86 assembly (clang, -O2):
<ASN1_UTCTIME_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@ASN1_UTCTIME_it = global i32 0
define void @ASN1_UTCTIME_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @ASN1_UTCTIME_it)
ret void
}

LLVM IR (-O2):
@ASN1_UTCTIME_it = global i32 0
define void @ASN1_UTCTIME_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @ASN1_UTCTIME_it)
ret void
}
/* Variables and functions */
scalar_t__ isalnum(int);
int iswordchar(int c) { return isalnum(c) || c == '_'; }


x86 assembly (clang, -O0):
<iswordchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <iswordchar+0x2f>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswordchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @iswordchar(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ ISNANf(float);
int ISINFf(float x) { return !ISNANf(x) && ISNANf(x - x); }


x86 assembly (clang, -O0):
<ISINFf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <ISNANf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1152 <ISINFf+0x42>
movss  -0x4(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
call   1030 <ISNANf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISINFf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <ISNANf@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1128 <ISINFf+0x18>
pop    %rcx
ret
movss  0x4(%rsp),%xmm0
subss  %xmm0,%xmm0
call   1030 <ISNANf@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ISINFf(float %0) {
%2 = tail call i64 @ISNANf(float %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = fsub float %0, %0
%6 = tail call i64 @ISNANf(float %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t dtls_uint64_to_int(const unsigned char *field) {
  return ((uint64_t)field[0] << 56) | ((uint64_t)field[1] << 48) |
         ((uint64_t)field[2] << 40) | ((uint64_t)field[3] << 32) |
         ((uint64_t)field[4] << 24) | ((uint64_t)field[5] << 16) |
         ((uint64_t)field[6] << 8) | (uint64_t)field[7];
}


x86 assembly (clang, -O0):
<dtls_uint64_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x7(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dtls_uint64_to_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 56
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 48
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 40
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 32
%25 = or i32 %19, %24
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 4
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = shl i32 %29, 24
%31 = or i32 %25, %30
%32 = load i8*, i8** %2
%33 = getelementptr inbounds i8, i8* %32, i64 5
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = shl i32 %35, 16
%37 = or i32 %31, %36
%38 = load i8*, i8** %2
%39 = getelementptr inbounds i8, i8* %38, i64 6
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = shl i32 %41, 8
%43 = or i32 %37, %42
%44 = load i8*, i8** %2
%45 = getelementptr inbounds i8, i8* %44, i64 7
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = or i32 %43, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @dtls_uint64_to_int(i8* nocapture readnone %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ rand16();
int /*<<< orphan*/ safe_asprintf(char **, char *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
char *_client_list_make_auth_token(const char ip[], const char mac[]) {
  char *token;
  safe_asprintf(&token, "%04hx%04hx", rand16(), rand16());
  return token;
}


x86 assembly (clang, -O0):
<_client_list_make_auth_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand16@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <rand16@plt>
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
lea    -0x18(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1040 <safe_asprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_client_list_make_auth_token>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <rand16@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand16@plt>
lea    0xec4(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <safe_asprintf@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%04hx%04hx\00"
define i8* @_client_list_make_auth_token(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i32 (...) @rand16()
%7 = call i32 (...) @rand16()
%8 = call i32 @safe_asprintf(i8** %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"%04hx%04hx\00"
define i8* @_client_list_make_auth_token(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = tail call i32 (...) @rand16()
%6 = tail call i32 (...) @rand16()
%7 = call i32 @safe_asprintf(i8** %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i8*, i8** %3
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
scalar_t__ tmx_alloc_func(int /*<<< orphan*/ *, scalar_t__);
char *tmx_strdup(const char *str) {
  char *res = (char *)tmx_alloc_func(NULL, strlen(str) + 1);
  strcpy(res, str);
  return res;
}


x86 assembly (clang, -O0):
<tmx_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
add    $0x1,%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1050 <tmx_alloc_func@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmx_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
xor    %edi,%edi
call   1050 <tmx_alloc_func@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @tmx_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @tmx_alloc_func(i32* null, i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @tmx_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @tmx_alloc_func(i32* null, i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int strlen(char const *);
char *pchar_copy(const char *s) {
  int slen = strlen(s);
  char *newstr = (char *)malloc(slen + 1);
  memset(newstr, 0, slen + 1);
  memcpy(newstr, s, slen);
  return newstr;
}


x86 assembly (clang, -O0):
<pchar_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pchar_copy>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @pchar_copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
%14 = call i32 @memset(i8* %11, i32 0, i32 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = call i32 @memcpy(i8* %15, i8* %16, i32 %17)
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @pchar_copy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memset(i8* %5, i32 0, i32 %3)
%7 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ callee1(int, char *, double);
int /*<<< orphan*/ printf(char *);
int main() {
  callee1(2, "A string argument.", 3.5);
  callee1(2, "A string argument.", 3.5);
  printf("Hello, World!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
lea    0xecd(%rip),%rsi
movsd  0xebd(%rip),%xmm0
call   1030 <callee1@plt>
mov    $0x2,%edi
lea    0xeb4(%rip),%rsi
movsd  0xea4(%rip),%xmm0
call   1030 <callee1@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee0(%rip),%rbx
movsd  0xed0(%rip),%xmm0
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <callee1@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
movsd  0xeb3(%rip),%xmm0
call   1030 <callee1@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"A string argument.\00"
@.str.1 = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%3 = call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"A string argument.\00"
@.str.1 = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%2 = tail call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void wsayfollow(char *dafilename, long dafreq, long davol, long *daxplc,
                long *dayplc, char followstat) {}


x86 assembly (clang, -O0):
<wsayfollow>:
push   %rbp
mov    %rsp,%rbp
mov    %r9b,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %al,-0x29(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @wsayfollow(i8* %0, i64 %1, i64 %2, i64* %3, i64* %4, i8 signext %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64*
%11 = alloca i64*
%12 = alloca i8
store i8* %0, i8** %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64* %3, i64** %10
store i64* %4, i64** %11
store i8 %5, i8* %12
ret void
}

LLVM IR (-O2):
define void @wsayfollow(i8* nocapture %0, i64 %1, i64 %2, i64* nocapture %3, i64* nocapture %4, i8 signext %5) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int solve(int);
int main() {
  int p;
  scanf("%d", &p);
  printf("%d\n", solve(p));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <solve@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @solve(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @solve(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int M1(int n) { return (n % 2) ? (n + 1) / 2 : -(n + 1) / 2; }


x86 assembly (clang, -O0):
<M1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1131 <M1+0x31>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1146 <M1+0x46>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<M1>:
lea    0x1(%rdi),%ecx
test   $0x1,%dil
not    %edi
cmove  %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @M1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %8, 2
br label %15
10: ; preds = %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
%13 = sub nsw i32 0, %12
%14 = sdiv i32 %13, 2
br label %15
15: ; preds = %10, %6
%16 = phi i32 [ %9, %6 ], [ %14, %10 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @M1(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = add nsw i32 %0, 1
%5 = xor i32 %0, -1
%6 = select i1 %3, i32 %5, i32 %4
%7 = sdiv i32 %6, 2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void overflow() {
  puts("size overflow\n");
  exit(2);
}


x86 assembly (clang, -O0):
<overflow>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<overflow>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"size overflow\0A\00"
define void @overflow() {
%1 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"size overflow\0A\00"
define void @overflow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
void baz(int n) {
  for (int i = 0; i < n; i++) {
    foo();
    bar();
  }
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115a <baz+0x3a>
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <baz+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %rbx
test   %edi,%edi
jle    1143 <baz+0x23>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
call   1030 <bar@plt>
add    $0xffffffff,%ebx
jne    1130 <baz+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @baz(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @foo()
%7 = tail call i32 (...) @bar()
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %3, label %4
}