xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int y;
  int z;
  assume(x == y && x >= 0 && x + y + z == 0);
  while (x > 0) {
    x--;
    y--;
    z++;
    z++;
  }
  assert(z <= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    1161 <main+0x41>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jl     1161 <main+0x41>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x0,-0x8(%rbp)
jle    11a1 <main+0x81>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116e <main+0x4e>
cmpl   $0x0,-0x10(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %18
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
%17 = icmp eq i32 %16, 0
br label %18
18: ; preds = %11, %8, %0
%19 = phi i1 [ false, %8 ], [ false, %0 ], [ %17, %11 ]
%20 = zext i1 %19 to i32
%21 = call i32 @assume(i32 %20)
br label %22
22: ; preds = %25, %18
%23 = load i32, i32* %2
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %22
%26 = load i32, i32* %2
%27 = add nsw i32 %26, -1
store i32 %27, i32* %2
%28 = load i32, i32* %3
%29 = add nsw i32 %28, -1
store i32 %29, i32* %3
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %22
34: ; preds = %22
%35 = load i32, i32* %4
%36 = icmp sle i32 %35, 0
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
unsigned int convert_signed_char_to_unsigned_int(signed char x) { return x; }


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

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

LLVM IR (-O0):
define i32 @convert_signed_char_to_unsigned_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @convert_signed_char_to_unsigned_int(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
void audiohw_init() {}


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

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

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

LLVM IR (-O2):
define void @audiohw_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t mmio_readw(void *addr) { return *(volatile uint16_t *)addr; }


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

x86 assembly (clang, -O2):
<mmio_readw>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @mmio_readw(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
int execv(const char *path, char *const argv[]) {
  ;
  typeof(execv) *orig_execv = osym("execv");
  interpose_fini();
  int rc = (*orig_execv)(path, argv);
  interpose_init();
  return rc;
}


x86 assembly (clang, -O0):
<execv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1050 <osym@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <interpose_fini@plt>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <interpose_init@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execv>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1050 <osym@plt>
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <interpose_fini@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   *%rbx
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <interpose_init@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"execv\00"
define i32 @execv(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32 (i8*, i8**)*
%6 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @osym to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32 (i8*, i8**)*
store i32 (i8*, i8**)* %9, i32 (i8*, i8**)** %5
%10 = call i32 (...) @interpose_fini()
%11 = load i32 (i8*, i8**)*, i32 (i8*, i8**)** %5
%12 = load i8*, i8** %3
%13 = load i8**, i8*** %4
%14 = call i32 %11(i8* %12, i8** %13)
store i32 %14, i32* %6
%15 = call i32 (...) @interpose_init()
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
@.str = [6 x i8] c"execv\00"
define i32 @execv(i8* %0, i8** %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @osym to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32 (i8*, i8**)*
%6 = tail call i32 (...) @interpose_fini()
%7 = tail call i32 %5(i8* %0, i8** %1)
%8 = tail call i32 (...) @interpose_init()
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ __strtoul_internal(char const *, char **, int,
                                      int /*<<< orphan*/);
uintmax_t strtoumax(const char *__restrict nptr, char **__restrict endptr,
                    int base) {
  return __strtoul_internal(nptr, endptr, base, 0);
}


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

x86 assembly (clang, -O2):
<strtoumax>:
xor    %ecx,%ecx
jmp    1030 <__strtoul_internal@plt>

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

LLVM IR (-O2):
define i32 @strtoumax(i8* noalias %0, i8** noalias %1, i32 %2) {
%4 = tail call i32 @__strtoul_internal(i8* %0, i8** %1, i32 %2, i32 0)
ret i32 %4
}
cbuf21(f, n) { return (cbuf(f, n, 21)); }


x86 assembly (clang, -O0):
<cbuf21>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x15,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf21>:
mov    $0x15,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf21(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 21)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf21(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 21)
ret i32 %3
}
unsigned long UARTParityModeGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x0000002C))) &
          (0x00000080 | 0x00000004 | 0x00000002));
}


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

x86 assembly (clang, -O2):
<UARTParityModeGet>:
mov    0x2c(%rdi),%rax
and    $0x86,%eax
ret

LLVM IR (-O0):
define i64 @UARTParityModeGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 44
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 134
ret i64 %7
}

LLVM IR (-O2):
define i64 @UARTParityModeGet(i64 %0) {
%2 = add i64 %0, 44
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 134
ret i64 %5
}
extern char const *impl_name(void) { return "libc"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"libc\00"
define i8* @impl_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_AVTransport_Previous(struct UPnPService *Service,
                                          int ErrorCode, void *User) {
  printf("RND Invoke Response: AVTransport/Previous[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_AVTransport_Previous>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [60 x i8] c"RND Invoke Response: AVTransport/Previous[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_AVTransport_Previous(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [60 x i8] c"RND Invoke Response: AVTransport/Previous[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_AVTransport_Previous(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, openwrt!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Hello, openwrt!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Hello, openwrt!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t position_highest_bit(size_t x) {
  size_t i = 0;
  for (; x != 0; i++, x >>= 1)
    ;
  return i;
}


x86 assembly (clang, -O0):
<position_highest_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113d <position_highest_bit+0x3d>
jmp    1120 <position_highest_bit+0x20>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <position_highest_bit+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<position_highest_bit>:
xor    %eax,%eax
test   %rdi,%rdi
je     1120 <position_highest_bit+0x20>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <position_highest_bit+0x10>
ret

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

LLVM IR (-O2):
define i64 @position_highest_bit(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i64 %4, 1
%7 = lshr i64 %5, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %10
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ depth(struct TreeNode *, int *);
bool isBalanced(struct TreeNode *root) {
  bool balance = true;
  depth(root, &balance);
  return balance;
}


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

x86 assembly (clang, -O2):
<isBalanced>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <depth@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @isBalanced(%struct.TreeNode* %0) {
%2 = alloca %struct.TreeNode*
%3 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %2
store i32 1, i32* %3
%4 = load %struct.TreeNode*, %struct.TreeNode** %2
%5 = call i32 @depth(%struct.TreeNode* %4, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @isBalanced(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = call i32 @depth(%struct.TreeNode* %0, i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int exact_square(unsigned int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned int num;
  do
    scanf("%u", &num);
  while (num <= 0);
  printf("%d", (exact_square(num)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jbe    113f <main+0xf>
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     1140 <main+0x10>
call   1040 <exact_square@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = call i32 @exact_square(i32 %5)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
unsigned xrop3_208_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S | stk3;
  stk1 = T & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_208_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_208_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
lea    0xff00(%rdi),%edx
and    %ecx,%edx
not    %eax
and    %edx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_208_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_208_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %3, 65280
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = and i32 %9, %6
%11 = or i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int key = getch();
  printf("\nYou typed: %d\n", key);
  printf("\nYou typed: %c\n", key);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"\0AYou typed: %d\0A\00"
@.str.1 = [16 x i8] c"\0AYou typed: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getch()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AYou typed: %d\0A\00"
@.str.1 = [16 x i8] c"\0AYou typed: %c\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getch()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
int _eql(int x, int y, void *garb) { return x == y; }


x86 assembly (clang, -O0):
<_eql>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eql>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @_eql(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_eql(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp eq i32 %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_length(int *);
int main() {
  int my_int_array[] = {1, 2, 3, 4, 5, 6, 7, 8};
  print_length(my_int_array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <print_length@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <print_length@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.my_int_array = [8 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
store i32 0, i32* %1
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 @print_length(i32* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.my_int_array = [8 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_length(i32* %3)
ret i32 0
}
double f_double() {
  double d;
  d = 987.654;
  return d;
}


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

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

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

LLVM IR (-O2):
define double @f_double() {
ret double 0x408EDD3B645A1CAC
}
/* Variables and functions */
int /*<<< orphan*/ initgui_(int *, int *, int *, int *, int *, char *);
void INITGUI(int *model, int *debug, int *lats, int *mrpid, int *mrnum,
             char *plan) {
  initgui_(model, debug, lats, mrpid, mrnum, plan);
}


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

x86 assembly (clang, -O2):
<INITGUI>:
jmp    1030 <initgui_@plt>

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

LLVM IR (-O2):
define void @INITGUI(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i8* %5) {
%7 = tail call i32 @initgui_(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i8* %5)
ret void
}
void SPIDmaDisable(unsigned long ulBase, unsigned long ulFlags) {
  (*((volatile unsigned long *)(ulBase + 0x0000012C))) &= ~ulFlags;
}


x86 assembly (clang, -O0):
<SPIDmaDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x12c(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x12c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIDmaDisable>:
not    %rsi
and    %rsi,0x12c(%rdi)
ret

LLVM IR (-O0):
define void @SPIDmaDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 300
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @SPIDmaDisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 300
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int16_t crop_i16(int16_t val, int16_t min, int16_t max) {
  if (val < min)
    return min;
  if (val > max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<crop_i16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    112b <crop_i16+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <crop_i16+0x4e>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1146 <crop_i16+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <crop_i16+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crop_i16>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @crop_i16(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
int Columbusday(int monthStartDOW) {
  if ((monthStartDOW == 0) || (monthStartDOW == 1)) {
    return (9 - monthStartDOW);
  } else {
    return (16 - monthStartDOW);
  }
}


x86 assembly (clang, -O0):
<Columbusday>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111b <Columbusday+0x1b>
cmpl   $0x1,-0x8(%rbp)
jne    112b <Columbusday+0x2b>
mov    $0x9,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <Columbusday+0x36>
mov    $0x10,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Columbusday>:
cmp    $0x2,%edi
mov    $0x9,%ecx
mov    $0x10,%eax
cmovb  %ecx,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Columbusday(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = select i1 %2, i32 9, i32 16
%4 = sub nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void handle_log(void *context, const char *message, size_t message_len) {
  printf("handle_log: %s\n", message);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"handle_log: %s\0A\00"
define void @handle_log(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"handle_log: %s\0A\00"
define void @handle_log(i8* nocapture readnone %0, i8* %1, i64 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t my_bswap32(uint32_t x) {
  uint32_t result = 0;
  int shift;
  for (shift = 0; shift < 8 * sizeof(uint32_t); shift += 8) {
    result <<= 8;
    result |= (x >> shift) & 0xff;
  }
  return result;
}


x86 assembly (clang, -O0):
<my_bswap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x20,%rax
jae    114d <my_bswap32+0x4d>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0xff,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <my_bswap32+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @my_bswap32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 32
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i32, i32* %3
%11 = shl i32 %10, 8
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = ashr i32 %12, %13
%15 = and i32 %14, 255
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
br label %18
18: ; preds = %9
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 8
store i32 %20, i32* %4
br label %5
21: ; preds = %5
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @my_bswap32(i32 %0) {
%2 = call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t op_xor(uint32_t a, uint32_t b) { return a ^ b; }


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

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

LLVM IR (-O0):
define i32 @op_xor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = xor i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @op_xor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
long leq(unsigned long a, unsigned long b) { return a <= b; }


x86 assembly (clang, -O0):
<leq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<leq>:
xor    %eax,%eax
cmp    %rsi,%rdi
setbe  %al
ret

LLVM IR (-O0):
define i64 @leq(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 ule i64 %5, %6
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @leq(i64 %0, i64 %1) {
%3 = icmp ule i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
/* Variables and functions */
int __libc_close(int);
int /*<<< orphan*/ pthread_testcancel();
int close(int fd) {
  pthread_testcancel();
  return __libc_close(fd);
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pthread_testcancel@plt>
mov    -0x4(%rbp),%edi
call   1040 <__libc_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <pthread_testcancel@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <__libc_close@plt>

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pthread_testcancel()
%4 = load i32, i32* %2
%5 = call i32 @__libc_close(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 (...) @pthread_testcancel()
%3 = tail call i32 @__libc_close(i32 %0)
ret i32 %3
}
/* Type definitions */
typedef char *ssize_t;

/* Variables and functions */
char *set_errno(int);
ssize_t read(int fd, void *buffer, size_t length) {
  int r;
  __asm__ __volatile__("\tmov $3, %%eax\n"
                       "\tint $0x80\n"
                       : "=a"(r)
                       : "b"(fd), "c"(buffer), "d"(length)
                       : "memory");
  return set_errno(r);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x28,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    $0x3,%eax
int    $0x80
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <set_errno@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%ebx
mov    $0x3,%eax
int    $0x80
mov    %eax,%edi
pop    %rbx
jmp    1030 <set_errno@plt>

LLVM IR (-O0):
define i8* @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 asm sideeffect "\09mov $$3, %eax\0A\09int $$0x80\0A", "={ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i8* @set_errno(i32 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 asm sideeffect "\09mov $$3, %eax\0A\09int $$0x80\0A", "={ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
%5 = tail call i8* @set_errno(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(int);
int /*<<< orphan*/ isupper(int);
int hash_elem(int c) {
  if (!isalpha(c) || !isupper(c))
    return -1;
  return c - 'A';
}


x86 assembly (clang, -O0):
<hash_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%eax
je     114d <hash_elem+0x2d>
mov    -0x8(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
jne    1159 <hash_elem+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <hash_elem+0x42>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_elem>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %eax,%eax
je     113f <hash_elem+0x1f>
mov    %ebx,%edi
call   1040 <isupper@plt>
add    $0xffffffbf,%ebx
cmp    $0x1,%eax
sbb    %eax,%eax
or     %ebx,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @hash_elem(i32 %0) {
%2 = tail call i32 @isalpha(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @isupper(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %0, -65
%8 = select i1 %6, i32 -1, i32 %7
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ -1, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int usage(char *name) {
  fprintf(stderr, "Usage: %s <port> <delay_sec> [max_packets]\n",
          basename(name));
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
call   1040 <basename@plt>
lea    0xeca(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: %s <port> <delay_sec> [max_packets]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i8* @basename(i8* %4)
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: %s <port> <delay_sec> [max_packets]\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* @basename(i8* %0)
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}
int marker1() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @marker1() {
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_event_source_set_prepare(void *s, void *callback) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_event_source_set_prepare>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_source_set_prepare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_source_set_prepare(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void bar_t03() { struct type_t03 *var; }


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

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

LLVM IR (-O0):
%struct.type_t03 = type opaque
define void @bar_t03() {
%1 = alloca %struct.type_t03*
ret void
}

LLVM IR (-O2):
%struct.type_t03 = type opaque
define void @bar_t03() {
ret void
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int chislo;
  scanf("%d", &chislo);
  printf("%d", is_prime(chislo));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <is_prime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int compare_stringv2(void *a, void *b) {
  char **c = a;
  char **d = b;
  return strcmp(*c, *d);
}


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

x86 assembly (clang, -O2):
<compare_stringv2>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare_stringv2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_stringv2(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ eeprom_read_word(scalar_t__ *);
int /*<<< orphan*/ eeprom_write_word(scalar_t__ *, scalar_t__);
void eeprom_update_word(uint16_t *addr, uint16_t value) {
  uint16_t orig = eeprom_read_word(addr);
  if (orig != value) {
    eeprom_write_word(addr, value);
  }
}


x86 assembly (clang, -O0):
<eeprom_update_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <eeprom_read_word@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1158 <eeprom_update_word+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <eeprom_write_word@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_update_word>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <eeprom_read_word@plt>
cmp    %r14,%rax
jne    113c <eeprom_update_word+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <eeprom_write_word@plt>

LLVM IR (-O0):
define void @eeprom_update_word(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = call i64 @eeprom_read_word(i64* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i64*, i64** %3
%13 = load i64, i64* %4
%14 = call i32 @eeprom_write_word(i64* %12, i64 %13)
br label %15
15: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @eeprom_update_word(i64* %0, i64 %1) {
%3 = tail call i64 @eeprom_read_word(i64* %0)
%4 = icmp eq i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @eeprom_write_word(i64* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret void
}