xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, int, int);
void do_bt() {
  int n = 10;
  void *buffer[n];
  backtrace((void **)&buffer, n);
  backtrace_symbols_fd(buffer, n, 2);
}


x86 assembly (clang, -O0):
<do_bt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
call   1040 <backtrace@plt>
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_bt>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @do_bt() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 10, i32* %1
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i8*, i64 %5
store i64 %5, i64* %3
%8 = load i32, i32* %1
%9 = call i32 @backtrace(i8** %7, i32 %8)
%10 = load i32, i32* %1
%11 = call i32 @backtrace_symbols_fd(i8** %7, i32 %10, i32 2)
%12 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @do_bt() {
%1 = alloca [10 x i8*]
%2 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%3 = call i32 @backtrace(i8** %2, i32 10)
%4 = call i32 @backtrace_symbols_fd(i8** %2, i32 10, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ExtAccumulator(int);
void XOR(void) { ExtAccumulator(5); }


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

x86 assembly (clang, -O2):
<XOR>:
mov    $0x5,%edi
jmp    1030 <ExtAccumulator@plt>

LLVM IR (-O0):
define void @XOR() {
%1 = call i32 @ExtAccumulator(i32 5)
ret void
}

LLVM IR (-O2):
define void @XOR() {
%1 = tail call i32 @ExtAccumulator(i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void version(void) {
  fprintf(stderr, "ewfcat version: 20060410\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"ewfcat version: 20060410\0A\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"ewfcat version: 20060410\0A\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ KVM_CREATE_VCPU;
int ioctl(int, int /*<<< orphan*/, int);
int kvm_create_vcpu(int fd, int vcpu_id) {
  return ioctl(fd, KVM_CREATE_VCPU, vcpu_id);
}


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

x86 assembly (clang, -O2):
<kvm_create_vcpu>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@KVM_CREATE_VCPU = global i32 0
define i32 @kvm_create_vcpu(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* @KVM_CREATE_VCPU
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@KVM_CREATE_VCPU = global i32 0
define i32 @kvm_create_vcpu(i32 %0, i32 %1) {
%3 = load i32, i32* @KVM_CREATE_VCPU
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
float getFontWidth() { return 10.0f; }


x86 assembly (clang, -O0):
<getFontWidth>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFontWidth>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @getFontWidth() {
ret float 1.000000e+01
}

LLVM IR (-O2):
define float @getFontWidth() {
ret float 1.000000e+01
}
/* Variables and functions */
char EOF;
int /*<<< orphan*/ binary(char);
char getchar();
int main() {
  char z;
  z = getchar();
  while (z != EOF) {
    if (z != '\n')
      binary(z);
    z = getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    0x2ea4(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1174 <main+0x54>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1165 <main+0x45>
movsbl -0x5(%rbp),%edi
call   1030 <binary@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
jmp    1147 <main+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
je     1159 <main+0x39>
cmp    $0xa,%al
je     1140 <main+0x20>
movsbl %al,%edi
call   1030 <binary@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %2
br label %4
4: ; preds = %17, %0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %19
10: ; preds = %4
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 10
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i8, i8* %2
%16 = call i32 @binary(i8 signext %15)
br label %17
17: ; preds = %14, %10
%18 = call signext i8 (...) @getchar()
store i8 %18, i8* %2
br label %4
19: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %9
%5 = phi i8 [ %10, %9 ], [ %1, %0 ]
%6 = icmp eq i8 %5, 10
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @binary(i8 signext %5)
br label %9
9: ; preds = %7, %4
%10 = tail call signext i8 (...) @getchar()
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %9, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerP__0__Timer__clear();
void Msp430Adc12ImplP__TimerA__clear(void) { Msp430TimerP__0__Timer__clear(); }


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__TimerA__clear() {
%1 = tail call i32 (...) @Msp430TimerP__0__Timer__clear()
ret void
}
void av_tempfile() {}


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

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

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

LLVM IR (-O2):
define void @av_tempfile() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GroundPathFollowerSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void GroundPathFollowerSettingsRequestUpdate() {
  UAVObjRequestUpdate(GroundPathFollowerSettingsHandle());
}


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

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

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

LLVM IR (-O2):
define void @GroundPathFollowerSettingsRequestUpdate() {
%1 = tail call i32 (...) @GroundPathFollowerSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ charatatime(char *);
scalar_t__ fork();
int main() {
  pid_t pid;
  if ((pid = fork()) < 0) {
  } else if (pid == 0) {
    charatatime("output from child\n");
  } else {
    charatatime("output from parent\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jge    1149 <main+0x29>
jmp    1176 <main+0x56>
cmpq   $0x0,-0x10(%rbp)
jne    1165 <main+0x45>
lea    0xea5(%rip),%rdi
call   1030 <charatatime@plt>
jmp    1171 <main+0x51>
lea    0xea7(%rip),%rdi
call   1030 <charatatime@plt>
jmp    1176 <main+0x56>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
js     1144 <main+0x24>
lea    0xecc(%rip),%rax
lea    0xed8(%rip),%rdi
cmove  %rax,%rdi
call   1030 <charatatime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"output from child\0A\00"
@.str.1 = [20 x i8] c"output from parent\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
br label %14
6: ; preds = %0
%7 = load i64, i64* %2
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @charatatime(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %6
%12 = call i32 @charatatime(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
br label %14
14: ; preds = %13, %5
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"output from child\0A\00"
@.str.1 = [20 x i8] c"output from parent\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = icmp eq i64 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @charatatime(i8* %5)
br label %7
7: ; preds = %3, %0
ret i32 0
}
short int shortint_ignoring_signedshortint(short int x, signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<shortint_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @shortint_ignoring_signedshortint(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @shortint_ignoring_signedshortint(i16 returned signext %0, i16 signext %1) {
ret i16 %0
}
void f(int i, int L, int a[20]) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f(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
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32 %1, i32* nocapture %2) {
ret void
}
int isgraph(int c) { return c > 32 && c < 127; }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <isgraph+0x20>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
void ARGBQuantize() {}


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

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

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

LLVM IR (-O2):
define void @ARGBQuantize() {
ret void
}
void PyDTrace_INSTANCE_DELETE_DONE(int arg0) {}


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

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

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

LLVM IR (-O2):
define void @PyDTrace_INSTANCE_DELETE_DONE(i32 %0) {
ret void
}
int mdiv(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<mdiv>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @mdiv(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mdiv(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int getdefaultgateway6(struct in6_addr *addr) { return (-1); }


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

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

LLVM IR (-O0):
%struct.in6_addr = type opaque
define i32 @getdefaultgateway6(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
store %struct.in6_addr* %0, %struct.in6_addr** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.in6_addr = type opaque
define i32 @getdefaultgateway6(%struct.in6_addr* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t is_eax_inuse(uint32_t bitmap) { return (bitmap & (0x1 << 0)); }


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

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

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

LLVM IR (-O2):
define i32 @is_eax_inuse(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
int writeUDPPacket(char *buf, int nbuf) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @writeUDPPacket(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
void g_utf8_to_ucs4() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @keyboard_clear() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef int clock_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
clock_t clock() {
  struct timeval t;
  gettimeofday(&t, 0);
  return t.tv_sec * 1000 + (t.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @clock() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
void plugin_exit_sample(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_sample() {
ret void
}
unsigned int nlz_int(unsigned int x) {
  if (x == 0)
    return 4 * 8;
  return (unsigned int)__builtin_clz(x);
}


x86 assembly (clang, -O0):
<nlz_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <nlz_int+0x1d>
movl   $0x20,-0x4(%rbp)
jmp    1129 <nlz_int+0x29>
mov    -0x8(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlz_int>:
test   %edi,%edi
je     110b <nlz_int+0xb>
bsr    %edi,%eax
xor    $0x1f,%eax
ret
mov    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @nlz_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @llvm.ctlz.i32(i32 %8, i1 true)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @nlz_int(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 false)
ret i32 %2
}
/* Variables and functions */
int clearBitsFromMsb(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, i;
  printf("Enter n and i : ");
  scanf("%d %d", &n, &i);
  n = clearBitsFromMsb(n, i);
  printf("\nResult : %d", n);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"Enter n and i : \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [13 x i8] c"\0AResult : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @clearBitsFromMsb(i32 %7, i32 %8)
store i32 %9, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
void jiffies_to_msecs(void) { nsc_assert(0, __func__); }


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

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

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

LLVM IR (-O2):
@__func__.jiffies_to_msecs = [17 x i8] c"jiffies_to_msecs\00"
define void @jiffies_to_msecs() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.jiffies_to_msecs, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_unichar(char *, char **, int);
int ustrlen(char *c) {
  int i;
  for (i = 0;; i++)
    if (!get_unichar(c, &c, 1))
      return i;
}


x86 assembly (clang, -O0):
<ustrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <get_unichar@plt>
cmp    $0x0,%eax
jne    1147 <ustrlen+0x37>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    114c <ustrlen+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ustrlen+0x13>

x86 assembly (clang, -O2):
<ustrlen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <get_unichar@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     1148 <ustrlen+0x38>
mov    %rsp,%r14
xchg   %ax,%ax
add    $0x1,%ebx
mov    (%rsp),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <get_unichar@plt>
test   %eax,%eax
jne    1130 <ustrlen+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ustrlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @get_unichar(i8* %0, i8** %2, i32 1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %7, %5 ], [ 0, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = load i8*, i8** %2
%9 = call i32 @get_unichar(i8* %8, i8** %2, i32 1)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %7, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int);
unsigned char RdStatus(int);
void OisEnaDrNcl(void) {
  unsigned char UcStRd = 1;
  RamWrite32A(0xF012, 0x00000004 | 0x00000002 | 0x00000001);
  while (UcStRd) {
    UcStRd = RdStatus(1);
  }
}


x86 assembly (clang, -O0):
<OisEnaDrNcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
mov    $0xf012,%edi
mov    $0x7,%esi
call   1030 <RamWrite32A@plt>
cmpb   $0x0,-0x1(%rbp)
je     1157 <OisEnaDrNcl+0x37>
mov    $0x1,%edi
call   1040 <RdStatus@plt>
mov    %al,-0x1(%rbp)
jmp    113b <OisEnaDrNcl+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OisEnaDrNcl>:
push   %rax
mov    $0xf012,%edi
mov    $0x7,%esi
call   1030 <RamWrite32A@plt>
mov    $0x1,%edi
call   1040 <RdStatus@plt>
test   %al,%al
jne    1130 <OisEnaDrNcl+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @OisEnaDrNcl() {
%1 = tail call i32 @RamWrite32A(i32 61458, i32 7)
br label %2
2: ; preds = %0, %2
%3 = tail call zeroext i8 @RdStatus(i32 1)
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
int rand();
void gen_src_buf(void *p, size_t size) {
  uint8_t val;
  val = rand() % 256;
  memset(p, val, size);
}


x86 assembly (clang, -O0):
<gen_src_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_src_buf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @gen_src_buf(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 256
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = load i64, i64* %4
%11 = call i32 @memset(i8* %8, i32 %9, i64 %10)
ret void
}

LLVM IR (-O2):
define void @gen_src_buf(i8* %0, i64 %1) {
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 256
%5 = tail call i32 @memset(i8* %0, i32 %4, i64 %1)
ret void
}
int test_imm_22int16_reg(short val) {
  return ((val) & (0x22 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_22int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x22,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_22int16_reg>:
test   $0x22,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_22int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 34
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_22int16_reg(i16 signext %0) {
%2 = and i16 %0, 34
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int pid = getpid();
  printf("the process ID is %d\n", pid);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"the process ID is %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
__attribute__((unused)) int UTIL_prepareFileList(const char *dirName,
                                                 char **bufStart, size_t *pos,
                                                 char **bufEnd) {
  (void)bufStart;
  (void)bufEnd;
  (void)pos;
  fprintf(stderr,
          "Directory %s ignored (zstd compiled without _WIN32 or "
          "_POSIX_C_SOURCE)\n",
          dirName);
  return 0;
}


x86 assembly (clang, -O0):
<UTIL_prepareFileList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTIL_prepareFileList>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [72 x i8] c"Directory %s ignored (zstd compiled without _WIN32 or _POSIX_C_SOURCE)\0A\00"
define i32 @UTIL_prepareFileList(i8* %0, i8** %1, i64* %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i64*
%8 = alloca i8**
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i64* %2, i64** %7
store i8** %3, i8*** %8
%9 = load i8**, i8*** %6
%10 = load i8**, i8*** %8
%11 = load i64*, i64** %7
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %5
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"Directory %s ignored (zstd compiled without _WIN32 or _POSIX_C_SOURCE)\0A\00"
define i32 @UTIL_prepareFileList(i8* %0, i8** nocapture readnone %1, i64* nocapture readnone %2, i8** nocapture readnone %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, unsigned int);
void KeccakP200_OverwriteBytes(void *state, const unsigned char *data,
                               unsigned int offset, unsigned int length) {
  memcpy((unsigned char *)state + offset, data, length);
}


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

x86 assembly (clang, -O2):
mov    %edx,%eax
add    %rax,%rdi
mov    %ecx,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @KeccakP200_OverwriteBytes(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @memcpy(i8* %6, i8* %1, i32 %3)
ret void
}
double zd64dl(double in) {
  double dout;
  dout = in;
  return dout;
}


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

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

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

LLVM IR (-O2):
define double @zd64dl(double returned %0) {
ret double %0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int close_output_file(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(192, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<close_output_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xc0,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_output_file>:
mov    $0xc0,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @close_output_file() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 192, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @close_output_file() {
%1 = tail call i32 @_ada_use_c2phc(i32 192, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ debugf(char *, int);
__attribute__((noreturn)) void die(int code) {
  debugf("executor: die with code %d", code);
  _exit(code);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <debugf@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1040 <debugf@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"executor: die with code %d\00"
define void @die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @debugf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @_exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"executor: die with code %d\00"
define void @die(i32 %0) {
%2 = tail call i32 @debugf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @_exit(i32 %0)
unreachable
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct clause_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_pop_back(struct genlist *);
void clause_list_pop_back(struct clause_list *tthis) {
  genlist_pop_back((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<clause_list_pop_back>:
jmp    1030 <genlist_pop_back@plt>

LLVM IR (-O0):
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define void @clause_list_pop_back(%struct.clause_list* %0) {
%2 = alloca %struct.clause_list*
store %struct.clause_list* %0, %struct.clause_list** %2
%3 = load %struct.clause_list*, %struct.clause_list** %2
%4 = bitcast %struct.clause_list* %3 to %struct.genlist*
%5 = call i32 @genlist_pop_back(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define void @clause_list_pop_back(%struct.clause_list* %0) {
%2 = bitcast %struct.clause_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_pop_back(%struct.genlist* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int librlc_crs_decode_cleanup(char *out_data) {
  free(out_data);
  return 0;
}


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

x86 assembly (clang, -O2):
<librlc_crs_decode_cleanup>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @librlc_crs_decode_cleanup(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
int axisNameToIndex(const char name) {
  switch (name) {
  case 'x':
    return 0;
    break;
  case 'y':
    return 1;
    break;
  case 'z':
    return 2;
    break;
  default:
    printf("Invalid axis %c", name);
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<axisNameToIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x78,%eax
je     1155 <axisNameToIndex+0x45>
jmp    1133 <axisNameToIndex+0x23>
mov    -0xc(%rbp),%eax
sub    $0x79,%eax
je     1161 <axisNameToIndex+0x51>
jmp    1144 <axisNameToIndex+0x34>
mov    -0xc(%rbp),%eax
sub    $0x7a,%eax
je     116d <axisNameToIndex+0x5d>
jmp    1179 <axisNameToIndex+0x69>
movl   $0x0,-0x4(%rbp)
jmp    1190 <axisNameToIndex+0x80>
movl   $0x1,-0x4(%rbp)
jmp    1190 <axisNameToIndex+0x80>
movl   $0x2,-0x4(%rbp)
jmp    1190 <axisNameToIndex+0x80>
lea    0xe80(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<axisNameToIndex>:
lea    -0x78(%rdi),%eax
cmp    $0x3,%eax
jb     1132 <axisNameToIndex+0x22>
push   %rax
movsbl %dil,%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Invalid axis %c\00"
define i32 @axisNameToIndex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 120, label %6
i32 121, label %7
i32 122, label %8
]
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
store i32 1, i32* %2
br label %13
8: ; preds = %1
store i32 2, i32* %2
br label %13
9: ; preds = %1
%10 = load i8, i8* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 signext %10)
br label %12
12: ; preds = %9
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %8, %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"Invalid axis %c\00"
define i32 @axisNameToIndex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -120
%4 = icmp ult i32 %3, 3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ %3, %1 ]
ret i32 %8
}
/* Variables and functions */
int AMCBase64Encode(void const *, char *, unsigned long, long);
int AMCBase64Enc(const void *pIn, char *pOut, unsigned long inLen,
                 long useRfc822) {
  return AMCBase64Encode(pIn, pOut, inLen, useRfc822);
}


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

x86 assembly (clang, -O2):
<AMCBase64Enc>:
jmp    1030 <AMCBase64Encode@plt>

LLVM IR (-O0):
define i32 @AMCBase64Enc(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = call i32 @AMCBase64Encode(i8* %9, i8* %10, i64 %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @AMCBase64Enc(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = tail call i32 @AMCBase64Encode(i8* %0, i8* %1, i64 %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
int VIDDummyVdp2Reset(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @VIDDummyVdp2Reset() {
ret i32 0
}
void __stub2(void) { return; }


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

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

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

LLVM IR (-O2):
define void @__stub2() {
ret void
}
int g() { return 3; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 3
}

LLVM IR (-O2):
define i32 @g() {
ret i32 3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void stl_le_p(void *ptr, int v) {
  uint8_t *p = ptr;
  p[0] = v;
  p[1] = v >> 8;
  p[2] = v >> 16;
  p[3] = v >> 24;
}


x86 assembly (clang, -O0):
<stl_le_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stl_le_p>:
mov    %esi,(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x8(%rdi)
sar    $0x18,%esi
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @stl_le_p(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 i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 16
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32 %16, i32* %18
%19 = load i32, i32* %4
%20 = ashr i32 %19, 24
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 3
store i32 %20, i32* %22
ret void
}

LLVM IR (-O2):
define void @stl_le_p(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
%4 = ashr i32 %1, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
%7 = ashr i32 %1, 16
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
%10 = ashr i32 %1, 24
%11 = getelementptr inbounds i8, i8* %0, i64 12
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
ret void
}
int encr_passwd(modeflag, pwbuf, size, zfn)
int modeflag;
char *pwbuf;
int size;
const char *zfn;
{
  modeflag = modeflag;
  pwbuf = pwbuf;
  size = size;
  zfn = zfn;
  return 5;
}


x86 assembly (clang, -O0):
<encr_passwd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x5,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @encr_passwd(i32 %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 5
}