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

/* Variables and functions */
unsigned long long time_diff(struct timeval *start, struct timeval *end) {
  return ((unsigned long long)(end->tv_sec - start->tv_sec)) * 1000000 +
         end->tv_usec - start->tv_usec;
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
imul   $0xf4240,%rax,%rax
mov    -0x10(%rbp),%rcx
add    (%rcx),%rax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
mov    0x8(%rsi),%rax
sub    0x8(%rdi),%rax
imul   $0xf4240,%rax,%rax
add    (%rsi),%rax
sub    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @time_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%7 = load i64, i64* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = mul i64 %11, 1000000
%13 = load %struct.timeval*, %struct.timeval** %4
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = add i64 %12, %15
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 0
%19 = load i64, i64* %18
%20 = sub i64 %16, %19
ret i64 %20
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @time_diff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = mul i64 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = add i64 %8, %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
ret i64 %14
}
char *module_description() {
  return "A test kernel module which uses the kernel heap allocator";
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"A test kernel module which uses the kernel heap allocator\00"
define i8* @module_description() {
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [58 x i8] c"A test kernel module which uses the kernel heap allocator\00"
define i8* @module_description() {
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0)
}
dounsetenv(v) register char **v;
{
  v++;
  do
    unsetenvv(*v++);
  while (*v);
}


x86 assembly (clang, -O0):
<dounsetenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <unsetenvv@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1128 <dounsetenv+0x18>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dounsetenv>:
push   %rbx
mov    %rdi,%rbx
mov    0x8(%rdi),%rdi
add    $0x10,%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <unsetenvv@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <dounsetenv+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dounsetenv(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
br label %4
4: ; preds = %4, %1
%5 = phi i8* [ %3, %1 ], [ %9, %4 ]
%6 = phi i8** [ %2, %1 ], [ %7, %4 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unsetenvv to i32 (i8*, ...)*)(i8* %5)
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4
ret i32 undef
}
void joy_button(int b) {}


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

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

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

LLVM IR (-O2):
define void @joy_button(i32 %0) {
ret void
}
void ILibWebClient_TimerInterruptSink(void *object) {}


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

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

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

LLVM IR (-O2):
define void @ILibWebClient_TimerInterruptSink(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t border_get(volatile uint32_t reg) {
  uint32_t data = *(&reg);
  *(&reg);
  return data;
}


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

x86 assembly (clang, -O2):
<border_get>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
mov    -0x4(%rsp),%ecx
ret

LLVM IR (-O0):
define i32 @border_get(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store volatile i32 %0, i32* %2
%4 = load volatile i32, i32* %2
store i32 %4, i32* %3
%5 = load volatile i32, i32* %2
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @border_get(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = load volatile i32, i32* %2
ret i32 %3
}
int double_ref(int x) { return x * 2; }


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

x86 assembly (clang, -O2):
<double_ref>:
lea    (%rdi,%rdi,1),%eax
ret

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

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

/* Variables and functions */
int sigismember(int /*<<< orphan*/ const *, int);
int /*<<< orphan*/ unix_error(char *);
int Sigismember(const sigset_t *set, int signum) {
  int rc;
  if ((rc = sigismember(set, signum)) < 0)
    unix_error("Sigismember error");
  return rc;
}


x86 assembly (clang, -O0):
<Sigismember>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sigismember@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    1153 <Sigismember+0x33>
lea    0xeb2(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sigismember>:
push   %rbx
call   1040 <sigismember@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Sigismember+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Sigismember error\00"
define i32 @Sigismember(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
%7 = load i32, i32* %4
%8 = call i32 @sigismember(i32* %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @unix_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [18 x i8] c"Sigismember error\00"
define i32 @Sigismember(i32* %0, i32 %1) {
%3 = tail call i32 @sigismember(i32* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int emac1_etherstatspkts128to255octets_set(
    unsigned int dev_id, union emac1_etherstatspkts128to255octets_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac1_etherstatspkts128to255octets_u = type opaque
define i32 @emac1_etherstatspkts128to255octets_set(i32 %0, %union.emac1_etherstatspkts128to255octets_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_etherstatspkts128to255octets_u*
store i32 %0, i32* %3
store %union.emac1_etherstatspkts128to255octets_u* %1, %union.emac1_etherstatspkts128to255octets_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_etherstatspkts128to255octets_u = type opaque
define i32 @emac1_etherstatspkts128to255octets_set(i32 %0, %union.emac1_etherstatspkts128to255octets_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_device_restore_test() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_device_restore_test"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"NOT IMPLEMENTED:pa_ext_device_restore_test\0A\00"
define i32 @pa_ext_device_restore_test() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_ext_device_restore_test\00"
define i32 @pa_ext_device_restore_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int compute_quantization(int quantizations) {
  int temp = 1;
  if (quantizations & 0x01)
    temp *= 2;
  if (quantizations & 0x02)
    temp *= 4;
  if (quantizations & 0x04)
    temp *= 8;
  if (quantizations & 0x08)
    temp *= 16;
  return temp;
}


x86 assembly (clang, -O0):
<compute_quantization>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1126 <compute_quantization+0x26>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     113e <compute_quantization+0x3e>
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1156 <compute_quantization+0x56>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     116e <compute_quantization+0x6e>
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_quantization>:
mov    %edi,%eax
and    $0x1,%eax
lea    0x1(%rax),%ecx
test   $0x2,%dil
lea    0x4(,%rax,4),%eax
cmove  %ecx,%eax
lea    0x0(,%rax,8),%ecx
test   $0x4,%dil
cmove  %eax,%ecx
mov    %ecx,%eax
shl    $0x4,%eax
test   $0x8,%dil
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compute_quantization(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 2
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
%12 = and i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, 4
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* %2
%19 = and i32 %18, 4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %3
%23 = mul nsw i32 %22, 8
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %17
%25 = load i32, i32* %2
%26 = and i32 %25, 8
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i32, i32* %3
%30 = mul nsw i32 %29, 16
store i32 %30, i32* %3
br label %31
31: ; preds = %28, %24
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @compute_quantization(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 1, i32 2
%5 = and i32 %0, 2
%6 = icmp eq i32 %5, 0
%7 = shl nuw nsw i32 %4, 2
%8 = select i1 %6, i32 %4, i32 %7
%9 = and i32 %0, 4
%10 = icmp eq i32 %9, 0
%11 = shl nuw nsw i32 %8, 3
%12 = select i1 %10, i32 %8, i32 %11
%13 = and i32 %0, 8
%14 = icmp eq i32 %13, 0
%15 = shl nuw nsw i32 %12, 4
%16 = select i1 %14, i32 %12, i32 %15
ret i32 %16
}
/* Variables and functions */
int detectPresence(char *);
int whiptailPresentOnly(void) {
  static int lWhiptailPresent = -1;
  if (lWhiptailPresent < 0) {
    lWhiptailPresent = detectPresence("whiptail");
  }
  return lWhiptailPresent;
}


x86 assembly (clang, -O0):
<whiptailPresentOnly>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
jge    1133 <whiptailPresentOnly+0x23>
lea    0xed8(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef5(%rip)
mov    0x2eef(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<whiptailPresentOnly>:
push   %rax
mov    0x2f11(%rip),%eax
test   %eax,%eax
js     111d <whiptailPresentOnly+0xd>
pop    %rcx
ret
lea    0xedc(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef9(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@whiptailPresentOnly.lWhiptailPresent = internal global i32 -1
@.str = [9 x i8] c"whiptail\00"
define i32 @whiptailPresentOnly() {
%1 = load i32, i32* @whiptailPresentOnly.lWhiptailPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @whiptailPresentOnly.lWhiptailPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @whiptailPresentOnly.lWhiptailPresent
ret i32 %6
}

LLVM IR (-O2):
@whiptailPresentOnly.lWhiptailPresent = internal unnamed_addr global i32 -1
@.str = [9 x i8] c"whiptail\00"
define i32 @whiptailPresentOnly() {
%1 = load i32, i32* @whiptailPresentOnly.lWhiptailPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @whiptailPresentOnly.lWhiptailPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ PTRACE_SETREGS;
int errno;
scalar_t__ ptrace(int /*<<< orphan*/, long, int /*<<< orphan*/,
                  unsigned long *);
int ptrace_setregs(long pid, unsigned long *regs) {
  if (ptrace(PTRACE_SETREGS, pid, 0, regs) < 0)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_setregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
jge    1155 <ptrace_setregs+0x45>
xor    %eax,%eax
mov    0x2e8d(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <ptrace_setregs+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_setregs>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <ptrace@plt>
mov    0x2ea8(%rip),%rcx
sub    (%rcx),%ebx
sar    $0x3f,%rax
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PTRACE_SETREGS = global i32 0
@errno = global i32 0
define i32 @ptrace_setregs(i64 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
%6 = load i32, i32* @PTRACE_SETREGS
%7 = load i64, i64* %4
%8 = load i64*, i64** %5
%9 = call i64 @ptrace(i32 %6, i64 %7, i32 0, i64* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@PTRACE_SETREGS = global i32 0
@errno = global i32 0
define i32 @ptrace_setregs(i64 %0, i64* %1) {
%3 = load i32, i32* @PTRACE_SETREGS
%4 = tail call i64 @ptrace(i32 %3, i64 %0, i32 0, i64* %1)
%5 = icmp slt i64 %4, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
/* Variables and functions */
int openexec_close(int);
int close(int fd) { return openexec_close(fd); }


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

x86 assembly (clang, -O2):
<close>:
jmp    1030 <openexec_close@plt>

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @openexec_close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int t[] = {1, 2, 3, 4, 5}, *p = t;
  *p++;
  (*p)++;
  *p++;
  printf("%d", p[-1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x4(%rax),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.t = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %3
%8 = load i32, i32* %6
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %3
%14 = load i32, i32* %12
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 -1
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
int col_byte_big5(int col) { return (col >= 0x3f ? 0x62 : 0x40) + col; }


x86 assembly (clang, -O0):
<col_byte_big5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x40,%eax
mov    $0x62,%ecx
cmp    $0x3f,%edx
cmovge %ecx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<col_byte_big5>:
lea    0x40(%rdi),%ecx
lea    0x62(%rdi),%eax
cmp    $0x3f,%edi
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @col_byte_big5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 63
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 98, i32 64
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @col_byte_big5(i32 %0) {
%2 = icmp sgt i32 %0, 62
%3 = select i1 %2, i32 98, i32 64
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *bwrite(void *memory, const void *ptr, size_t size, size_t nmemb) {
  size_t total_size = size * nmemb;
  memcpy(memory, ptr, total_size);
  return (void *)(((char *)memory) + total_size);
}


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

x86 assembly (clang, -O2):
<bwrite>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
imul   %rcx,%rbx
mov    %rbx,%rdx
call   1030 <memcpy@plt>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @bwrite(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %7
%11 = load i64, i64* %8
%12 = mul i64 %10, %11
store i64 %12, i64* %9
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i64, i64* %9
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %5
%18 = load i64, i64* %9
%19 = getelementptr inbounds i8, i8* %17, i64 %18
ret i8* %19
}

LLVM IR (-O2):
define i8* @bwrite(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = mul i64 %3, %2
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %5)
%7 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %7
}
/* Variables and functions */
int ap_cmd_set_int(int, int, int);
int ap_set_position_relative(int session, int pos) {
  return (ap_cmd_set_int(session, 0xcc1e, pos));
}


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

x86 assembly (clang, -O2):
<ap_set_position_relative>:
mov    %esi,%edx
mov    $0xcc1e,%esi
jmp    1030 <ap_cmd_set_int@plt>

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

LLVM IR (-O2):
define i32 @ap_set_position_relative(i32 %0, i32 %1) {
%3 = tail call i32 @ap_cmd_set_int(i32 %0, i32 52254, i32 %1)
ret i32 %3
}
void after_mc_barrier(void) {}


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

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

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

LLVM IR (-O2):
define void @after_mc_barrier() {
ret void
}
int NET_terminate(int sockdes) { return sockdes - sockdes; }


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

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

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

LLVM IR (-O2):
define i32 @NET_terminate(i32 %0) {
ret i32 0
}
/* Variables and functions */
char *newDbSerializeDevsDev(int /*<<< orphan*/, int /*<<< orphan*/, int,
                            char *);
char *newDbSerializeDevs(int MAXBUF, char *buf) {
  return newDbSerializeDevsDev(0, 0, MAXBUF, buf);
}


x86 assembly (clang, -O0):
<newDbSerializeDevs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <newDbSerializeDevsDev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newDbSerializeDevs>:
mov    %rsi,%rcx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <newDbSerializeDevsDev@plt>

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

LLVM IR (-O2):
define i8* @newDbSerializeDevs(i32 %0, i8* %1) {
%3 = tail call i8* @newDbSerializeDevsDev(i32 0, i32 0, i32 %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_thread_yield() {
  printf("NOT IMPLEMENTED:"
         "pa_thread_yield"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_thread_yield\0A\00"
define i32 @pa_thread_yield() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_thread_yield\00"
define i32 @pa_thread_yield() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ putc(unsigned short, int /*<<< orphan*/ *);
int WRITESHORT(FILE *fp, unsigned short s) {
  putc(s, fp);
  return putc(s >> 8, fp) != EOF;
}


x86 assembly (clang, -O0):
<WRITESHORT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
mov    -0x8(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    -0x8(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WRITESHORT>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
shr    $0x8,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    0x2eb1(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @WRITESHORT(i32* %0, i16 zeroext %1) {
%3 = alloca i32*
%4 = alloca i16
store i32* %0, i32** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i32*, i32** %3
%7 = call i64 @putc(i16 zeroext %5, i32* %6)
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i16
%12 = load i32*, i32** %3
%13 = call i64 @putc(i16 zeroext %11, i32* %12)
%14 = load i64, i64* @EOF
%15 = icmp ne i64 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @WRITESHORT(i32* nocapture %0, i16 zeroext %1) {
%3 = tail call i64 @putc(i16 zeroext %1, i32* %0)
%4 = lshr i16 %1, 8
%5 = tail call i64 @putc(i16 zeroext %4, i32* %0)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int operation_hi(int arg) { return arg >> 8; }


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

x86 assembly (clang, -O2):
<operation_hi>:
mov    %edi,%eax
sar    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @operation_hi(i32 %0) {
%2 = ashr i32 %0, 8
ret i32 %2
}
int ld_ble_cr1(long double a1) { return (__builtin_islessequal(100, a1)); }


x86 assembly (clang, -O0):
<ld_ble_cr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ble_cr1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_ble_cr1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp ole x86_fp80 0xK4005C800000000000000, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_ble_cr1(x86_fp80 %0) {
%2 = fcmp oge x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void set_flag(uint32_t *flags, uint32_t flag, int b) {
  *flags = b ? (*flags | flag) : (*flags & ~flag);
}


x86 assembly (clang, -O0):
<set_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1129 <set_flag+0x29>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    113a <set_flag+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_flag>:
mov    (%rdi),%eax
mov    %eax,%ecx
or     %esi,%ecx
not    %esi
and    %eax,%esi
test   %edx,%edx
cmovne %ecx,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @set_flag(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* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = load i32, i32* %5
%13 = or i32 %11, %12
br label %20
14: ; preds = %3
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i32, i32* %5
%18 = xor i32 %17, -1
%19 = and i32 %16, %18
br label %20
20: ; preds = %14, %9
%21 = phi i32 [ %13, %9 ], [ %19, %14 ]
%22 = load i32*, i32** %4
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @set_flag(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = load i32, i32* %0
%6 = or i32 %5, %1
%7 = xor i32 %1, -1
%8 = and i32 %5, %7
%9 = select i1 %4, i32 %8, i32 %6
store i32 %9, i32* %0
ret void
}
log_event(syslog_code, format, p1, p2, p3, p4, p5) int syslog_code;
char *format, *p1, *p2, *p3, *p4, *p5;
{}


x86 assembly (clang, -O0):
<log_event>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @log_event(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_volume_snprint_verbose() {
  printf("NOT IMPLEMENTED:"
         "pa_volume_snprint_verbose"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_volume_snprint_verbose\0A\00"
define i32 @pa_volume_snprint_verbose() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_volume_snprint_verbose\00"
define i32 @pa_volume_snprint_verbose() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ __builtin_significandl(long double);
int /*<<< orphan*/ link_failure_builtin_significandl();
void test_builtin_significandl(long double ld) {
  if (__builtin_significandl(ld) != __builtin_significandl(ld))
    link_failure_builtin_significandl();
}


x86 assembly (clang, -O0):
<test_builtin_significandl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <__builtin_significandl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <__builtin_significandl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_builtin_significandl+0x43>
mov    $0x0,%al
call   1030 <link_failure_builtin_significandl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_significandl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_significandl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_significandl@plt>
cmp    %rax,%rbx
jne    1151 <test_builtin_significandl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_significandl@plt>

LLVM IR (-O0):
define void @test_builtin_significandl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @__builtin_significandl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @__builtin_significandl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_significandl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_significandl(x86_fp80 %0) {
%2 = tail call i64 @__builtin_significandl(x86_fp80 %0)
%3 = tail call i64 @__builtin_significandl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_significandl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
char *ipt_sub_offset(char *ptr, ptrdiff_t offset) { return ptr - offset; }


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

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

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

LLVM IR (-O2):
define i8* @ipt_sub_offset(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = sub nsw i64 0, %3
%5 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %5
}
/* Type definitions */
struct rb_root {
  int dummy;
};
struct rb_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _right_rotate(struct rb_root *, struct rb_node *);
void right_rotate(struct rb_root *root, struct rb_node *node) {
  _right_rotate(root, node);
}


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

x86 assembly (clang, -O2):
<right_rotate>:
jmp    1030 <_right_rotate@plt>

LLVM IR (-O0):
%struct.rb_root = type { i32 }
%struct.rb_node = type { i32 }
define void @right_rotate(%struct.rb_root* %0, %struct.rb_node* %1) {
%3 = alloca %struct.rb_root*
%4 = alloca %struct.rb_node*
store %struct.rb_root* %0, %struct.rb_root** %3
store %struct.rb_node* %1, %struct.rb_node** %4
%5 = load %struct.rb_root*, %struct.rb_root** %3
%6 = load %struct.rb_node*, %struct.rb_node** %4
%7 = call i32 @_right_rotate(%struct.rb_root* %5, %struct.rb_node* %6)
ret void
}

LLVM IR (-O2):
%struct.rb_root = type { i32 }
%struct.rb_node = type { i32 }
define void @right_rotate(%struct.rb_root* %0, %struct.rb_node* %1) {
%3 = tail call i32 @_right_rotate(%struct.rb_root* %0, %struct.rb_node* %1)
ret void
}
void rop3_176_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D | stk3;
  stk1 = T & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_176_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_176_0_0>:
not    %sil
or     (%rdi),%sil
and    %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_176_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_176_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = and i8 %6, %2
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_tainted_string_sanitize_content__(char const *);
int g_action_name_is_valid(const char *action_name) {
  int is_ok;
  if (is_ok) {
    __coverity_tainted_string_sanitize_content__(action_name);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<g_action_name_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     113b <g_action_name_is_valid+0x2b>
mov    -0x10(%rbp),%rdi
call   1030 <__coverity_tainted_string_sanitize_content__@plt>
movl   $0x1,-0x4(%rbp)
jmp    1142 <g_action_name_is_valid+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_action_name_is_valid(i8* nocapture readnone %0) {
ret i32 0
}
void mdp4_dsi_video_wait4vsync(int cndx, long long *vtime) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_dsi_video_wait4vsync(i32 %0, i64* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Open Source SW Project\n");
  printf("First github trainning\n");
  printf("hello world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%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
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Open Source SW Project\0A\00"
@.str.1 = [24 x i8] c"First github trainning\0A\00"
@.str.2 = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Open Source SW Project\00"
@str.3 = [23 x i8] c"First github trainning\00"
@str.4 = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int open(char const *, int, int);
int open_utf8(const char *path, int flags, int mode) {
  return (open(path, flags, mode));
}


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

x86 assembly (clang, -O2):
<open_utf8>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @open_utf8(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void do_child_badness(char *p) { free(p); }


x86 assembly (clang, -O0):
<do_child_badness>:
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):
<do_child_badness>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @do_child_badness(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 @do_child_badness(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int main(void) { return 2 || 4; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
int __ltint(int a, int b) { return a < b; }


x86 assembly (clang, -O0):
<__ltint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltint>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @__ltint(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void __CUT_BRINGUP__SampleTest(void) {}


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

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

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

LLVM IR (-O2):
define void @__CUT_BRINGUP__SampleTest() {
ret void
}