xunge/DecIR huggingface dataset:
unsigned int UARTParityModeGet(unsigned int baseAdd) {
  unsigned int mask;
  mask = ((0x00000008u) | (0x00000010u) | (0x00000020u));
  return ((*((volatile unsigned int *)(baseAdd + (0xC)))) & mask);
}


x86 assembly (clang, -O0):
<UARTParityModeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x38,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeGet>:
add    $0xc,%edi
mov    (%rdi),%eax
and    $0x38,%eax
ret

LLVM IR (-O0):
define i32 @UARTParityModeGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 56, i32* %3
%4 = load i32, i32* %2
%5 = add i32 %4, 12
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = load i32, i32* %3
%10 = and i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @UARTParityModeGet(i32 %0) {
%2 = add i32 %0, 12
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 56
ret i32 %6
}
void gtk_text_buffer_set_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_set_text() {
ret void
}
void gtk_tree_view_set_reorderable() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_reorderable() {
ret void
}
unsigned psi_get_uint16_le(const void *buf, unsigned idx) {
  unsigned val;
  const unsigned char *tmp;
  tmp = (const unsigned char *)buf + idx;
  val = tmp[1] & 0xff;
  val = (val << 8) | (tmp[0] & 0xff);
  return (val);
}


x86 assembly (clang, -O0):
<psi_get_uint16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_get_uint16_le>:
mov    %esi,%eax
movzwl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @psi_get_uint16_le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = and i32 %14, 255
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = shl i32 %16, 8
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = and i32 %21, 255
%23 = or i32 %17, %22
store i32 %23, i32* %5
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @psi_get_uint16_le(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = or i32 %8, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __get_cpuid(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main(void) {
  uint32_t a, b, c, d;
  __get_cpuid(1, &a, &b, &c, &d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <__get_cpuid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x1,%edi
call   1030 <__get_cpuid@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @__get_cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
pid_t fork_and_exit(void) {
  pid_t pid;
  if ((pid = fork()) > 0) {
    _exit(EXIT_SUCCESS);
  }
  return pid;
}


x86 assembly (clang, -O0):
<fork_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    1149 <fork_and_exit+0x29>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_and_exit>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
jg     112e <fork_and_exit+0xe>
pop    %rcx
ret
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @fork_and_exit() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @_exit(i32 %5)
unreachable
7: ; preds = %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @fork_and_exit() {
%1 = tail call i32 (...) @fork()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @_exit(i32 %4)
unreachable
6: ; preds = %0
ret i32 %1
}
void foo295(int p) {}


x86 assembly (clang, -O0):
<foo295>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo295(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void usage() { exit(-1); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @usage() {
%1 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @usage() {
%1 = tail call i32 @exit(i32 -1)
unreachable
}
void YUY2ToYRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToYRow_NEON() {
ret void
}
void print_integer(value, flag) unsigned int value;
int flag;
{
  if (flag)
    tx_printf("#%02x", value);
  else
    tx_printf("#%04x", value);
}


x86 assembly (clang, -O0):
<print_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113e <print_integer+0x2e>
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <tx_printf@plt>
jmp    114f <print_integer+0x3f>
mov    -0x4(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <tx_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_integer>:
mov    %edi,%eax
test   %esi,%esi
lea    0xeeb(%rip),%rcx
lea    0xede(%rip),%rdi
cmove  %rcx,%rdi
mov    %eax,%esi
xor    %eax,%eax
jmp    1030 <tx_printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"#%02x\00"
@.str.1 = [6 x i8] c"#%04x\00"
define void @print_integer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @tx_printf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @tx_printf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"#%02x\00"
@.str.1 = [6 x i8] c"#%04x\00"
define void @print_integer(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @tx_printf to i32 (i8*, i32, ...)*)(i8* %4, i32 %0)
ret void
}
void BsdFragHashCleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @BsdFragHashCleanup() {
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
char toupper(char);
char *strupr(char *ioString) {
  int i;
  int theLength = (int)strlen(ioString);
  for (i = 0; i < theLength; ++i) {
    ioString[i] = toupper(ioString[i]);
  }
  return ioString;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1177 <strupr+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <strupr+0x1f>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    1157 <strupr+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <strupr+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = and i64 %2, 4294967295
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Flush_Buffer32();
unsigned int Show_Bits(int);
unsigned int Get_Bits32(void) {
  unsigned int l;
  l = Show_Bits(32);
  Flush_Buffer32();
  return l;
}


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

x86 assembly (clang, -O2):
<Get_Bits32>:
push   %rbx
mov    $0x20,%edi
call   1030 <Show_Bits@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <Flush_Buffer32@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Get_Bits32() {
%1 = alloca i32
%2 = call i32 @Show_Bits(i32 32)
store i32 %2, i32* %1
%3 = call i32 (...) @Flush_Buffer32()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @Get_Bits32() {
%1 = tail call i32 @Show_Bits(i32 32)
%2 = tail call i32 (...) @Flush_Buffer32()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_idxset_first() {
  printf("NOT IMPLEMENTED:"
         "pa_idxset_first"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_idxset_first\0A\00"
define i32 @pa_idxset_first() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_idxset_first\00"
define i32 @pa_idxset_first() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memory_free_block_alloc(void *, void *);
void memory_initialize() {
  memory_free_block_alloc((void *)0x010F0000, (void *)0x01FFFFFF);
}


x86 assembly (clang, -O0):
<memory_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10f0000,%edi
mov    $0x1ffffff,%esi
call   1030 <memory_free_block_alloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_initialize>:
mov    $0x10f0000,%edi
mov    $0x1ffffff,%esi
jmp    1030 <memory_free_block_alloc@plt>

LLVM IR (-O0):
define void @memory_initialize() {
%1 = call i32 @memory_free_block_alloc(i8* inttoptr (i64 17760256 to i8*), i8* inttoptr (i64 33554431 to i8*))
ret void
}

LLVM IR (-O2):
define void @memory_initialize() {
%1 = tail call i32 @memory_free_block_alloc(i8* inttoptr (i64 17760256 to i8*), i8* inttoptr (i64 33554431 to i8*))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t uint24_encode(uint32_t value, uint8_t *p_encoded_data) {
  p_encoded_data[0] = (uint8_t)((value & 0x000000FF) >> 0);
  p_encoded_data[1] = (uint8_t)((value & 0x0000FF00) >> 8);
  p_encoded_data[2] = (uint8_t)((value & 0x00FF0000) >> 16);
  return 3;
}


x86 assembly (clang, -O0):
<uint24_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
sar    $0x0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint24_encode>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,(%rsi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rsi)
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,0x8(%rsi)
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @uint24_encode(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 = and i32 %5, 255
%7 = ashr i32 %6, 0
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %3
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %3
%16 = and i32 %15, 16711680
%17 = ashr i32 %16, 16
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
ret i32 3
}

LLVM IR (-O2):
define i32 @uint24_encode(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
store i32 %3, i32* %1
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %8, i32* %9
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int strlen(char *);
void setValue(char *pSource, char dest[]) {
  memset(dest, 0, 256);
  int length = (strlen(pSource) < 256 - 1) ? strlen(pSource) : (256 - 1);
  memcpy(dest, pSource, length);
}


x86 assembly (clang, -O0):
<setValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xff,%eax
jge    1175 <setValue+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
jmp    1182 <setValue+0x52>
mov    $0xff,%eax
mov    %eax,-0x18(%rbp)
jmp    1182 <setValue+0x52>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setValue>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0xff,%edx
cmp    $0xfe,%eax
jg     1167 <setValue+0x37>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <memcpy@plt>

LLVM IR (-O0):
define void @setValue(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @memset(i8* %6, i32 0, i32 256)
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = icmp slt i32 %9, 255
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @strlen(i8* %12)
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %11
%16 = phi i32 [ %13, %11 ], [ 255, %14 ]
store i32 %16, i32* %5
%17 = load i8*, i8** %4
%18 = load i8*, i8** %3
%19 = load i32, i32* %5
%20 = call i32 @memcpy(i8* %17, i8* %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @setValue(i8* %0, i8* %1) {
%3 = tail call i32 @memset(i8* %1, i32 0, i32 256)
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, 255
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %0)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 255, %2 ]
%10 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %9)
ret void
}
char *new_symbol(const char *s, unsigned int length) {
  char *new = zalloc(length + 1);
  if (!new) {

    return (void *)0;
  }
  extract_string(s, length, new, length);
  return new;
}


x86 assembly (clang, -O0):
<new_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
mov    $0x0,%al
call   1040 <zalloc@plt>
cltq
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115a <new_symbol+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    1177 <new_symbol+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x0,%al
call   1030 <extract_string@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_symbol>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r15
lea    0x1(%rbx),%edi
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <zalloc@plt>
test   %eax,%eax
je     114f <new_symbol+0x2f>
movslq %eax,%r14
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <extract_string@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @new_symbol(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = add i32 %7, 1
%9 = call i32 (i32, ...) bitcast (i32 (...)* @zalloc to i32 (i32, ...)*)(i32 %8)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %2
store i8* null, i8** %3
br label %22
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = load i8*, i8** %6
%19 = load i32, i32* %5
%20 = call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @extract_string to i32 (i8*, i32, i8*, i32, ...)*)(i8* %16, i32 %17, i8* %18, i32 %19)
%21 = load i8*, i8** %6
store i8* %21, i8** %3
br label %22
22: ; preds = %15, %14
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @new_symbol(i8* %0, i32 %1) {
%3 = add i32 %1, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @zalloc to i32 (i32, ...)*)(i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i32 %4, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @extract_string to i32 (i8*, i32, i8*, i32, ...)*)(i8* %0, i32 %1, i8* %6, i32 %1)
br label %10
10: ; preds = %2, %8
%11 = phi i8* [ %6, %8 ], [ null, %2 ]
ret i8* %11
}
char *strcat(char *dst, const char *src) {
  char *tmp = dst;
  while (*tmp++)
    ;
  tmp--;
  while (((*tmp++) = (*src++)))
    ;
  return dst;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmpb   $0x0,(%rax)
je     1131 <strcat+0x31>
jmp    1114 <strcat+0x14>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     116c <strcat+0x6c>
jmp    113d <strcat+0x3d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Type definitions */
struct stat {
  unsigned long st_size;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int install_file_size(const char *file, unsigned long *size) {
  struct stat sb;
  if (stat(file, &sb) == -1)
    return 0;
  *size = sb.st_size;
  return 1;
}


x86 assembly (clang, -O0):
<install_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    1142 <install_file_size+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1154 <install_file_size+0x44>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<install_file_size>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1136 <install_file_size+0x26>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
mov    $0x1,%eax
jmp    1138 <install_file_size+0x28>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @install_file_size(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i32 @stat(i8* %0, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i64, i64* %8
store i64 %9, i64* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %11
}
void fn1(int a) {
  if ((a > a))
    ;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1118 <fn1+0x18>
jmp    1118 <fn1+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fn1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @fn1(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
void accept_info_reply(u_int32_t src, u_int32_t dst, u_char *p, int datalen) {}


x86 assembly (clang, -O0):
<accept_info_reply>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @accept_info_reply(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @accept_info_reply(i32 %0, i32 %1, i32* nocapture %2, i32 %3) {
ret void
}
void IOInitSemaphores() {}


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

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

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

LLVM IR (-O2):
define void @IOInitSemaphores() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ slip_outbuf(int);
void slip_begin(void) { slip_outbuf(0xC0); }


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

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

LLVM IR (-O0):
define void @slip_begin() {
%1 = call i32 @slip_outbuf(i32 192)
ret void
}

LLVM IR (-O2):
define void @slip_begin() {
%1 = tail call i32 @slip_outbuf(i32 192)
ret void
}
int aug_plugin_api_version_minor() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @aug_plugin_api_version_minor() {
ret i32 0
}
int zm_dacs(struct zt_chan *chan1, struct zt_chan *chan2) {}


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

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

LLVM IR (-O0):
%struct.zt_chan = type opaque
define i32 @zm_dacs(%struct.zt_chan* %0, %struct.zt_chan* %1) {
%3 = alloca i32
%4 = alloca %struct.zt_chan*
%5 = alloca %struct.zt_chan*
store %struct.zt_chan* %0, %struct.zt_chan** %4
store %struct.zt_chan* %1, %struct.zt_chan** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.zt_chan = type opaque
define i32 @zm_dacs(%struct.zt_chan* nocapture readnone %0, %struct.zt_chan* nocapture readnone %1) {
ret i32 undef
}
int main() {
  int arg1 = 5;
  int arg2 = 9;
  int xor = 0;
  __asm__("xorl %%ebx, %%eax;" : "=a"(xor) : "a"(arg1), "b"(arg2));
  return xor;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x9,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ebx
xor    %ebx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%eax
mov    $0x9,%ebx
xor    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 9, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm "xorl %ebx, %eax;", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "xorl %ebx, %eax;", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 5, i32 9)
ret i32 %1
}
/* Variables and functions */
long atoi(char *);
int log2ui(long);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  long x = atoi(argv[1]);
  printf("%d\n", log2ui(x));
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <log2ui@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %rax,%rdi
call   1030 <log2ui@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i64 @atoi(i8* %9)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = call i32 @log2ui(i64 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @atoi(i8* %4)
%6 = tail call i32 @log2ui(i64 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ my_malloc(int);
double *create_nvector(long n) {
  double *vector;
  vector = (double *)my_malloc(sizeof(double) * (n + 1));
  return (vector);
}


x86 assembly (clang, -O0):
<create_nvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <my_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_nvector>:
lea    0x8(,%rdi,8),%edi
jmp    1030 <my_malloc@plt>

LLVM IR (-O0):
define double* @create_nvector(i64 %0) {
%2 = alloca i64
%3 = alloca double*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add nsw i64 %4, 1
%6 = mul i64 8, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @my_malloc(i32 %7)
%9 = inttoptr i64 %8 to double*
store double* %9, double** %3
%10 = load double*, double** %3
ret double* %10
}

LLVM IR (-O2):
define double* @create_nvector(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 3
%4 = add i32 %3, 8
%5 = tail call i64 @my_malloc(i32 %4)
%6 = inttoptr i64 %5 to double*
ret double* %6
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plainstring_equals_double(struct plainstring const *,
                                             double);
int plainstring_not_equals_double(const struct plainstring *this_string,
                                  double d) {
  return (!plainstring_equals_double(this_string, d));
}


x86 assembly (clang, -O0):
<plainstring_not_equals_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <plainstring_equals_double@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_not_equals_double>:
push   %rax
call   1030 <plainstring_equals_double@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define i32 @plainstring_not_equals_double(%struct.plainstring* %0, double %1) {
%3 = alloca %struct.plainstring*
%4 = alloca double
store %struct.plainstring* %0, %struct.plainstring** %3
store double %1, double* %4
%5 = load %struct.plainstring*, %struct.plainstring** %3
%6 = load double, double* %4
%7 = call i32 @plainstring_equals_double(%struct.plainstring* %5, double %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define i32 @plainstring_not_equals_double(%struct.plainstring* %0, double %1) {
%3 = tail call i32 @plainstring_equals_double(%struct.plainstring* %0, double %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  long tv_usec;
};

/* Variables and functions */
long _tvdiff(struct timeval old, struct timeval new) {
  long udiff = 0;
  if (old.tv_sec != new.tv_sec)
    udiff = (new.tv_sec - old.tv_sec) * 1000000;
  return (new.tv_usec - old.tv_usec) + udiff;
}


x86 assembly (clang, -O0):
<_tvdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     113d <_tvdiff+0x3d>
mov    -0x20(%rbp),%rax
sub    -0x10(%rbp),%rax
imul   $0xf4240,%rax,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
add    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tvdiff>:
mov    %rdx,%rax
sub    %rdi,%rax
imul   $0xf4240,%rax,%r8
xor    %eax,%eax
cmp    %rdi,%rdx
cmovne %r8,%rax
sub    %rsi,%rcx
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @_tvdiff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, %0
%6 = sub nsw i64 %2, %0
%7 = mul nsw i64 %6, 1000000
%8 = select i1 %5, i64 0, i64 %7
%9 = sub i64 %3, %1
%10 = add nsw i64 %9, %8
ret i64 %10
}
void av_aes_ctr_increment_iv() {}


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

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

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

LLVM IR (-O2):
define void @av_aes_ctr_increment_iv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmove_lc_1a1t_b();
int /*<<< orphan*/ gmove_lc_1a1t_b_h();
int /*<<< orphan*/ gmove_lc_1a1t_bc();
int /*<<< orphan*/ gmove_lc_1a1t_c();
int /*<<< orphan*/ gmove_lc_1a1t_c_h();
int /*<<< orphan*/ gmove_lc_1a1t_gb();
int main() {
  gmove_lc_1a1t_b();
  gmove_lc_1a1t_bc();
  gmove_lc_1a1t_b_h();
  gmove_lc_1a1t_c();
  gmove_lc_1a1t_c_h();
  gmove_lc_1a1t_gb();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gmove_lc_1a1t_b@plt>
mov    $0x0,%al
call   1050 <gmove_lc_1a1t_bc@plt>
mov    $0x0,%al
call   1060 <gmove_lc_1a1t_b_h@plt>
mov    $0x0,%al
call   1080 <gmove_lc_1a1t_c@plt>
mov    $0x0,%al
call   1030 <gmove_lc_1a1t_c_h@plt>
mov    $0x0,%al
call   1070 <gmove_lc_1a1t_gb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <gmove_lc_1a1t_b@plt>
xor    %eax,%eax
call   1050 <gmove_lc_1a1t_bc@plt>
xor    %eax,%eax
call   1060 <gmove_lc_1a1t_b_h@plt>
xor    %eax,%eax
call   1080 <gmove_lc_1a1t_c@plt>
xor    %eax,%eax
call   1030 <gmove_lc_1a1t_c_h@plt>
xor    %eax,%eax
call   1070 <gmove_lc_1a1t_gb@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gmove_lc_1a1t_b()
%3 = call i32 (...) @gmove_lc_1a1t_bc()
%4 = call i32 (...) @gmove_lc_1a1t_b_h()
%5 = call i32 (...) @gmove_lc_1a1t_c()
%6 = call i32 (...) @gmove_lc_1a1t_c_h()
%7 = call i32 (...) @gmove_lc_1a1t_gb()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gmove_lc_1a1t_b()
%2 = tail call i32 (...) @gmove_lc_1a1t_bc()
%3 = tail call i32 (...) @gmove_lc_1a1t_b_h()
%4 = tail call i32 (...) @gmove_lc_1a1t_c()
%5 = tail call i32 (...) @gmove_lc_1a1t_c_h()
%6 = tail call i32 (...) @gmove_lc_1a1t_gb()
ret i32 0
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzFetch_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ SEND_REQDOWN_DELAYED(int, int /*<<< orphan*/);
void BrzFetch_ackdown(struct comp *comp, int port) {
  struct BrzFetch_ *c = (struct BrzFetch_ *)comp;
  switch (port) {
  case 1:
    SEND_REQDOWN_DELAYED(2, 0);
    break;
  case 2:
    SEND_ACKDOWN_DELAYED(0, 0);
    break;
  }
}


x86 assembly (clang, -O0):
<BrzFetch_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     115c <BrzFetch_ackdown+0x3c>
jmp    114b <BrzFetch_ackdown+0x2b>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     116d <BrzFetch_ackdown+0x4d>
jmp    1176 <BrzFetch_ackdown+0x56>
mov    $0x2,%edi
xor    %esi,%esi
call   1040 <SEND_REQDOWN_DELAYED@plt>
jmp    1176 <BrzFetch_ackdown+0x56>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzFetch_ackdown>:
cmp    $0x2,%esi
je     1136 <BrzFetch_ackdown+0x16>
cmp    $0x1,%esi
jne    113f <BrzFetch_ackdown+0x1f>
mov    $0x2,%edi
xor    %esi,%esi
jmp    1040 <SEND_REQDOWN_DELAYED@plt>
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <SEND_ACKDOWN_DELAYED@plt>
ret

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzFetch_ = type { i32 }
define void @BrzFetch_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzFetch_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzFetch_*
store %struct.BrzFetch_* %7, %struct.BrzFetch_** %5
%8 = load i32, i32* %4
switch i32 %8, label %13 [
i32 1, label %9
i32 2, label %11
]
9: ; preds = %2
%10 = call i32 @SEND_REQDOWN_DELAYED(i32 2, i32 0)
br label %13
11: ; preds = %2
%12 = call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 0)
br label %13
13: ; preds = %2, %11, %9
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzFetch_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
switch i32 %1, label %7 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = tail call i32 @SEND_REQDOWN_DELAYED(i32 2, i32 0)
br label %7
5: ; preds = %2
%6 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 0)
br label %7
7: ; preds = %2, %5, %3
ret void
}
/* Type definitions */
struct syslog_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
void closelog_r(struct syslog_data *a) {
  (void)a;
  StubBug("STUB:"
          "closelog_r");
}


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

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

LLVM IR (-O0):
%struct.syslog_data = type { i32 }
@.str = [16 x i8] c"STUB:closelog_r\00"
define void @closelog_r(%struct.syslog_data* %0) {
%2 = alloca %struct.syslog_data*
store %struct.syslog_data* %0, %struct.syslog_data** %2
%3 = load %struct.syslog_data*, %struct.syslog_data** %2
%4 = call i32 @StubBug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.syslog_data = type { i32 }
@.str = [16 x i8] c"STUB:closelog_r\00"
define void @closelog_r(%struct.syslog_data* nocapture readnone %0) {
%2 = tail call i32 @StubBug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(struct tm *, struct tm *, int);
struct tm *localtime_r(const time_t *t, struct tm *r) {
  struct tm *temp;
  temp = localtime(t);
  memcpy(r, temp, sizeof(struct tm));
  return (r);
}


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

x86 assembly (clang, -O2):
<localtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca i32*
%4 = alloca %struct.tm*
%5 = alloca %struct.tm*
store i32* %0, i32** %3
store %struct.tm* %1, %struct.tm** %4
%6 = load i32*, i32** %3
%7 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %7, %struct.tm** %5
%8 = load %struct.tm*, %struct.tm** %4
%9 = load %struct.tm*, %struct.tm** %5
%10 = call i32 @memcpy(%struct.tm* %8, %struct.tm* %9, i32 4)
%11 = load %struct.tm*, %struct.tm** %4
ret %struct.tm* %11
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* returned %1) {
%3 = tail call %struct.tm* @localtime(i32* %0)
%4 = tail call i32 @memcpy(%struct.tm* %1, %struct.tm* %3, i32 4)
ret %struct.tm* %1
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned getTime(void) {
  unsigned time;
  struct timeval tv;
  gettimeofday(&tv, NULL);
  time = (unsigned)(tv.tv_sec * 1000 + tv.tv_usec);
  return time;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x18(%rbp),%eax
cltq
add    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%eax
add    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @getTime() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %1
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @getTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = add i32 %6, %9
ret i32 %10
}