xunge/DecIR huggingface dataset:
int param_get_charp(char *buffer, struct kernel_param *kp) { return 0; }


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

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

LLVM IR (-O0):
%struct.kernel_param = type opaque
define i32 @param_get_charp(i8* %0, %struct.kernel_param* %1) {
%3 = alloca i8*
%4 = alloca %struct.kernel_param*
store i8* %0, i8** %3
store %struct.kernel_param* %1, %struct.kernel_param** %4
ret i32 0
}

LLVM IR (-O2):
%struct.kernel_param = type opaque
define i32 @param_get_charp(i8* nocapture readnone %0, %struct.kernel_param* nocapture readnone %1) {
ret i32 0
}
void ARGBShuffleRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBShuffleRow_SSSE3() {
ret void
}
int PlatformGetCharacter() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PlatformGetCharacter() {
ret i32 0
}
void foo194() {}


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

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

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

LLVM IR (-O2):
define void @foo194() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("cl_version.h standalone test PASSED.\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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"cl_version.h standalone test PASSED.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"cl_version.h standalone test PASSED.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct sock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sock_close(struct sock *);
void sock_exit(void *arg) {
  struct sock *f = (struct sock *)arg;
  sock_close(f);
}


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

x86 assembly (clang, -O2):
<sock_exit>:
jmp    1030 <sock_close@plt>

LLVM IR (-O0):
%struct.sock = type { i32 }
define void @sock_exit(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.sock*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.sock*
store %struct.sock* %5, %struct.sock** %3
%6 = load %struct.sock*, %struct.sock** %3
%7 = call i32 @sock_close(%struct.sock* %6)
ret void
}

LLVM IR (-O2):
%struct.sock = type { i32 }
define void @sock_exit(i8* %0) {
%2 = bitcast i8* %0 to %struct.sock*
%3 = tail call i32 @sock_close(%struct.sock* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ write_array(char *, char *);
int main(int argc, char **argv) {
  if (argc < 3) {
    printf("usage: jpg2hdr outfile.hdr infile.jpg\n");
  }
  write_array(argv[1], argv[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114c <main+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <write_array@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     1135 <main+0x15>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1040 <write_array@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"usage: jpg2hdr outfile.hdr infile.jpg\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @write_array(i8* %13, i8* %16)
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@str = [38 x i8] c"usage: jpg2hdr outfile.hdr infile.jpg\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @write_array(i8* %8, i8* %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void int_handler2(int signo) { printf("child caught %d\n", signo); }


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

x86 assembly (clang, -O2):
<int_handler2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"child caught %d\0A\00"
define void @int_handler2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"child caught %d\0A\00"
define void @int_handler2(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long, long);
void CheckColLength(long col, long n_nz) {
  extern long *nz;
  if (n_nz != nz[col])
    printf("Col %ld: %ld vs %ld\n", col, n_nz, nz[col]);
}


x86 assembly (clang, -O0):
<CheckColLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%rcx
mov    -0x8(%rbp),%rdx
cmp    (%rcx,%rdx,8),%rax
je     1162 <CheckColLength+0x52>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2e95(%rip),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckColLength>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%rax
mov    (%rax,%rdi,8),%rcx
cmp    %rsi,%rcx
jne    1127 <CheckColLength+0x17>
ret
mov    %rdi,%rsi
lea    0xecf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@nz = external global i64*
@.str = [21 x i8] c"Col %ld: %ld vs %ld\0A\00"
define void @CheckColLength(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64*, i64** @nz
%7 = load i64, i64* %3
%8 = getelementptr inbounds i64, i64* %6, i64 %7
%9 = load i64, i64* %8
%10 = icmp ne i64 %5, %9
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = load i64*, i64** @nz
%15 = load i64, i64* %3
%16 = getelementptr inbounds i64, i64* %14, i64 %15
%17 = load i64, i64* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13, i64 %17)
br label %19
19: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@nz = external global i64*
@.str = [21 x i8] c"Col %ld: %ld vs %ld\0A\00"
define void @CheckColLength(i64 %0, i64 %1) {
%3 = load i64*, i64** @nz
%4 = getelementptr inbounds i64, i64* %3, i64 %0
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, %1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i64 %5)
br label %9
9: ; preds = %7, %2
ret void
}
int test_imm_BFint8_mem(signed char *val) {
  return ((*val) & (-0xBF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BFint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff41,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BFint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff41,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BFint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -191
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
int __log2(int a) {
  int i;
  for (i = 1; a > 1; i++, a = a >> 1)
    ;
  return i - 1;
}


x86 assembly (clang, -O0):
<__log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1134 <__log2+0x34>
jmp    111d <__log2+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <__log2+0xe>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__log2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <__log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <__log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @__log2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %4, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Delay1KTCYx(int);
void Delay_5500us(void) { Delay1KTCYx(28); }


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

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

LLVM IR (-O0):
define void @Delay_5500us() {
%1 = call i32 @Delay1KTCYx(i32 28)
ret void
}

LLVM IR (-O2):
define void @Delay_5500us() {
%1 = tail call i32 @Delay1KTCYx(i32 28)
ret void
}
/* Variables and functions */
int optind;
int octave_optind_wrapper(void) { return optind; }


x86 assembly (clang, -O0):
<octave_optind_wrapper>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_optind_wrapper>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@optind = global i32 0
define i32 @octave_optind_wrapper() {
%1 = load i32, i32* @optind
ret i32 %1
}

LLVM IR (-O2):
@optind = global i32 0
define i32 @octave_optind_wrapper() {
%1 = load i32, i32* @optind
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ cctools_debug(long long, char *);
int auth_globus_register(void) {
  cctools_debug((1LL << 12), "globus: not compiled in");
  return 0;
}


x86 assembly (clang, -O0):
<auth_globus_register>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1000,%edi
lea    0xee0(%rip),%rsi
call   1030 <cctools_debug@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<auth_globus_register>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1000,%edi
call   1030 <cctools_debug@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"globus: not compiled in\00"
define i32 @auth_globus_register() {
%1 = call i32 @cctools_debug(i64 4096, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"globus: not compiled in\00"
define i32 @auth_globus_register() {
%1 = tail call i32 @cctools_debug(i64 4096, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t readl(void *addr) {
  asm volatile("" : : : "memory");
  return *(volatile uint32_t *)addr;
}


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

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

LLVM IR (-O0):
define i8* @readl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load volatile i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @readl(i8* %0) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%2 = bitcast i8* %0 to i8**
%3 = load volatile i8*, i8** %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ supplicantRestoreDefaults(void *);
void supplicantFuncInit(void *priv) { supplicantRestoreDefaults(priv); }


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

x86 assembly (clang, -O2):
<supplicantFuncInit>:
jmp    1030 <supplicantRestoreDefaults@plt>

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

LLVM IR (-O2):
define void @supplicantFuncInit(i8* %0) {
%2 = tail call i32 @supplicantRestoreDefaults(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ loff_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, int /*<<< orphan*/ *, int,
                           int /*<<< orphan*/ *, size_t, unsigned int);
ssize_t copy_file_range(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out,
                        size_t len, unsigned int flags) {
  return syscall(326, fd_in, off_in, fd_out, off_out, len, flags);
}


x86 assembly (clang, -O0):
<copy_file_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
mov    $0x146,%edi
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_file_range>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    %r9d,(%rsp)
mov    $0x146,%edi
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @copy_file_range(i32 %0, i32* %1, i32 %2, i32* %3, i64 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i64
%12 = alloca i32
store i32 %0, i32* %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i64 %4, i64* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32*, i32** %8
%15 = load i32, i32* %9
%16 = load i32*, i32** %10
%17 = load i64, i64* %11
%18 = load i32, i32* %12
%19 = call i32 @syscall(i32 326, i32 %13, i32* %14, i32 %15, i32* %16, i64 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @copy_file_range(i32 %0, i32* %1, i32 %2, i32* %3, i64 %4, i32 %5) {
%7 = tail call i32 @syscall(i32 326, i32 %0, i32* %1, i32 %2, i32* %3, i64 %4, i32 %5)
ret i32 %7
}
void fc50(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
    a:
      goto a;
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc50>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc50+0x7>

x86 assembly (clang, -O2):
<fc50>:
jmp    1100 <fc50>

LLVM IR (-O0):
define void @fc50(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %1
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc50(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int strLength(char *string) {
  int i = 0;
  while (*string) {
    i++;
    string++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <strLength+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strLength>:
cmpb   $0x0,(%rdi)
je     111c <strLength+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strLength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strLength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ test_case();
int main() {
  int n;
  scanf("%d", &n);
  while (n-- > 0)
    test_case();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    115f <main+0x3f>
mov    $0x0,%al
call   1030 <test_case@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
test   %eax,%eax
jle    1158 <main+0x38>
xor    %eax,%eax
call   1030 <test_case@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 (...) @test_case()
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = icmp sgt i32 %9, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srli_epi16(int /*<<< orphan*/, int);
__m128i test_mm_srli_epi16_1(__m128i A) { return _mm_srli_epi16(A, -1); }


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

x86 assembly (clang, -O2):
<test_mm_srli_epi16_1>:
mov    $0xffffffff,%esi
jmp    1030 <_mm_srli_epi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srli_epi16_1(i32 %0) {
%2 = tail call i32 @_mm_srli_epi16(i32 %0, i32 -1)
ret i32 %2
}
unsigned gcd(unsigned a, unsigned b) {
  unsigned swap;
  while (b > 0) {
    swap = b;
    b = a % b;
    a = swap;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1130 <gcd+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111e <gcd+0x1e>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = urem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ lrand48();
double drand(double max) {
  double denom = (double)(2ul << 30) / max;
  double num = (double)lrand48();
  return (double)(num / denom);
}


x86 assembly (clang, -O0):
<drand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <lrand48@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand>:
push   %rax
movsd  0xee7(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <lrand48@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @drand(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fdiv double 0x41E0000000000000, %5
store double %6, double* %3
%7 = call i64 (...) @lrand48()
%8 = sitofp i64 %7 to double
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fdiv double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @drand(double %0) {
%2 = fdiv double 0x41E0000000000000, %0
%3 = tail call i64 (...) @lrand48()
%4 = sitofp i64 %3 to double
%5 = fdiv double %4, %2
ret double %5
}
int refclock_to_ubmr(int clock_hz) { return clock_hz / 1600 - 1; }


x86 assembly (clang, -O0):
<refclock_to_ubmr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x640,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<refclock_to_ubmr>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
sar    $0x29,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @refclock_to_ubmr(i32 %0) {
%2 = sdiv i32 %0, 1600
%3 = add nsw i32 %2, -1
ret i32 %3
}
/* Variables and functions */
char *strreplace(char *s, char old, char new) {
  for (; *s; ++s)
    if (*s == old)
      *s = new;
  return s;
}


x86 assembly (clang, -O0):
<strreplace>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <strreplace+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <strreplace+0x3c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1141 <strreplace+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strreplace+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strreplace>:
mov    %rdi,%rax
mov    (%rdi),%cl
jmp    1118 <strreplace+0x18>
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1125 <strreplace+0x25>
cmp    %sil,%cl
jne    1110 <strreplace+0x10>
mov    %dl,(%rax)
jmp    1110 <strreplace+0x10>
ret

LLVM IR (-O0):
define i8* @strreplace(i8* %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
br label %7
7: ; preds = %22, %3
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %14, %16
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = load i8, i8* %6
%20 = load i8*, i8** %4
store i8 %19, i8* %20
br label %21
21: ; preds = %18, %11
br label %22
22: ; preds = %21
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %7
25: ; preds = %7
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @strreplace(i8* %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
%16 = phi i8* [ %0, %3 ], [ %12, %11 ]
ret i8* %16
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ perror(char *);
int shmget(int /*<<< orphan*/, size_t, int);
int init_shm(key_t key, size_t size) {
  int shmid;
  shmid = shmget(key, size, IPC_CREAT | 0666);
  if (shmid == -1)
    perror("shmget()");
  return shmid;
}


x86 assembly (clang, -O0):
<init_shm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
or     $0x1b6,%edx
call   1040 <shmget@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1163 <init_shm+0x43>
lea    0xea2(%rip),%rdi
call   1030 <perror@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_shm>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    $0x1b6,%edx
or     (%rax),%edx
call   1040 <shmget@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     113f <init_shm+0x1f>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
jmp    113b <init_shm+0x1b>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@.str = [9 x i8] c"shmget()\00"
define i32 @init_shm(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = load i64, i64* %4
%8 = load i32, i32* @IPC_CREAT
%9 = or i32 %8, 438
%10 = call i32 @shmget(i32 %6, i64 %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@.str = [9 x i8] c"shmget()\00"
define i32 @init_shm(i32 %0, i64 %1) {
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 438
%5 = tail call i32 @shmget(i32 %0, i64 %1, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __NR_linkat;
scalar_t__ syscall(int /*<<< orphan*/, int, char const *, int, char const *,
                   int);
int xlinkat(int olddirfd, const char *oldpath, int newdirfd,
            const char *newpath, int flags) {
  int ret =
      (int)syscall(__NR_linkat, olddirfd, oldpath, newdirfd, newpath, flags);
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   1030 <syscall@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    115c <xlinkat+0x4c>
jmp    115c <xlinkat+0x4c>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlinkat>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_linkat = global i32 0
define i32 @xlinkat(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i32, i32* @__NR_linkat
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i8*, i8** %9
%17 = load i32, i32* %10
%18 = call i64 @syscall(i32 %12, i32 %13, i8* %14, i32 %15, i8* %16, i32 %17)
%19 = trunc i64 %18 to i32
store i32 %19, i32* %11
%20 = load i32, i32* %11
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %23
22: ; preds = %5
br label %23
23: ; preds = %22, %5
%24 = load i32, i32* %11
ret i32 %24
}

LLVM IR (-O2):
@__NR_linkat = global i32 0
define i32 @xlinkat(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = load i32, i32* @__NR_linkat
%7 = tail call i64 @syscall(i32 %6, i32 %0, i8* %1, i32 %2, i8* %3, i32 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
int f(int n) { return n != 10; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0xa,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp ne i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
size_t strlen(char const *);
size_t argz_count__(const char *argz, size_t len) {
  size_t count = 0;
  while (len > 0) {
    size_t part_len = strlen(argz);
    argz += part_len + 1;
    len -= part_len + 1;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<argz_count__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1174 <argz_count__+0x64>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <argz_count__+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argz_count__>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     114e <argz_count__+0x3e>
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %rax,%rbx
add    $0x1,%rbx
add    $0x1,%rax
add    $0x1,%r14
sub    %rax,%r15
jne    1130 <argz_count__+0x20>
jmp    1151 <argz_count__+0x41>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @argz_count__(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i64 [ %12, %4 ], [ 0, %2 ]
%7 = phi i64 [ %11, %4 ], [ %1, %2 ]
%8 = tail call i64 @strlen(i8* dereferenceable(1) %5)
%9 = add i64 %8, 1
%10 = getelementptr inbounds i8, i8* %5, i64 %9
%11 = sub i64 %7, %9
%12 = add i64 %6, 1
%13 = icmp eq i64 %11, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i64 [ 0, %2 ], [ %12, %4 ]
ret i64 %15
}
void _set_bit(int nr, volatile unsigned long *addr) { (*addr) |= (1 << nr); }


x86 assembly (clang, -O0):
<_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_bit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
or     %rax,(%rsi)
ret

LLVM IR (-O0):
define void @_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = shl i32 1, %5
%7 = sext i32 %6 to i64
%8 = load i64*, i64** %4
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %7
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @_set_bit(i32 %0, i64* %1) {
%3 = shl nuw i32 1, %0
%4 = sext i32 %3 to i64
%5 = load volatile i64, i64* %1
%6 = or i64 %5, %4
store volatile i64 %6, i64* %1
ret void
}
int fun901() { return 901; }


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

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

LLVM IR (-O0):
define i32 @fun901() {
ret i32 901
}

LLVM IR (-O2):
define i32 @fun901() {
ret i32 901
}
/* Variables and functions */
char const *vp_file_close(char *);
const char *vp_socket_close(char *args) { return vp_file_close(args); }


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

x86 assembly (clang, -O2):
<vp_socket_close>:
jmp    1030 <vp_file_close@plt>

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

LLVM IR (-O2):
define i8* @vp_socket_close(i8* %0) {
%2 = tail call i8* @vp_file_close(i8* %0)
ret i8* %2
}
void d2i_ASN1_PRINTABLE(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @BN_mod_add() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_is_palindrome(char *);
char *dec_to_hex(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int numb;
  scanf("%d", &numb);
  char *hex_numb;
  do {
    hex_numb = dec_to_hex(numb++);
  } while (!check_is_palindrome(hex_numb));
  printf("%s", hex_numb);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1050 <dec_to_hex@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <check_is_palindrome@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115f <main+0x1f>
mov    -0x10(%rbp),%rsi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
mov    0xc(%rsp),%edi
lea    0x1(%rdi),%eax
mov    %eax,0xc(%rsp)
call   1050 <dec_to_hex@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <check_is_palindrome@plt>
test   %eax,%eax
je     1160 <main+0x20>
lea    0xe7d(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %5
5: ; preds = %9, %0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = call i8* @dec_to_hex(i32 %6)
store i8* %8, i8** %3
br label %9
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = call i32 @check_is_palindrome(i8* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %5, label %14
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %4
4: ; preds = %4, %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = call i8* @dec_to_hex(i32 %5)
%8 = call i32 @check_is_palindrome(i8* %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %4
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}
void GLUE_POP_PX(void *b, int wv) {
  ((unsigned int *)b)[0] = 0xe49d0008 | (wv << 12);
}


x86 assembly (clang, -O0):
<GLUE_POP_PX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0xc,%ecx
or     $0xe49d0008,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_POP_PX>:
shl    $0xc,%esi
or     $0xe49d0008,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @GLUE_POP_PX(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 12
%7 = or i32 -459472888, %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %7, i32* %10
ret void
}

LLVM IR (-O2):
define void @GLUE_POP_PX(i8* nocapture writeonly %0, i32 %1) {
%3 = shl i32 %1, 12
%4 = or i32 %3, -459472888
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int pass;
  printf("Enter password: ");
  scanf("%d\b\b\b\b\b\b\b\b\n\\\n", &pass);
  printf("Password stored: %d", pass);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xecf(%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    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Enter password: \00"
@.str.1 = [14 x i8] c"%d\08\08\08\08\08\08\08\08\0A\\\0A\00"
@.str.2 = [20 x i8] c"Password stored: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
const char *pmd_drv_log_basename(const char *s) {
  const char *n = s;
  while (*n)
    if (*(n++) == '/')
      s = n;
  return s;
}


x86 assembly (clang, -O0):
<pmd_drv_log_basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <pmd_drv_log_basename+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1140 <pmd_drv_log_basename+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <pmd_drv_log_basename+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmd_drv_log_basename>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <pmd_drv_log_basename+0x22>
lea    0x1(%rax),%rdx
nopl   (%rax)
cmp    $0x2f,%cl
cmove  %rdx,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <pmd_drv_log_basename+0x10>
ret

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

LLVM IR (-O2):
define i8* @pmd_drv_log_basename(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = icmp eq i8 %5, 47
%10 = select i1 %9, i8* %8, i8* %7
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}