xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long RAND_MAX;
long int random() {
  static unsigned long z = 362436069, w = 521288629;
  long int iuni;
  z = 36969 * (z & 65535) + (z >> 16);
  w = 18000 * (w & 65535) + (w >> 16);
  iuni = ((z << 16) + w) & RAND_MAX;
  return (iuni);
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
and    $0xffff,%rax
imul   $0x9069,%rax,%rax
mov    0x2f01(%rip),%rcx
shr    $0x10,%rcx
add    %rcx,%rax
mov    %rax,0x2ef3(%rip)
mov    0x2ef4(%rip),%rax
and    $0xffff,%rax
imul   $0x4650,%rax,%rax
mov    0x2ee0(%rip),%rcx
shr    $0x10,%rcx
add    %rcx,%rax
mov    %rax,0x2ed2(%rip)
mov    0x2ec3(%rip),%rax
shl    $0x10,%rax
add    0x2ec0(%rip),%rax
mov    0x2e79(%rip),%rcx
and    (%rcx),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
mov    0x2f19(%rip),%rax
movzwl %ax,%ecx
imul   $0x9069,%rcx,%rcx
shr    $0x10,%rax
add    %rcx,%rax
mov    %rax,0x2f01(%rip)
mov    0x2f02(%rip),%rcx
movzwl %cx,%edx
imul   $0x4650,%rdx,%rdx
shr    $0x10,%rcx
add    %rdx,%rcx
mov    %rcx,0x2eea(%rip)
shl    $0x10,%rax
add    %rcx,%rax
mov    0x2e9c(%rip),%rcx
and    (%rcx),%rax
ret

LLVM IR (-O0):
@random.z = internal global i64 362436069
@random.w = internal global i64 521288629
@RAND_MAX = global i64 0
define i64 @random() {
%1 = alloca i64
%2 = load i64, i64* @random.z
%3 = and i64 %2, 65535
%4 = mul i64 36969, %3
%5 = load i64, i64* @random.z
%6 = lshr i64 %5, 16
%7 = add i64 %4, %6
store i64 %7, i64* @random.z
%8 = load i64, i64* @random.w
%9 = and i64 %8, 65535
%10 = mul i64 18000, %9
%11 = load i64, i64* @random.w
%12 = lshr i64 %11, 16
%13 = add i64 %10, %12
store i64 %13, i64* @random.w
%14 = load i64, i64* @random.z
%15 = shl i64 %14, 16
%16 = load i64, i64* @random.w
%17 = add i64 %15, %16
%18 = load i64, i64* @RAND_MAX
%19 = and i64 %17, %18
store i64 %19, i64* %1
%20 = load i64, i64* %1
ret i64 %20
}

LLVM IR (-O2):
@random.z = internal unnamed_addr global i64 362436069
@random.w = internal unnamed_addr global i64 521288629
@RAND_MAX = global i64 0
define i64 @random() {
%1 = load i64, i64* @random.z
%2 = and i64 %1, 65535
%3 = mul nuw nsw i64 %2, 36969
%4 = lshr i64 %1, 16
%5 = add nuw nsw i64 %3, %4
store i64 %5, i64* @random.z
%6 = load i64, i64* @random.w
%7 = and i64 %6, 65535
%8 = mul nuw nsw i64 %7, 18000
%9 = lshr i64 %6, 16
%10 = add nuw nsw i64 %8, %9
store i64 %10, i64* @random.w
%11 = shl i64 %5, 16
%12 = add i64 %10, %11
%13 = load i64, i64* @RAND_MAX
%14 = and i64 %12, %13
ret i64 %14
}
unsigned char unsignedchar_id(unsigned char x) { return x; }


x86 assembly (clang, -O0):
<unsignedchar_id>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @unsignedchar_id(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @unsignedchar_id(i8 returned zeroext %0) {
ret i8 %0
}
void zero_array(char *arr) {
  int size = sizeof(arr) / sizeof(arr[0]);
  for (int i = 0; i < size; ++i) {
    arr[i] = 0;
  }
}


x86 assembly (clang, -O0):
<zero_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <zero_array+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <zero_array+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_array>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @zero_array(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i64*
store i64 0, i64* %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int twin_ucs_char_in_page(uint32_t ucs4) { return ucs4 & ((1 << 7) - 1); }


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

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

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

LLVM IR (-O2):
define i32 @twin_ucs_char_in_page(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
long long GetNumber(long long i) { return i; }


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

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

LLVM IR (-O0):
define i64 @GetNumber(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @GetNumber(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
int ndigits_in_u64(int /*<<< orphan*/);
int ndigits_in_i64(int64_t i64Val) {
  if (i64Val < 0) {
    i64Val = -i64Val;
  }
  return ndigits_in_u64((uint64_t)i64Val);
}


x86 assembly (clang, -O0):
<ndigits_in_i64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1131 <ndigits_in_i64+0x21>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <ndigits_in_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndigits_in_i64>:
mov    %rdi,%rax
neg    %rax
cmovns %rax,%rdi
jmp    1030 <ndigits_in_u64@plt>

LLVM IR (-O0):
define i32 @ndigits_in_i64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
store i64 %7, i64* %2
br label %8
8: ; preds = %5, %1
%9 = load i64, i64* %2
%10 = trunc i64 %9 to i32
%11 = call i32 @ndigits_in_u64(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @ndigits_in_i64(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @ndigits_in_u64(i32 %3)
ret i32 %4
}
int cur_coltypes() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cur_coltypes() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ csc_cdll_basic_function();
int /*<<< orphan*/ csc_cdll_list_function();
int csc_cdll_main(void *rtime, int argc, char **argv) {
  (void)rtime;
  (void)argc;
  (void)argv;
  csc_cdll_basic_function();
  csc_cdll_list_function();
  return 0;
}


x86 assembly (clang, -O0):
<csc_cdll_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <csc_cdll_basic_function@plt>
mov    $0x0,%al
call   1030 <csc_cdll_list_function@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csc_cdll_main>:
push   %rax
xor    %eax,%eax
call   1040 <csc_cdll_basic_function@plt>
xor    %eax,%eax
call   1030 <csc_cdll_list_function@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @csc_cdll_main(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @csc_cdll_basic_function()
%5 = tail call i32 (...) @csc_cdll_list_function()
ret i32 0
}
/* Variables and functions */
void *__builtin_sponentry();
void *test_sponentry() { return __builtin_sponentry(); }


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

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

LLVM IR (-O0):
define i8* @test_sponentry() {
%1 = call i8* (...) @__builtin_sponentry()
ret i8* %1
}

LLVM IR (-O2):
define i8* @test_sponentry() {
%1 = tail call i8* (...) @__builtin_sponentry()
ret i8* %1
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int clock_nanosleep(int /*<<< orphan*/, int /*<<< orphan*/, struct timespec *,
                    struct timespec *);
int /*<<< orphan*/ perror(char *);
void sleep_advanced(void) {
  int ret;
  struct timespec req = {.tv_sec = 0, .tv_nsec = 200};
  struct timespec rem;
  ret = clock_nanosleep(CLOCK_REALTIME, 0, &req, &rem);
  if (ret) {
    perror("clock_nanosleep");
  }
}


x86 assembly (clang, -O0):
<sleep_advanced>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <clock_nanosleep@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1164 <sleep_advanced+0x44>
lea    0xea9(%rip),%rdi
call   1030 <perror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_advanced>:
sub    $0x18,%rsp
movq   $0xc8,0x8(%rsp)
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
xor    %esi,%esi
call   1040 <clock_nanosleep@plt>
test   %eax,%eax
jne    1150 <sleep_advanced+0x30>
add    $0x18,%rsp
ret
lea    0xea9(%rip),%rdi
call   1030 <perror@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@__const.sleep_advanced.req = %struct.timespec { i32 200, i32 0 }
@CLOCK_REALTIME = global i32 0
@.str = [16 x i8] c"clock_nanosleep\00"
define void @sleep_advanced() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = load i32, i32* @CLOCK_REALTIME
%6 = call i32 @clock_nanosleep(i32 %5, i32 0, %struct.timespec* %2, %struct.timespec* %3)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
@.str = [16 x i8] c"clock_nanosleep\00"
define void @sleep_advanced() {
%1 = alloca i64
%2 = bitcast i64* %1 to %struct.timespec*
%3 = alloca %struct.timespec
%4 = bitcast i64* %1 to i8*
store i64 200, i64* %1
%5 = bitcast %struct.timespec* %3 to i8*
%6 = load i32, i32* @CLOCK_REALTIME
%7 = call i32 @clock_nanosleep(i32 %6, i32 0, %struct.timespec* %2, %struct.timespec* %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ublx_server_create();
int main(void) { ublx_server_create(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @ublx_server_create()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ublx_server_create()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ bb_ttyname_r(int, char *, int);
char *bb_ttyname(int fd) {
  static char buf[64];
  return bb_ttyname_r(fd, buf, sizeof(buf)) == 0 ? buf : NULL;
}


x86 assembly (clang, -O0):
<bb_ttyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f1b(%rip),%rsi
mov    $0x40,%edx
call   1030 <bb_ttyname_r@plt>
mov    %rax,%rdx
xor    %eax,%eax
lea    0x2f05(%rip),%rcx
cmp    $0x0,%rdx
cmove  %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_ttyname>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
mov    $0x40,%edx
call   1030 <bb_ttyname_r@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@bb_ttyname.buf = internal global [64 x i8] zeroinitializer
define i8* @bb_ttyname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @bb_ttyname_r(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @bb_ttyname.buf, i64 0, i64 0), i32 64)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @bb_ttyname.buf, i64 0, i64 0), i8* null
ret i8* %7
}

LLVM IR (-O2):
@bb_ttyname.buf = internal global [64 x i8] zeroinitializer
define i8* @bb_ttyname(i32 %0) {
%2 = tail call i64 @bb_ttyname_r(i32 %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @bb_ttyname.buf, i64 0, i64 0), i32 64)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @bb_ttyname.buf, i64 0, i64 0), i8* null
ret i8* %4
}
int hotkeystate(void) {
  int pressed = 0;
  return pressed;
}


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

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

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

LLVM IR (-O2):
define i32 @hotkeystate() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char const *, int /*<<< orphan*/);
int open_pcie_config(const char *path) { return open(path, O_RDWR); }


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

x86 assembly (clang, -O2):
<open_pcie_config>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @open_pcie_config(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @open_pcie_config(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int pm8901_mpp_config(unsigned int, int /*<<< orphan*/, unsigned int,
                      unsigned int);
int pm8901_mpp_config_digital_in(unsigned mpp, unsigned level,
                                 unsigned control) {
  return pm8901_mpp_config(mpp, 0, level, control);
}


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

x86 assembly (clang, -O2):
<pm8901_mpp_config_digital_in>:
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <pm8901_mpp_config@plt>

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

LLVM IR (-O2):
define i32 @pm8901_mpp_config_digital_in(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8901_mpp_config(i32 %0, i32 0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int);
void _library_ident(const char *ident) {
  int len = 0;
  while (ident[len])
    len++;
  (void)write(STDOUT_FILENO, ident, len);
  (void)write(STDOUT_FILENO, "\n", 1);
}


x86 assembly (clang, -O0):
<_library_ident>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1143 <_library_ident+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <_library_ident+0x13>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <write@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_library_ident>:
push   %rbx
mov    %rdi,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <_library_ident+0x10>
add    $0xffffffff,%edx
mov    0x2ebc(%rip),%rbx
mov    (%rbx),%edi
call   1030 <write@plt>
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @_library_ident(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 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* @STDOUT_FILENO
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = call i32 @write(i32 %15, i8* %16, i32 %17)
%19 = load i32, i32* @STDOUT_FILENO
%20 = call i32 @write(i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @_library_ident(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = load i32, i32* @STDOUT_FILENO
%11 = tail call i32 @write(i32 %10, i8* %0, i32 %9)
%12 = load i32, i32* @STDOUT_FILENO
%13 = tail call i32 @write(i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
size_t random();
size_t xrandom(void) { return random(); }


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

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

LLVM IR (-O0):
define i64 @xrandom() {
%1 = call i64 (...) @random()
ret i64 %1
}

LLVM IR (-O2):
define i64 @xrandom() {
%1 = tail call i64 (...) @random()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int write_int(const char *path, int i) {
  FILE *fp;
  fp = fopen(path, "w");
  if (fp == NULL)
    return -1;
  fprintf(fp, "%d\n", i);
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116a <write_int+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <write_int+0x5d>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1166 <write_int+0x36>
mov    %rax,%rbx
lea    0xeb2(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    116b <write_int+0x3b>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @write_int(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %18
12: ; preds = %2
%13 = load i32*, i32** %6
%14 = load i32, i32* %5
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32*, i32** %6
%17 = call i32 @fclose(i32* %16)
store i32 0, i32* %3
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @write_int(i8* nocapture %0, i32 %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
double test3(double x) {
  _Complex c = __builtin_cexp(x * (__extension__ 1.0iF));
  return __imag c + __real c;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xecc(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <cexp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <cexp@plt>
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @test3(double %0) {
%2 = alloca double
%3 = alloca { double, double }
%4 = alloca { double, double }
store double %0, double* %2
%5 = load double, double* %2
%6 = fmul double %5, 0.000000e+00
%7 = fmul double %5, 1.000000e+00
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%9 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %6, double* %8
store double %7, double* %9
%10 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%13 = load double, double* %12
%14 = call { double, double } @cexp(double %11, double %13)
%15 = extractvalue { double, double } %14, 0
%16 = extractvalue { double, double } %14, 1
%17 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%18 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %15, double* %17
store double %16, double* %18
%19 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%20 = load double, double* %19
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%22 = load double, double* %21
%23 = fadd double %20, %22
ret double %23
}

LLVM IR (-O2):
define double @test3(double %0) {
%2 = fmul double %0, 0.000000e+00
%3 = tail call { double, double } @cexp(double %2, double %0)
%4 = extractvalue { double, double } %3, 0
%5 = extractvalue { double, double } %3, 1
%6 = fadd double %5, %4
ret double %6
}
void ori_release(struct ori_dis *dis) {}


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

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

LLVM IR (-O0):
%struct.ori_dis = type opaque
define void @ori_release(%struct.ori_dis* %0) {
%2 = alloca %struct.ori_dis*
store %struct.ori_dis* %0, %struct.ori_dis** %2
ret void
}

LLVM IR (-O2):
%struct.ori_dis = type opaque
define void @ori_release(%struct.ori_dis* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XCharStruct;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XCharStruct(void *_p) {
  if (_p == NULL)
    abort();
  free((XCharStruct *)_p);
}


x86 assembly (clang, -O0):
<free_XCharStruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XCharStruct+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XCharStruct>:
test   %rdi,%rdi
je     112a <free_XCharStruct+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

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

LLVM IR (-O2):
define void @free_XCharStruct(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write_at_le32(void *, int, int);
int /*<<< orphan*/ write_le32(void *, int);
void write_le64(void *dest, uint64_t val) {
  write_le32(dest, val >> 0);
  write_at_le32(dest, val >> 32, sizeof(uint32_t));
}


x86 assembly (clang, -O0):
<write_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x0,%esi
call   1030 <write_le32@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
mov    $0x4,%edx
call   1040 <write_at_le32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_le64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <write_le32@plt>
mov    %rbx,%rdi
mov    $0x4,%edx
pop    %rbx
jmp    1040 <write_at_le32@plt>

LLVM IR (-O0):
define void @write_le64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 0
%8 = call i32 @write_le32(i8* %5, i32 %7)
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = ashr i32 %10, 32
%12 = call i32 @write_at_le32(i8* %9, i32 %11, i32 4)
ret void
}

LLVM IR (-O2):
define void @write_le64(i8* %0, i32 %1) {
%3 = tail call i32 @write_le32(i8* %0, i32 %1)
%4 = tail call i32 @write_at_le32(i8* %0, i32 poison, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Section4Hours(int);
int /*<<< orphan*/ Section4Minutes(int);
int /*<<< orphan*/ Section4Seconds(int);
int Section4(int seconds) {
  Section4Hours(seconds);
  Section4Minutes(seconds);
  Section4Seconds(seconds);
  return 0;
}


x86 assembly (clang, -O0):
<Section4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <Section4Hours@plt>
mov    -0x4(%rbp),%edi
call   1040 <Section4Minutes@plt>
mov    -0x4(%rbp),%edi
call   1030 <Section4Seconds@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section4>:
push   %rbx
mov    %edi,%ebx
call   1050 <Section4Hours@plt>
mov    %ebx,%edi
call   1040 <Section4Minutes@plt>
mov    %ebx,%edi
call   1030 <Section4Seconds@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Section4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @Section4Hours(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @Section4Minutes(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @Section4Seconds(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @Section4(i32 %0) {
%2 = tail call i32 @Section4Hours(i32 %0)
%3 = tail call i32 @Section4Minutes(i32 %0)
%4 = tail call i32 @Section4Seconds(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sendCmd(int, char *);
void sketchClear(int fd) { sendCmd(fd, "clear\n"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"clear\0A\00"
define void @sketchClear(i32 %0) {
%2 = tail call i32 @sendCmd(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ swap(int *, int, int);
void shuffle(int A[], int length) {
  int i;
  for (i = 0; i < length; i++) {
    swap(A, i, rand() % length);
  }
}


x86 assembly (clang, -O0):
<shuffle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1175 <shuffle+0x55>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
cltd
idivl  -0xc(%rbp)
call   1030 <swap@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <shuffle+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shuffle>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    114b <shuffle+0x2b>
mov    %esi,%ebx
mov    %rdi,%r14
xor    %ebp,%ebp
nop
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %ebx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <swap@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <shuffle+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @shuffle(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = call i32 (...) @rand()
%14 = load i32, i32* %4
%15 = srem i32 %13, %14
%16 = call i32 @swap(i32* %11, i32 %12, i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @shuffle(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, %1
%8 = tail call i32 @swap(i32* %0, i32 %5, i32 %7)
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
void debugprintf(char *format_str, ...) {}


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

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

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

LLVM IR (-O2):
define void @debugprintf(i8* nocapture %0, ...) {
ret void
}
int stk_init_buddy() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @stk_init_buddy() {
ret i32 0
}
long __syscall2(long n, long a1, long a2) {
  unsigned long __ret;
  __asm__ __volatile__("call __vsyscall"
                       : "=a"(__ret)
                       : "a"(n), "d"(a1), "c"(a2)
                       : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <__vsyscall@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall2>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rax
call   1030 <__vsyscall@plt>
ret

LLVM IR (-O0):
define i64 @__syscall2(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 asm sideeffect "call __vsyscall", "={ax},{ax},{dx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %8, i64 %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @__syscall2(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "call __vsyscall", "={ax},{ax},{dx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ QueueUartChar(int);
void SendUartLF() { QueueUartChar(0x0a); }


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

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

LLVM IR (-O0):
define void @SendUartLF() {
%1 = call i32 @QueueUartChar(i32 10)
ret void
}

LLVM IR (-O2):
define void @SendUartLF() {
%1 = tail call i32 @QueueUartChar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ replaceSpace(char *);
int main(int argc, const char *argv[]) {
  char *sentence = " Hi, My Name is Ruchik Samir Dave";
  replaceSpace(" ");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeea(%rip),%rdi
call   1030 <replaceSpace@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c" Hi, My Name is Ruchik Samir Dave\00"
@.str.1 = [2 x i8] c" \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = call i32 @replaceSpace(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c" \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @replaceSpace(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putendl(char const *s) {
  int i;
  i = 0;
  while (s[i])
    i++;
  write(1, s, i);
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1143 <ft_putendl+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putendl+0x13>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xea0(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
push   %rax
mov    %rdi,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putendl+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
call   1030 <write@plt>
lea    0xec2(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(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 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = call i32 @write(i32 1, i8* %15, i32 %16)
%18 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = tail call i32 @write(i32 1, i8* %0, i32 %9)
%11 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callee1(int, char *, double);
int /*<<< orphan*/ callme(int);
int /*<<< orphan*/ do_nothing();
int main() {
  callee1(2, "A string argument.", 3.5);
  callee1(2, "A string argument.", 3.5);
  do_nothing();
  callme(1);
  callme(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
lea    0xebd(%rip),%rsi
movsd  0xead(%rip),%xmm0
call   1030 <callee1@plt>
mov    $0x2,%edi
lea    0xea4(%rip),%rsi
movsd  0xe94(%rip),%xmm0
call   1030 <callee1@plt>
mov    $0x0,%al
call   1040 <do_nothing@plt>
mov    $0x1,%edi
call   1050 <callme@plt>
mov    $0x2,%edi
call   1050 <callme@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed0(%rip),%rbx
movsd  0xec0(%rip),%xmm0
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <callee1@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
movsd  0xea3(%rip),%xmm0
call   1030 <callee1@plt>
xor    %eax,%eax
call   1040 <do_nothing@plt>
mov    $0x1,%edi
call   1050 <callme@plt>
mov    $0x2,%edi
call   1050 <callme@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"A string argument.\00"
define i32 @main() {
%1 = tail call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%2 = tail call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%3 = tail call i32 (...) @do_nothing()
%4 = tail call i32 @callme(i32 1)
%5 = tail call i32 @callme(i32 2)
ret i32 0
}
int test_imm_B2int64_lowword_mem(long long *val) {
  return ((*val) & (0xB2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B2int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 178
%6 = icmp ne i64 %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_B2int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 178
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void debugpins_task_set() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_pel_pixels16_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test1();
int main(int argc, char *argv[]) {
  printf("user 1\n");
  return test1();
}


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)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test1@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"user 1\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 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test1()
ret i32 %7
}

LLVM IR (-O2):
@str = [7 x i8] c"user 1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test1()
ret i32 %4
}
int step(int n) {
  int i = 1;
  while (n != 1) {
    if (n % 2)
      n = (n * 3) + 1;
    else
      n /= 2;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<step>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1157 <step+0x57>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113b <step+0x3b>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <step+0x49>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <step+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<step>:
mov    $0x1,%eax
cmp    $0x1,%edi
jne    110b <step+0xb>
ret
mov    $0x1,%eax
jmp    1133 <step+0x33>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    %ecx,%edi
add    $0x1,%eax
cmp    $0x1,%edi
je     110a <step+0xa>
test   $0x1,%dil
je     1120 <step+0x20>
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
jmp    112b <step+0x2b>

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

LLVM IR (-O2):
define i32 @step(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %13
%4 = phi i32 [ %15, %13 ], [ 1, %1 ]
%5 = phi i32 [ %14, %13 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = mul nsw i32 %5, 3
%10 = add nsw i32 %9, 1
br label %13
11: ; preds = %3
%12 = sdiv i32 %5, 2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i32 %14, 1
br i1 %16, label %17, label %3
17: ; preds = %13, %1
%18 = phi i32 [ 1, %1 ], [ %15, %13 ]
ret i32 %18
}