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

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int getrand(int, int /*<<< orphan*/ *, int);
int open(char *, int /*<<< orphan*/);
int make_seed64(uint64_t *seed) {
  int fd, rv;
  fd = open("/dev/random", O_RDONLY);
  if (fd == -1)
    return -1;
  rv = getrand(fd, seed, sizeof(seed));
  close(fd);
  return rv;
}


x86 assembly (clang, -O0):
<make_seed64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    116a <make_seed64+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <make_seed64+0x5c>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1050 <getrand@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_seed64>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     116e <make_seed64+0x3e>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1050 <getrand@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <close@plt>
mov    %ebx,%eax
jmp    1173 <make_seed64+0x43>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/random\00"
@O_RDONLY = global i32 0
define i32 @make_seed64(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %18
11: ; preds = %1
%12 = load i32, i32* %4
%13 = load i32*, i32** %3
%14 = call i32 @getrand(i32 %12, i32* %13, i32 8)
store i32 %14, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @close(i32 %15)
%17 = load i32, i32* %5
store i32 %17, i32* %2
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/random\00"
@O_RDONLY = global i32 0
define i32 @make_seed64(i32* %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @getrand(i32 %3, i32* %0, i32 8)
%7 = tail call i32 @close(i32 %3)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %6, %5 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int target();
int target_alias();
int main() { return target() + target_alias(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <target@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <target_alias@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @target()
%2 = tail call i32 (...) @target_alias()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write_syncbit();
int /*<<< orphan*/ write_t1();
void writeSyncFrame(int sync) {
  for (int i = 0; i < sync; i++) {
    write_t1();
  }
  write_syncbit();
}


x86 assembly (clang, -O0):
<writeSyncFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1153 <writeSyncFrame+0x33>
mov    $0x0,%al
call   1030 <write_t1@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <writeSyncFrame+0x12>
mov    $0x0,%al
call   1040 <write_syncbit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeSyncFrame>:
push   %rbx
test   %edi,%edi
jle    113c <writeSyncFrame+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <write_t1@plt>
add    $0xffffffff,%ebx
jne    1130 <writeSyncFrame+0x10>
xor    %eax,%eax
pop    %rbx
jmp    1040 <write_syncbit@plt>

LLVM IR (-O0):
define void @writeSyncFrame(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 (...) @write_t1()
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = call i32 (...) @write_syncbit()
ret void
}

LLVM IR (-O2):
define void @writeSyncFrame(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = tail call i32 (...) @write_syncbit()
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 (...) @write_t1()
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %3, label %5
}
int fun1007() { return 1007; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x3ef,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x3ef,%eax
ret

LLVM IR (-O0):
define i32 @fun1007() {
ret i32 1007
}

LLVM IR (-O2):
define i32 @fun1007() {
ret i32 1007
}
/* Variables and functions */
void *read_file2mem(char const *, size_t *, int /*<<< orphan*/);
void *spn_read_binary_file(const char *name, size_t *sz) {
  return read_file2mem(name, sz, 0);
}


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

x86 assembly (clang, -O2):
<spn_read_binary_file>:
xor    %edx,%edx
jmp    1030 <read_file2mem@plt>

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

LLVM IR (-O2):
define i8* @spn_read_binary_file(i8* %0, i64* %1) {
%3 = tail call i8* @read_file2mem(i8* %0, i64* %1, i32 0)
ret i8* %3
}
char *strapp(register char *s, register char *tail) {
  while ((*s++ = *tail++) != 0)
    ;
  return (s - 1);
}


x86 assembly (clang, -O0):
<strapp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <strapp+0x3f>
jmp    110c <strapp+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strapp>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strapp+0x10>
ret

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

LLVM IR (-O2):
define i8* @strapp(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %4
}
int tdefault_can_use_hw_breakpoint(struct target_ops *self, int arg1, int arg2,
                                   int arg3) {
  return 0;
}


x86 assembly (clang, -O0):
<tdefault_can_use_hw_breakpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.target_ops = type opaque
define i32 @tdefault_can_use_hw_breakpoint(%struct.target_ops* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.target_ops*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.target_ops* %0, %struct.target_ops** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.target_ops = type opaque
define i32 @tdefault_can_use_hw_breakpoint(%struct.target_ops* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int I2C_Read(int, int, unsigned char *);
int STC3115_ReadWord(int RegAddress) {
  int value;
  unsigned char data[2];
  int res;
  res = I2C_Read(2, RegAddress, data);
  if (res >= 0) {
    value = data[1];
    value = (value << 8) | data[0];
  } else
    value = -1;
  return (value);
}


x86 assembly (clang, -O0):
<STC3115_ReadWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    -0xa(%rbp),%rdx
mov    $0x2,%edi
call   1030 <I2C_Read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <STC3115_ReadWord+0x44>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <STC3115_ReadWord+0x4b>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC3115_ReadWord>:
push   %rax
mov    %edi,%esi
lea    0x6(%rsp),%rdx
mov    $0x2,%edi
call   1030 <I2C_Read@plt>
test   %eax,%eax
movzwl 0x6(%rsp),%ecx
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @STC3115_ReadWord(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i8]
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%8 = call i32 @I2C_Read(i32 2, i32 %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %1
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = shl i32 %15, 8
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = or i32 %16, %19
store i32 %20, i32* %3
br label %22
21: ; preds = %1
store i32 -1, i32* %3
br label %22
22: ; preds = %21, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @STC3115_ReadWord(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @I2C_Read(i32 2, i32 %0, i8* %3)
%5 = icmp sgt i32 %4, -1
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
%13 = select i1 %5, i32 %12, i32 -1
ret i32 %13
}
unsigned long align_floor(unsigned long x, unsigned long shift) {
  return (x % (1 << shift)) ? (x >> shift << shift) : x;
}


x86 assembly (clang, -O0):
<align_floor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
je     114a <align_floor+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    %cl,%rax
mov    -0x10(%rbp),%rcx
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <align_floor+0x52>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_floor>:
mov    %rsi,%rcx
mov    $0x1,%esi
shl    %cl,%esi
mov    %rdi,%r8
movslq %esi,%rdi
mov    %r8,%rax
or     %rdi,%rax
shr    $0x20,%rax
je     1126 <align_floor+0x26>
mov    %r8,%rax
xor    %edx,%edx
div    %rdi
jmp    112d <align_floor+0x2d>
mov    %r8d,%eax
xor    %edx,%edx
div    %esi
mov    $0xffffffffffffffff,%rsi
shl    %cl,%rsi
cmp    $0x1,%rdx
sbb    %rax,%rax
or     %rsi,%rax
and    %r8,%rax
ret

LLVM IR (-O0):
define i64 @align_floor(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 = trunc i64 %6 to i32
%8 = shl i32 1, %7
%9 = sext i32 %8 to i64
%10 = urem i64 %5, %9
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = lshr i64 %13, %14
%16 = load i64, i64* %4
%17 = shl i64 %15, %16
br label %20
18: ; preds = %2
%19 = load i64, i64* %3
br label %20
20: ; preds = %18, %12
%21 = phi i64 [ %17, %12 ], [ %19, %18 ]
ret i64 %21
}

LLVM IR (-O2):
define i64 @align_floor(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = urem i64 %0, %5
%7 = icmp eq i64 %6, 0
%8 = shl nsw i64 -1, %1
%9 = select i1 %7, i64 -1, i64 %8
%10 = and i64 %9, %0
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int /*<<< orphan*/ print_freelist();
int main(int argc, char *argv[]) {
  void *p = malloc(30);
  print_freelist();
  free(p);
  print_freelist();
  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)
mov    $0x1e,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <print_freelist@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1050 <print_freelist@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1e,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <print_freelist@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1050 <print_freelist@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
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
%7 = call i8* @malloc(i32 30)
store i8* %7, i8** %6
%8 = call i32 (...) @print_freelist()
%9 = load i8*, i8** %6
%10 = call i32 @free(i8* %9)
%11 = call i32 (...) @print_freelist()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(30) i8* @malloc(i32 30)
%4 = tail call i32 (...) @print_freelist()
%5 = tail call i32 @free(i8* %3)
%6 = tail call i32 (...) @print_freelist()
ret i32 0
}
/* Variables and functions */
scalar_t__ istty();
char *rdz_cl() { return istty() ? "[0;0m" : ""; }


x86 assembly (clang, -O0):
<rdz_cl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <istty@plt>
mov    %rax,%rdx
lea    0xee1(%rip),%rax
lea    0xed4(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdz_cl>:
push   %rax
xor    %eax,%eax
call   1030 <istty@plt>
test   %rax,%rax
lea    0xee4(%rip),%rcx
lea    0xed7(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[0;0m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @rdz_cl() {
%1 = call i64 (...) @istty()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[0;0m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @rdz_cl() {
%1 = tail call i64 (...) @istty()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t func2(uint32_t x) { return (x ^ (x >> 27)) * (uint32_t)1566083941UL; }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1b,%ecx
xor    %ecx,%eax
imul   $0x5d588b65,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
mov    %edi,%eax
sar    $0x1b,%eax
xor    %edi,%eax
imul   $0x5d588b65,%eax,%eax
ret

LLVM IR (-O0):
define i32 @func2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 27
%6 = xor i32 %3, %5
%7 = mul nsw i32 %6, 1566083941
ret i32 %7
}

LLVM IR (-O2):
define i32 @func2(i32 %0) {
%2 = ashr i32 %0, 27
%3 = xor i32 %2, %0
%4 = mul nsw i32 %3, 1566083941
ret i32 %4
}
/* Variables and functions */
unsigned int REG_SPI_BASE(unsigned int);
__attribute__((always_)) __attribute__((flatten)) unsigned int
SPI_USER(unsigned int i) {
  return (REG_SPI_BASE(i) + 0x1c);
}


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

x86 assembly (clang, -O2):
<SPI_USER>:
push   %rax
call   1030 <REG_SPI_BASE@plt>
add    $0x1c,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SPI_USER(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @REG_SPI_BASE(i32 %3)
%5 = add i32 %4, 28
ret i32 %5
}

LLVM IR (-O2):
define i32 @SPI_USER(i32 %0) {
%2 = tail call i32 @REG_SPI_BASE(i32 %0)
%3 = add i32 %2, 28
ret i32 %3
}
__attribute__((unused)) int ularith_clz(const unsigned long a) {
  ;
  return __builtin_clzl(a);
}


x86 assembly (clang, -O0):
<ularith_clz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ularith_clz>:
bsr    %rdi,%rax
xor    $0x3f,%eax
ret

LLVM IR (-O0):
define i32 @ularith_clz(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctlz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ularith_clz(i64 %0) {
%2 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void quitSignalHandler(int sig) { fprintf(stderr, "quitSignalHandler()\n"); }


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

x86 assembly (clang, -O2):
<quitSignalHandler>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"quitSignalHandler()\0A\00"
define void @quitSignalHandler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long tile;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
void set_XGCValues_tile(void *_p, unsigned long _v) {
  ((XGCValues *)_p)->tile = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XGCValues_tile>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XGCValues_tile(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XGCValues_tile(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void to_binary(unsigned long n) {
  int r;
  r = n % 2;
  if (n >= 2)
    to_binary(n / 2);
  putchar((r == 0) ? '0' : '1');
  return;
}


x86 assembly (clang, -O0):
<to_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    %eax,-0xc(%rbp)
cmpq   $0x2,-0x8(%rbp)
jb     114f <to_binary+0x2f>
mov    -0x8(%rbp),%rdi
shr    $0x1,%rdi
call   1040 <to_binary@plt>
mov    -0xc(%rbp),%edx
mov    $0x31,%eax
mov    $0x30,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_binary>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%rdi
jb     1135 <to_binary+0x15>
mov    %rbx,%rdi
shr    %rdi
call   1040 <to_binary@plt>
and    $0x1,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @to_binary(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = urem i64 %4, 2
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i64, i64* %2
%8 = icmp uge i64 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i64, i64* %2
%11 = udiv i64 %10, 2
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 48, i32 49
%17 = trunc i32 %16 to i8
%18 = call i32 @putchar(i8 signext %17)
ret void
}

LLVM IR (-O2):
define void @to_binary(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i64 %0, 1
tail call void @to_binary(i64 %4)
br label %5
5: ; preds = %3, %1
%6 = and i64 %0, 1
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8 48, i8 49
%9 = tail call i32 @putchar(i8 signext %8)
ret void
}
/* Variables and functions */
scalar_t__ StringIn(char, char *);
char *StringSkipWhitespace(char *in) {
  while (*in && (StringIn((*in), " \t\n\r")))
    in++;
  return (in);
}


x86 assembly (clang, -O0):
<StringSkipWhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     114e <StringSkipWhitespace+0x3e>
mov    -0x8(%rbp),%rax
lea    0xec4(%rip),%rsi
movsbl (%rax),%edi
call   1030 <StringIn@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115e <StringSkipWhitespace+0x4e>
jmp    116f <StringSkipWhitespace+0x5f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <StringSkipWhitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringSkipWhitespace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     114c <StringSkipWhitespace+0x3c>
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <StringIn@plt>
test   %rax,%rax
je     114c <StringSkipWhitespace+0x3c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <StringSkipWhitespace+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0A\0D\00"
define i8* @StringSkipWhitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @StringIn(i8 signext %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0A\0D\00"
define i8* @StringSkipWhitespace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @StringIn(i8 signext %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_dobldobl_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(235, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<write_dobldobl_start_solutions>:
mov    $0xeb,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @write_dobldobl_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 235, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void WT_PAUSE(void) { return; }


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

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

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

LLVM IR (-O2):
define void @WT_PAUSE() {
ret void
}
int tosReal_order(double x, double y) { return x < y ? -1 : x > y ? 1 : 0; }


x86 assembly (clang, -O0):
<tosReal_order>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    112f <tosReal_order+0x2f>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <tosReal_order+0x4a>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosReal_order>:
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tosReal_order(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fcmp ogt double %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ -1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @tosReal_order(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = fcmp ogt double %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int stbi__stdio_eof(void *user) {
  return feof((FILE *)user) || ferror((FILE *)user);
}


x86 assembly (clang, -O0):
<stbi__stdio_eof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <feof@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <stbi__stdio_eof+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__stdio_eof>:
push   %rbx
mov    %rdi,%rbx
call   1040 <feof@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <stbi__stdio_eof+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <ferror@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @stbi__stdio_eof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i64 @feof(i32* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i64 @ferror(i32* %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ true, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @stbi__stdio_eof(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @feof(i32* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i64 @ferror(i32* %2)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 1, %1 ], [ %8, %5 ]
ret i32 %10
}
int main() {
  int shift = sizeof(int) * 8 - 1;
  return (-1 >> shift) + 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1f,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
sar    %cl,%eax
add    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ f1(int, int);
void f2() { f1(1, 2); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <f1@plt>

LLVM IR (-O0):
define void @f2() {
%1 = call i32 @f1(i32 1, i32 2)
ret void
}

LLVM IR (-O2):
define void @f2() {
%1 = tail call i32 @f1(i32 1, i32 2)
ret void
}
unsigned char inb(unsigned short _port) {
  unsigned char data;
  asm volatile("inb %1, %0" : "=a"(data) : "Nd"(_port));
  return data;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
double sin(double);
int main() {
  double param, result;
  param = 30.0;
  result = sin(param * 3.14159265 / 180);
  printf("The sine of %f degrees is %f.\n", param, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"The sine of %f degrees is %f.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 3.000000e+01, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 0x400921FB53C8D4F1
%6 = fdiv double %5, 1.800000e+02
%7 = call double @sin(double %6)
store double %7, double* %3
%8 = load double, double* %2
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), double %8, double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"The sine of %f degrees is %f.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), double 3.000000e+01, double 0x3FDFFFFFFF719300)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ armUp();
int /*<<< orphan*/ backServoUp();
int /*<<< orphan*/ frontServoUp();
void initializeRobot() {
  armUp();
  frontServoUp();
  backServoUp();
  return;
}


x86 assembly (clang, -O0):
<initializeRobot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <armUp@plt>
mov    $0x0,%al
call   1030 <frontServoUp@plt>
mov    $0x0,%al
call   1040 <backServoUp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initializeRobot>:
push   %rax
xor    %eax,%eax
call   1050 <armUp@plt>
xor    %eax,%eax
call   1030 <frontServoUp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <backServoUp@plt>

LLVM IR (-O0):
define void @initializeRobot() {
%1 = call i32 (...) @armUp()
%2 = call i32 (...) @frontServoUp()
%3 = call i32 (...) @backServoUp()
ret void
}

LLVM IR (-O2):
define void @initializeRobot() {
%1 = tail call i32 (...) @armUp()
%2 = tail call i32 (...) @frontServoUp()
%3 = tail call i32 (...) @backServoUp()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hal_write(int, char *, int);
void console_putchar(char c) { hal_write(1, &c, 1); }


x86 assembly (clang, -O0):
<console_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <hal_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <hal_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @console_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @hal_write(i32 1, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @console_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @hal_write(i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  int age = 17;
  int width = 72;
  printf("I'm %d years old.\n", age);
  printf("And %d inches wide.\n", width);
  printf("Which is %f inches/year.\n", (double)width / age);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
movl   $0x48,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm0
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
movsd  0xec8(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"I'm %d years old.\0A\00"
@.str.1 = [21 x i8] c"And %d inches wide.\0A\00"
@.str.2 = [26 x i8] c"Which is %f inches/year.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 17, i32* %2
store i32 72, i32* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %5)
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = fdiv double %11, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"I'm %d years old.\0A\00"
@.str.1 = [21 x i8] c"And %d inches wide.\0A\00"
@.str.2 = [26 x i8] c"Which is %f inches/year.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 1.700000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 7.200000e+01)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double 0x4010F0F0F0F0F0F1)
ret i32 0
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *CString_strcpy(char *restrict dest, const char *restrict src) {
  return strcpy(dest, src);
}


x86 assembly (clang, -O0):
<CString_strcpy>:
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 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CString_strcpy>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define i8* @CString_strcpy(i8* noalias returned %0, i8* noalias nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
const char *CMUTIL_GetLibVersion() {
  static char *verstr = "LIBCMUTIL_VER_MAJOR"
                        "."
                        "LIBCMUTIL_VER_MINOR"
                        "."
                        "LIBCMUTIL_VER_PATCH";
  return verstr;
}


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

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

LLVM IR (-O0):
@CMUTIL_GetLibVersion.verstr = internal global i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i32 0, i32 0)
@.str = [60 x i8] c"LIBCMUTIL_VER_MAJOR.LIBCMUTIL_VER_MINOR.LIBCMUTIL_VER_PATCH\00"
define i8* @CMUTIL_GetLibVersion() {
%1 = load i8*, i8** @CMUTIL_GetLibVersion.verstr
ret i8* %1
}

LLVM IR (-O2):
@.str = [60 x i8] c"LIBCMUTIL_VER_MAJOR.LIBCMUTIL_VER_MINOR.LIBCMUTIL_VER_PATCH\00"
define i8* @CMUTIL_GetLibVersion() {
ret i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(unsigned long, int /*<<< orphan*/ *);
void store_u32(unsigned long x, FILE *f) {
  fputc(x >> 0, f);
  fputc(x >> 8, f);
  fputc(x >> 16, f);
  fputc(x >> 24, f);
}


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

x86 assembly (clang, -O2):
<store_u32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <fputc@plt>
mov    %rbx,%rdi
shr    $0x8,%rdi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %rbx,%rdi
shr    $0x10,%rdi
mov    %r14,%rsi
call   1030 <fputc@plt>
shr    $0x18,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @store_u32(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = lshr i64 %5, 0
%7 = load i32*, i32** %4
%8 = call i32 @fputc(i64 %6, i32* %7)
%9 = load i64, i64* %3
%10 = lshr i64 %9, 8
%11 = load i32*, i32** %4
%12 = call i32 @fputc(i64 %10, i32* %11)
%13 = load i64, i64* %3
%14 = lshr i64 %13, 16
%15 = load i32*, i32** %4
%16 = call i32 @fputc(i64 %14, i32* %15)
%17 = load i64, i64* %3
%18 = lshr i64 %17, 24
%19 = load i32*, i32** %4
%20 = call i32 @fputc(i64 %18, i32* %19)
ret void
}

LLVM IR (-O2):
define void @store_u32(i64 %0, i32* nocapture %1) {
%3 = tail call i32 @fputc(i64 %0, i32* %1)
%4 = lshr i64 %0, 8
%5 = tail call i32 @fputc(i64 %4, i32* %1)
%6 = lshr i64 %0, 16
%7 = tail call i32 @fputc(i64 %6, i32* %1)
%8 = lshr i64 %0, 24
%9 = tail call i32 @fputc(i64 %8, i32* %1)
ret void
}
/* Variables and functions */
scalar_t__ get_glyph_gen(char const *, char *, char, int /*<<< orphan*/, int,
                         char);
const char *get_glyph_quoted(const char *iptr, char *optr, char mchar) {
  return (const char *)get_glyph_gen(iptr, optr, mchar, 0, 1, '\\');
}


x86 assembly (clang, -O0):
<get_glyph_quoted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x5c,%r9d
movsbl -0x11(%rbp),%edx
call   1030 <get_glyph_gen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_glyph_quoted>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x5c,%r9d
jmp    1030 <get_glyph_gen@plt>

LLVM IR (-O0):
define i8* @get_glyph_quoted(i8* %0, i8* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8, i8* %6
%10 = call i64 @get_glyph_gen(i8* %7, i8* %8, i8 signext %9, i32 0, i32 1, i8 signext 92)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @get_glyph_quoted(i8* %0, i8* %1, i8 signext %2) {
%4 = tail call i64 @get_glyph_gen(i8* %0, i8* %1, i8 signext %2, i32 0, i32 1, i8 signext 92)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
struct sockaddr_storage {
  scalar_t__ ss_family;
};
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_port;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
};

/* Variables and functions */
scalar_t__ AF_INET;
unsigned short ntohs(int /*<<< orphan*/);
unsigned short get_in_port(struct sockaddr_storage *ss) {
  if (ss->ss_family == AF_INET) {
    return ntohs(((struct sockaddr_in *)ss)->sin_port);
  }
  return ntohs(((struct sockaddr_in6 *)ss)->sin6_port);
}


x86 assembly (clang, -O0):
<get_in_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2ebe(%rip),%rcx
cmp    (%rcx),%rax
jne    1147 <get_in_port+0x37>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohs@plt>
mov    %ax,-0x2(%rbp)
jmp    1156 <get_in_port+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohs@plt>
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_in_port>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.sockaddr_storage = type { i64 }
%struct.sockaddr_in = type { i32 }
%struct.sockaddr_in6 = type { i32 }
@AF_INET = global i64 0
define zeroext i16 @get_in_port(%struct.sockaddr_storage* %0) {
%2 = alloca i16
%3 = alloca %struct.sockaddr_storage*
store %struct.sockaddr_storage* %0, %struct.sockaddr_storage** %3
%4 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %3
%5 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @AF_INET
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %3
%11 = bitcast %struct.sockaddr_storage* %10 to %struct.sockaddr_in*
%12 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call zeroext i16 @ntohs(i32 %13)
store i16 %14, i16* %2
br label %21
15: ; preds = %1
%16 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %3
%17 = bitcast %struct.sockaddr_storage* %16 to %struct.sockaddr_in6*
%18 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %17, i32 0, i32 0
%19 = load i32, i32* %18
%20 = call zeroext i16 @ntohs(i32 %19)
store i16 %20, i16* %2
br label %21
21: ; preds = %15, %9
%22 = load i16, i16* %2
ret i16 %22
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i64 }
@AF_INET = global i64 0
define zeroext i16 @get_in_port(%struct.sockaddr_storage* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = tail call zeroext i16 @ntohs(i32 %4)
ret i16 %5
}
int f(int a[1][3][2]) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f([3 x [2 x i32]]* %0) {
%2 = alloca i32
%3 = alloca [3 x [2 x i32]]*
store [3 x [2 x i32]]* %0, [3 x [2 x i32]]** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @f([3 x [2 x i32]]* nocapture readnone %0) {
ret i32 undef
}
void tgl_warning(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @tgl_warning(i8* nocapture %0, ...) {
ret void
}