xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint16_t unpack_from_h16(const void *v) {
  uint16_t u;
  memcpy(&u, v, sizeof(uint16_t));
  return u;
}


x86 assembly (clang, -O0):
<unpack_from_h16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_from_h16>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @unpack_from_h16(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
char const *Z_NULL;
unsigned long crc32(unsigned long, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
unsigned long int num_CRC32(const char *str) {
  unsigned long int crc = crc32(0L, Z_NULL, 0);
  crc = crc32(crc, str, strlen(str));
  return crc;
}


x86 assembly (clang, -O0):
<num_CRC32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    %eax,%edi
xor    %edx,%edx
call   1030 <crc32@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <crc32@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_CRC32>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%rax
mov    (%rax),%rsi
xor    %edi,%edi
xor    %edx,%edx
call   1030 <crc32@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <crc32@plt>

LLVM IR (-O0):
@Z_NULL = global i8* null
define i64 @num_CRC32(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** @Z_NULL
%5 = call i64 @crc32(i64 0, i8* %4, i32 0)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = call i64 @crc32(i64 %6, i8* %7, i32 %9)
store i64 %10, i64* %3
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
@Z_NULL = global i8* null
define i64 @num_CRC32(i8* %0) {
%2 = load i8*, i8** @Z_NULL
%3 = tail call i64 @crc32(i64 0, i8* %2, i32 0)
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i64 @crc32(i64 %3, i8* %0, i32 %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void buddy_online(void *h, const char *who) {
  printf(">>> %s is now online\n", who);
  return;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c">>> %s is now online\0A\00"
define void @buddy_online(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c">>> %s is now online\0A\00"
define void @buddy_online(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xe1() {
  Assert_real((isspace(225) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1130, ("isspace should be 0 for 0xe1"));
}


x86 assembly (clang, -O0):
<t_isspace_0xe1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe1,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x46a,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0xe1>:
push   %rax
mov    $0xe1,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xe1\00"
define void @t_isspace_0xe1() {
%1 = call i64 @isspace(i32 225)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xe1\00"
define void @t_isspace_0xe1() {
%1 = tail call i64 @isspace(i32 225)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct qnode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ deqeue(struct qnode *);
struct qnode *pop(struct qnode *head) {
  deqeue(head);
  return head;
}


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

x86 assembly (clang, -O2):
<pop>:
push   %rbx
mov    %rdi,%rbx
call   1030 <deqeue@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.qnode = type { i32 }
define %struct.qnode* @pop(%struct.qnode* %0) {
%2 = alloca %struct.qnode*
store %struct.qnode* %0, %struct.qnode** %2
%3 = load %struct.qnode*, %struct.qnode** %2
%4 = call i32 @deqeue(%struct.qnode* %3)
%5 = load %struct.qnode*, %struct.qnode** %2
ret %struct.qnode* %5
}

LLVM IR (-O2):
%struct.qnode = type { i32 }
define %struct.qnode* @pop(%struct.qnode* returned %0) {
%2 = tail call i32 @deqeue(%struct.qnode* %0)
ret %struct.qnode* %0
}
void swap_bytes_8(unsigned char *buffer) {
  unsigned char temp;
  temp = buffer[0];
  buffer[0] = buffer[3];
  buffer[3] = temp;
  temp = buffer[1];
  buffer[1] = buffer[2];
  buffer[2] = temp;
}


x86 assembly (clang, -O0):
<swap_bytes_8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_bytes_8>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

LLVM IR (-O0):
define void @swap_bytes_8(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = load i8, i8* %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8, i8* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 3
store i8 %12, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
store i8 %17, i8* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i8, i8* %3
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 2
store i8 %23, i8* %25
ret void
}

LLVM IR (-O2):
define void @swap_bytes_8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
void phy_led_trigger_change_speed(struct phy_device *phy) {}


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

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

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

LLVM IR (-O2):
%struct.phy_device = type opaque
define void @phy_led_trigger_change_speed(%struct.phy_device* nocapture %0) {
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_snansum(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  float v = stdlib_strided_snansum(N, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1050 <stdlib_strided_snansum@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_snansum@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [10 x float]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_snansum(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_snansum(i32 5, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ memcmp(char *, char *, size_t);
int map_keycmp(char *key1, size_t len1, char *key2, size_t len2) {
  if (len1 == len2 && (memcmp(key1, key2, len1) == 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<map_keycmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    115d <map_keycmp+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    115d <map_keycmp+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1164 <map_keycmp+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_keycmp>:
cmp    %rcx,%rsi
jne    112e <map_keycmp+0x1e>
push   %rax
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <memcmp@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     1131 <map_keycmp+0x21>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @map_keycmp(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp eq i64 %1, %3
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = tail call i64 @memcmp(i8* %0, i8* %2, i64 %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6, %4
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long const, long const);
void assert_long_equals(const long val1, const long val2) {
  if (val1 == val2)
    printf("\033[00;32mOK: Asserting that %ld equals %ld\033[00m\n", val1,
           val2);
  else
    printf("\033[31mKO: Asserting that %ld equals %ld\033[00m\n", val1, val2);
}


x86 assembly (clang, -O0):
<assert_long_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1147 <assert_long_equals+0x37>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    115b <assert_long_equals+0x4b>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_long_equals>:
mov    %rsi,%rdx
mov    %rdi,%rsi
cmp    %rdx,%rdi
jne    112a <assert_long_equals+0x1a>
lea    0xede(%rip),%rdi
mov    %rsi,%rdx
jmp    1030 <printf@plt>
lea    0xeff(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"\1B[00;32mOK: Asserting that %ld equals %ld\1B[00m\0A\00"
@.str.1 = [45 x i8] c"\1B[31mKO: Asserting that %ld equals %ld\1B[00m\0A\00"
define void @assert_long_equals(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 %9, i64 %10)
br label %16
12: ; preds = %2
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i64 %13, i64 %14)
br label %16
16: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"\1B[00;32mOK: Asserting that %ld equals %ld\1B[00m\0A\00"
@.str.1 = [45 x i8] c"\1B[31mKO: Asserting that %ld equals %ld\1B[00m\0A\00"
define void @assert_long_equals(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i64 %0, i64 %1)
br label %8
8: ; preds = %6, %4
ret void
}
int validation_for_months(int *ptr) {
  int date, check = 0;
  date = ptr[2] * 10 + ptr[3];
  if ((date >= 1 && date <= 12) || (date >= 21 && date <= 32) ||
      (date >= 41 && date <= 52))
    check = 1;
  return check;
}


x86 assembly (clang, -O0):
<validation_for_months>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xa,0x8(%rax),%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     1135 <validation_for_months+0x35>
cmpl   $0xc,-0xc(%rbp)
jle    115d <validation_for_months+0x5d>
cmpl   $0x15,-0xc(%rbp)
jl     1149 <validation_for_months+0x49>
cmpl   $0x20,-0xc(%rbp)
jle    115d <validation_for_months+0x5d>
cmpl   $0x29,-0xc(%rbp)
jl     1164 <validation_for_months+0x64>
cmpl   $0x34,-0xc(%rbp)
jg     1164 <validation_for_months+0x64>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validation_for_months>:
mov    0x8(%rdi),%eax
mov    0xc(%rdi),%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%edx
add    $0xffffffff,%edx
cmp    $0xc,%edx
setb   %dil
lea    (%rcx,%rax,2),%esi
add    $0xffffffeb,%esi
cmp    $0xc,%esi
setb   %dl
or     %dil,%dl
lea    (%rcx,%rax,2),%eax
add    $0xffffffd7,%eax
cmp    $0xc,%eax
setb   %al
or     %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @validation_for_months(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 10
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = add nsw i32 %4, %6
%8 = add i32 %7, -1
%9 = icmp ult i32 %8, 12
%10 = add i32 %7, -21
%11 = icmp ult i32 %10, 12
%12 = or i1 %9, %11
%13 = add i32 %7, -41
%14 = icmp ult i32 %13, 12
%15 = select i1 %12, i1 true, i1 %14
%16 = zext i1 %15 to i32
ret i32 %16
}
int test_imm_17uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x17 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_17uint64_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, 23
%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_17uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 23
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
const char *event_get_method(void) { return "minievent-select"; }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"minievent-select\00"
define i8* @event_get_method() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"minievent-select\00"
define i8* @event_get_method() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
void _swift_getGenericMetadata(void) {}


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

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

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

LLVM IR (-O2):
define void @_swift_getGenericMetadata() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef void *uint32_t;

/* Variables and functions */
void *htonl(void *);
uint64_t htonll(uint64_t ll) {
  union {
    uint64_t ll;
    struct {
      uint32_t h;
      uint32_t l;
    } s;
  } u;
  u.ll = ll;
  u.s.h = htonl(u.s.h);
  u.s.l = htonl(u.s.l);
  return u.ll;
}


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <htonl@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <htonl@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
push   %rbx
mov    %edi,%edi
call   1030 <htonl@plt>
mov    %rax,%rbx
call   1030 <htonl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%union.anon = type { %struct.anon }
%struct.anon = type { i8*, i8* }
define i32 @htonll(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to %struct.anon*
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i8*, i8** %7
%9 = call i8* @htonl(i8* %8)
%10 = bitcast %union.anon* %3 to %struct.anon*
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
store i8* %9, i8** %11
%12 = bitcast %union.anon* %3 to %struct.anon*
%13 = getelementptr inbounds %struct.anon, %struct.anon* %12, i32 0, i32 1
%14 = load i8*, i8** %13
%15 = call i8* @htonl(i8* %14)
%16 = bitcast %union.anon* %3 to %struct.anon*
%17 = getelementptr inbounds %struct.anon, %struct.anon* %16, i32 0, i32 1
store i8* %15, i8** %17
%18 = bitcast %union.anon* %3 to i32*
%19 = load i32, i32* %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @htonll(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i8* @htonl(i8* %3)
%5 = tail call i8* @htonl(i8* undef)
%6 = ptrtoint i8* %4 to i64
%7 = trunc i64 %6 to i32
ret i32 %7
}
void gtk_direction_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_direction_type_get_type() {
ret void
}
/* Variables and functions */
double M_PI;
double sin(double);
double calculateY(double angle, double radius) {
  return (radius * sin(M_PI * angle / 180.0));
}


x86 assembly (clang, -O0):
<calculateY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateY>:
push   %rax
movsd  %xmm1,(%rsp)
mov    0x2ecb(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xed7(%rip),%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @calculateY(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* @M_PI
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = fdiv double %8, 1.800000e+02
%10 = call double @sin(double %9)
%11 = fmul double %5, %10
ret double %11
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @calculateY(double %0, double %1) {
%3 = load double, double* @M_PI
%4 = fmul double %3, %0
%5 = fdiv double %4, 1.800000e+02
%6 = tail call double @sin(double %5)
%7 = fmul double %6, %1
ret double %7
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
long timeval_to_ms(struct timeval *);
long delta_time_ms(struct timeval *tv, struct timeval *last_tv) {
  return timeval_to_ms(tv) - timeval_to_ms(last_tv);
}


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

x86 assembly (clang, -O2):
<delta_time_ms>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <timeval_to_ms@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <timeval_to_ms@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i64 @delta_time_ms(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = call i64 @timeval_to_ms(%struct.timeval* %5)
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = call i64 @timeval_to_ms(%struct.timeval* %7)
%9 = sub nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i64 @delta_time_ms(%struct.timeval* %0, %struct.timeval* %1) {
%3 = tail call i64 @timeval_to_ms(%struct.timeval* %0)
%4 = tail call i64 @timeval_to_ms(%struct.timeval* %1)
%5 = sub nsw i64 %3, %4
ret i64 %5
}
/* Type definitions */
struct RNAduplex_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct RNAduplex_args_info *);
int /*<<< orphan*/ clear_given(struct RNAduplex_args_info *);
int /*<<< orphan*/ init_args_info(struct RNAduplex_args_info *);
void RNAduplex_cmdline_parser_init(struct RNAduplex_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<RNAduplex_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAduplex_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.RNAduplex_args_info = type { i32 }
define void @RNAduplex_cmdline_parser_init(%struct.RNAduplex_args_info* %0) {
%2 = alloca %struct.RNAduplex_args_info*
store %struct.RNAduplex_args_info* %0, %struct.RNAduplex_args_info** %2
%3 = load %struct.RNAduplex_args_info*, %struct.RNAduplex_args_info** %2
%4 = call i32 @clear_given(%struct.RNAduplex_args_info* %3)
%5 = load %struct.RNAduplex_args_info*, %struct.RNAduplex_args_info** %2
%6 = call i32 @clear_args(%struct.RNAduplex_args_info* %5)
%7 = load %struct.RNAduplex_args_info*, %struct.RNAduplex_args_info** %2
%8 = call i32 @init_args_info(%struct.RNAduplex_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.RNAduplex_args_info = type { i32 }
define void @RNAduplex_cmdline_parser_init(%struct.RNAduplex_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.RNAduplex_args_info* %0)
%3 = tail call i32 @clear_args(%struct.RNAduplex_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.RNAduplex_args_info* %0)
ret void
}
void wrgsbase(unsigned long gsbase) {
  asm volatile("wrgsbase %0" ::"r"(gsbase) : "memory");
}


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

x86 assembly (clang, -O2):
<wrgsbase>:
wrgsbase %rdi
ret

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

LLVM IR (-O2):
define void @wrgsbase(i64 %0) {
tail call void asm sideeffect "wrgsbase $0", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int f();
int main(void) {
  f();
  f() + 0;
  return f();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = call i32 (...) @f()
%4 = add nsw i32 %3, 0
%5 = call i32 (...) @f()
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @f()
ret i32 %3
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
long tm_diffseconds(struct tm, struct tm);
int tm_compare(const void *pdebut, const void *pfin) {
  long int diff = -tm_diffseconds(*(struct tm *)pdebut, *(struct tm *)pfin);
  return diff < 0 ? -1 : (diff > 0 ? 1 : 0);
}


x86 assembly (clang, -O0):
<tm_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    (%rcx),%edi
mov    (%rax),%esi
call   1030 <tm_diffseconds@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    1155 <tm_compare+0x45>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    116a <tm_compare+0x5a>
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovg  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_compare>:
push   %rax
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <tm_diffseconds@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @tm_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.tm*
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.tm*
%10 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i64 @tm_diffseconds(i32 %11, i32 %13)
%15 = sub nsw i64 0, %14
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %2
br label %24
19: ; preds = %2
%20 = load i64, i64* %5
%21 = icmp sgt i64 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 0
br label %24
24: ; preds = %19, %18
%25 = phi i32 [ -1, %18 ], [ %23, %19 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @tm_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i64 @tm_diffseconds(i32 %4, i32 %6)
%8 = icmp sgt i64 %7, 0
%9 = icmp ne i64 %7, 0
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cls(void) { printf("\033[2J"); }


x86 assembly (clang, -O0):
<cls>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define void @cls() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @cls() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
AX0AR1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((((double *)10000000)[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0AR1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x1c(%rbp),%rcx
mov    $0x989680,%eax
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movsd  0x21e888(%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     114c <AX0AR1+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <AX0AR1+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0AR1>:
movslq %edi,%rdx
movsd  0x21e888(%rcx),%xmm0
xor    %eax,%eax
ucomisd 0x989680(,%rdx,8),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @AX0AR1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %15
%17 = load double, double* %16
%18 = load double*, double** %13
%19 = getelementptr inbounds double, double* %18, i64 277777
%20 = load double, double* %19
%21 = fcmp ole double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %6
store i32 1, i32* %7
br label %24
23: ; preds = %6
store i32 0, i32* %7
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @AX0AR1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %7
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %5, i64 277777
%11 = load double, double* %10
%12 = fcmp ole double %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(void) {
  int day, month, year;
  printf("Enter a date (mm/dd/yyyy): ");
  scanf("%d/%d/%d", &month, &day, &year);
  printf("You entered the date %.4d%.2d%.2d\n", year, month, day);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%ecx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter a date (mm/dd/yyyy): \00"
@.str.1 = [9 x i8] c"%d/%d/%d\00"
@.str.2 = [35 x i8] c"You entered the date %.4d%.2d%.2d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %2, i32* %4)
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter a date (mm/dd/yyyy): \00"
@.str.1 = [9 x i8] c"%d/%d/%d\00"
@.str.2 = [35 x i8] c"You entered the date %.4d%.2d%.2d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %1, i32* %3)
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t xorbits6(uint32_t b, int n) {
  int i = 1;
  do {
    b ^= b >> i;
    i <<= 1;
  } while (i < n);
  b &= 1;
  return b;
}


x86 assembly (clang, -O0):
<xorbits6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1111 <xorbits6+0x11>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorbits6>:
mov    %edi,%eax
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    %eax,%edx
sar    %cl,%eax
xor    %edx,%eax
add    %ecx,%ecx
cmp    %esi,%ecx
jl     1110 <xorbits6+0x10>
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @xorbits6(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 1, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %5
%9 = ashr i32 %7, %8
%10 = load i32, i32* %3
%11 = xor i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %5
%13 = shl i32 %12, 1
store i32 %13, i32* %5
br label %14
14: ; preds = %6
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %6, label %18
18: ; preds = %14
%19 = load i32, i32* %3
%20 = and i32 %19, 1
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @xorbits6(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %7, %3 ]
%5 = phi i32 [ 1, %2 ], [ %8, %3 ]
%6 = ashr i32 %4, %5
%7 = xor i32 %6, %4
%8 = shl i32 %5, 1
%9 = icmp slt i32 %8, %1
br i1 %9, label %3, label %10
10: ; preds = %3
%11 = and i32 %7, 1
ret i32 %11
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double gettimed() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
}


x86 assembly (clang, -O0):
<gettimed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimed>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @gettimed() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @gettimed() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ GetInput(char *);
int /*<<< orphan*/ ShowIntResult(int /*<<< orphan*/);
int /*<<< orphan*/ Sum(int /*<<< orphan*/, int /*<<< orphan*/);
void SumOperation() {
  ShowIntResult(Sum(GetInput("Give input: "), GetInput("Give input: ")));
}


x86 assembly (clang, -O0):
<SumOperation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <GetInput@plt>
mov    %eax,-0x4(%rbp)
lea    0xeb2(%rip),%rdi
call   1040 <GetInput@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1050 <Sum@plt>
mov    %eax,%edi
call   1030 <ShowIntResult@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SumOperation>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
mov    %rbx,%rdi
call   1040 <GetInput@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <GetInput@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <Sum@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ShowIntResult@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Give input: \00"
define void @SumOperation() {
%1 = call i32 @GetInput(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @GetInput(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @Sum(i32 %1, i32 %2)
%4 = call i32 @ShowIntResult(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Give input: \00"
define void @SumOperation() {
%1 = tail call i32 @GetInput(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @GetInput(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @Sum(i32 %1, i32 %2)
%4 = tail call i32 @ShowIntResult(i32 %3)
ret void
}
/* Type definitions */
struct gsm_modul {
  int dummy;
};

/* Variables and functions */
int module_send_pdu(struct gsm_modul *, char *);
int __gsm_send_pdu(struct gsm_modul *gsm, char *message) {
  return module_send_pdu(gsm, message);
}


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

x86 assembly (clang, -O2):
<__gsm_send_pdu>:
jmp    1030 <module_send_pdu@plt>

LLVM IR (-O0):
%struct.gsm_modul = type { i32 }
define i32 @__gsm_send_pdu(%struct.gsm_modul* %0, i8* %1) {
%3 = alloca %struct.gsm_modul*
%4 = alloca i8*
store %struct.gsm_modul* %0, %struct.gsm_modul** %3
store i8* %1, i8** %4
%5 = load %struct.gsm_modul*, %struct.gsm_modul** %3
%6 = load i8*, i8** %4
%7 = call i32 @module_send_pdu(%struct.gsm_modul* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.gsm_modul = type { i32 }
define i32 @__gsm_send_pdu(%struct.gsm_modul* %0, i8* %1) {
%3 = tail call i32 @module_send_pdu(%struct.gsm_modul* %0, i8* %1)
ret i32 %3
}
void thrd_yield(void) {}


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

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

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

LLVM IR (-O2):
define void @thrd_yield() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stdout;
void putch(char c) {
  (void)putchar((int)c);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
push   %rax
call   1030 <putchar@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @putch(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i32 @putchar(i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @putch(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 @putchar(i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}