xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, void const *);
bool cutils_cdar_DynamicArray_void_ptr_format(const void *item, char **buffer,
                                              size_t *buffer_size) {
  snprintf(*buffer, *buffer_size,
           "<pointer to "
           "%p"
           ">",
           item);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_void_ptr_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rcx
lea    0xec3(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_void_ptr_format>:
push   %rax
mov    %rdi,%rcx
mov    (%rsi),%rdi
mov    (%rdx),%rsi
lea    0xedf(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"<pointer to %p>\00"
define i32 @cutils_cdar_DynamicArray_void_ptr_format(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 = load i8*, i8** %7
%9 = load i64*, i64** %6
%10 = load i64, i64* %9
%11 = load i8*, i8** %4
%12 = call i32 @snprintf(i8* %8, i64 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 1
}

LLVM IR (-O2):
@.str = [16 x i8] c"<pointer to %p>\00"
define i32 @cutils_cdar_DynamicArray_void_ptr_format(i8* %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
int foo6(int a, int b[a][a], int (*c)[sizeof(*b)]) { return sizeof(*c); }


x86 assembly (clang, -O0):
<foo6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo6>:
mov    %edi,%eax
shl    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @foo6(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = load i32*, i32** %5
%12 = mul nuw i64 4, %10
%13 = load i32*, i32** %6
%14 = mul nuw i64 4, %12
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo6(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = shl i32 %0, 4
ret i32 %4
}
unsigned long edf_maxdimensions(void) { return (512); }


x86 assembly (clang, -O0):
<edf_maxdimensions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x200,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @edf_maxdimensions() {
ret i64 512
}

LLVM IR (-O2):
define i64 @edf_maxdimensions() {
ret i64 512
}
/* Variables and functions */
int /*<<< orphan*/ add_node_link(int, int);
void add_link(int n0, int n1) {
  add_node_link(n0, n1);
  add_node_link(n1, n0);
}


x86 assembly (clang, -O0):
<add_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <add_node_link@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <add_node_link@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_link>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <add_node_link@plt>
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <add_node_link@plt>

LLVM IR (-O0):
define void @add_link(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 @add_node_link(i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @add_node_link(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @add_link(i32 %0, i32 %1) {
%3 = tail call i32 @add_node_link(i32 %0, i32 %1)
%4 = tail call i32 @add_node_link(i32 %1, i32 %0)
ret void
}
void tegra30_init_speedo_data(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra30_init_speedo_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cmd_usage_core(void) {
  printf("usage: mdp [-Vh] [-c config] command [command args ...]\n");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"usage: mdp [-Vh] [-c config] command [command args ...]\0A\00"
define void @cmd_usage_core() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [56 x i8] c"usage: mdp [-Vh] [-c config] command [command args ...]\00"
define void @cmd_usage_core() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void pppoat_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<pppoat_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @pppoat_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @pppoat_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void XDestroyOC() {}


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

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

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

LLVM IR (-O2):
define void @XDestroyOC() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  unsigned char z = 0;
  do
    ;
  while (--z > 0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
jmp    1128 <main+0x18>
mov    -0x5(%rbp),%al
add    $0xff,%al
mov    %al,-0x5(%rbp)
movzbl %al,%eax
cmp    $0x0,%eax
jg     1123 <main+0x13>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
br label %3
3: ; preds = %4, %0
br label %4
4: ; preds = %3
%5 = load i8, i8* %2
%6 = add i8 %5, -1
store i8 %6, i8* %2
%7 = zext i8 %6 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %4
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ ft_strchr(char *, char);
int ft_is_arg(char c) {
  if (ft_strchr("#.0lhjz+- 123456789*$'L?", c) && c)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_is_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <ft_strchr@plt>
cmp    $0x0,%rax
je     1151 <ft_is_arg+0x41>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     1151 <ft_is_arg+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1158 <ft_is_arg+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_is_arg>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <ft_strchr@plt>
test   %rax,%rax
setne  %al
test   %bl,%bl
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"#.0lhjz+- 123456789*$'L?\00"
define i32 @ft_is_arg(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @ft_strchr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [25 x i8] c"#.0lhjz+- 123456789*$'L?\00"
define i32 @ft_is_arg(i8 signext %0) {
%2 = tail call i64 @ft_strchr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp ne i8 %0, 0
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ reg;

/* Variables and functions */
int /*<<< orphan*/ sendByte(int, unsigned char);
void tube_WriteC(unsigned int *reg) {
  sendByte(1, (unsigned char)((reg[0]) & 0xff));
}


x86 assembly (clang, -O0):
<tube_WriteC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
mov    $0x1,%edi
movzbl %al,%esi
call   1030 <sendByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tube_WriteC>:
movzbl (%rdi),%esi
mov    $0x1,%edi
jmp    1030 <sendByte@plt>

LLVM IR (-O0):
define void @tube_WriteC(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = call i32 @sendByte(i32 1, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @tube_WriteC(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = trunc i32 %2 to i8
%4 = tail call i32 @sendByte(i32 1, i8 zeroext %3)
ret void
}
int test_imm_5Aint64_lowword_mem(long long *val) {
  return ((*val) & (0x5A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Aint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 90
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_5Aint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 90
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ a();
void warn_lock1(void) { a(); }


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

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

LLVM IR (-O0):
define void @warn_lock1() {
%1 = call i32 (...) @a()
ret void
}

LLVM IR (-O2):
define void @warn_lock1() {
%1 = tail call i32 (...) @a()
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
unsigned long timeval_to_msec(struct timeval *t) {
  return t->tv_sec * 1000000 + t->tv_usec;
}


x86 assembly (clang, -O0):
<timeval_to_msec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%eax
cltq
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_msec>:
movslq (%rdi),%rax
imul   $0xf4240,%rax,%rax
add    0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @timeval_to_msec(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000000
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = add i64 %7, %5
ret i64 %8
}
void alarmHandler(__attribute__((unused)) int sig) {}


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

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

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

LLVM IR (-O2):
define void @alarmHandler(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *retSized(int s) {
  int *r = (int *)malloc(s * sizeof(int));
  return r;
}


x86 assembly (clang, -O0):
<retSized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retSized>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define i32* @retSized(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ MIN(int, int);
int /*<<< orphan*/ SEQ_SYSEX(int /*<<< orphan*/, unsigned char *,
                             int /*<<< orphan*/);
void seq_sysex(unsigned char *buf, int len) {
  int i;
  for (i = 0; i < len; i += 6)
    SEQ_SYSEX(0, buf + i, MIN(len - i, 6));
}


x86 assembly (clang, -O0):
<seq_sysex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117c <seq_sysex+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    -0x10(%rbp),%edi
mov    $0x6,%esi
call   1030 <MIN@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %edi,%edi
call   1040 <SEQ_SYSEX@plt>
mov    -0x10(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <seq_sysex+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_sysex>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    1168 <seq_sysex+0x48>
mov    %esi,%r15d
mov    %rdi,%r14
xor    %ebx,%ebx
mov    %esi,%ebp
cs nopw 0x0(%rax,%rax,1)
lea    (%r14,%rbx,1),%r12
mov    %ebp,%edi
mov    $0x6,%esi
call   1030 <MIN@plt>
xor    %edi,%edi
mov    %r12,%rsi
mov    %eax,%edx
call   1040 <SEQ_SYSEX@plt>
add    $0x6,%rbx
add    $0xfffffffa,%ebp
cmp    %r15d,%ebx
jl     1140 <seq_sysex+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @seq_sysex(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = trunc i64 %5 to i32
%8 = sub nsw i32 %1, %7
%9 = tail call i32 @MIN(i32 %8, i32 6)
%10 = tail call i32 @SEQ_SYSEX(i32 0, i8* %6, i32 %9)
%11 = add nuw i64 %5, 6
%12 = trunc i64 %11 to i32
%13 = icmp slt i32 %12, %1
br i1 %13, label %4, label %14
14: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core7_swap(char *, int);
void U_EMRRESIZEPALETTE_swap(char *record, int torev) {
  core7_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRRESIZEPALETTE_swap>:
jmp    1030 <core7_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRRESIZEPALETTE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core7_swap(i8* %0, i32 %1)
ret void
}
int test_imm_D4uint8_reg(unsigned char val) {
  return ((val) & (0xD4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D4uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xd4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D4uint8_reg>:
test   $0xd4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D4uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 212
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D4uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -44
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GotoXy(int, int);
void GotoLc(int l, int c) { GotoXy(c, l); }


x86 assembly (clang, -O0):
<GotoLc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <GotoXy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GotoLc>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <GotoXy@plt>

LLVM IR (-O0):
define void @GotoLc(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 = load i32, i32* %3
%7 = call i32 @GotoXy(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @GotoLc(i32 %0, i32 %1) {
%3 = tail call i32 @GotoXy(i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glPopName();
void qglPopName(void) { glPopName(); }


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

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

LLVM IR (-O0):
define void @qglPopName() {
%1 = call i32 (...) @glPopName()
ret void
}

LLVM IR (-O2):
define void @qglPopName() {
%1 = tail call i32 (...) @glPopName()
ret void
}
unsigned long XBlackPixel() {}


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

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

LLVM IR (-O0):
define i64 @XBlackPixel() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @XBlackPixel() {
ret i64 undef
}
unsigned int fn9(unsigned int x) { return (1LL & x) + x; }


x86 assembly (clang, -O0):
<fn9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%rax
mov    -0x4(%rbp),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn9>:
mov    %edi,%eax
and    $0x1,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn9(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = and i64 1, %4
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = add nsw i64 %5, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @fn9(i32 %0) {
%2 = and i32 %0, 1
%3 = add i32 %2, %0
ret i32 %3
}
void eglQueryString(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglQueryString() {
ret void
}
char *ecvt(arg, ndigits, decpt, sign)
double arg;
int ndigits, *decpt, *sign;
{ return cvt(arg, ndigits, decpt, sign, 1); }


x86 assembly (clang, -O0):
<ecvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecvt>:
push   %rax
mov    $0x1,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ecvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %9, i32 %10, i32* %11, i32* %12, i32 1)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @ecvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %0, i32 %1, i32* %2, i32* %3, i32 1)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
int d2(int m) {
  switch (m) {
  case 2:
    return 28;
  case 4:
  case 6:
  case 9:
  case 11:
    return 30;
  default:
    return 31;
  }
}


x86 assembly (clang, -O0):
<d2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
je     115f <d2+0x5f>
jmp    111b <d2+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     116b <d2+0x6b>
jmp    112c <d2+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
je     116b <d2+0x6b>
jmp    113d <d2+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
je     116b <d2+0x6b>
jmp    114e <d2+0x4e>
mov    -0xc(%rbp),%eax
sub    $0xb,%eax
je     116b <d2+0x6b>
jmp    1177 <d2+0x77>
movl   $0x1c,-0x4(%rbp)
jmp    117e <d2+0x7e>
movl   $0x1e,-0x4(%rbp)
jmp    117e <d2+0x7e>
movl   $0x1f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2>:
add    $0xfffffffe,%edi
mov    $0x1f,%eax
cmp    $0x9,%edi
ja     111a <d2+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @d2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 2, label %5
i32 4, label %6
i32 6, label %6
i32 9, label %6
i32 11, label %6
]
5: ; preds = %1
store i32 28, i32* %2
br label %8
6: ; preds = %1, %1, %1, %1
store i32 30, i32* %2
br label %8
7: ; preds = %1
store i32 31, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.d2 = [10 x i32] [i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30]
define i32 @d2(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.d2, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 31, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ TIOCSPTLCK;
int ioctl(int, int /*<<< orphan*/, int *);
int unlockpt(int fd) {
  int unlock = 0;
  return ioctl(fd, TIOCSPTLCK, &unlock);
}


x86 assembly (clang, -O0):
<unlockpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlockpt>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@TIOCSPTLCK = global i32 0
define i32 @unlockpt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @TIOCSPTLCK
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
ret i32 %6
}

LLVM IR (-O2):
@TIOCSPTLCK = global i32 0
define i32 @unlockpt(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @TIOCSPTLCK
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ aes_encr(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ expandKey(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int aes_ecb_enc(uint8_t *buffer, uint8_t *key) {
  uint8_t expandedKey[176];
  expandKey(expandedKey, key);
  aes_encr(buffer, expandedKey);
  return 0;
}


x86 assembly (clang, -O0):
<aes_ecb_enc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2d0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2d0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <expandKey@plt>
mov    -0x8(%rbp),%rdi
lea    -0x2d0(%rbp),%rsi
call   1030 <aes_encr@plt>
xor    %eax,%eax
add    $0x2d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_ecb_enc>:
push   %r14
push   %rbx
sub    $0x2c8,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <expandKey@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <aes_encr@plt>
xor    %eax,%eax
add    $0x2c8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @aes_ecb_enc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [176 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = getelementptr inbounds [176 x i32], [176 x i32]* %5, i64 0, i64 0
%7 = load i32*, i32** %4
%8 = call i32 @expandKey(i32* %6, i32* %7)
%9 = load i32*, i32** %3
%10 = getelementptr inbounds [176 x i32], [176 x i32]* %5, i64 0, i64 0
%11 = call i32 @aes_encr(i32* %9, i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @aes_ecb_enc(i32* %0, i32* %1) {
%3 = alloca [176 x i32]
%4 = bitcast [176 x i32]* %3 to i8*
%5 = getelementptr inbounds [176 x i32], [176 x i32]* %3, i64 0, i64 0
%6 = call i32 @expandKey(i32* %5, i32* %1)
%7 = call i32 @aes_encr(i32* %0, i32* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MinHeapify(int *, int, int);
int Root(int);
int MinBuildHeap(int *Arr, int Size) {
  int i = Root(Size);
  while (i >= 0) {
    MinHeapify(Arr, i, Size);
    i--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<MinBuildHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <Root@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1161 <MinBuildHeap+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <MinHeapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <MinBuildHeap+0x1a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MinBuildHeap>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <Root@plt>
test   %eax,%eax
js     1151 <MinBuildHeap+0x31>
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <MinHeapify@plt>
add    $0xffffffff,%ebp
jb     1140 <MinBuildHeap+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @MinBuildHeap(i32* %0, i32 %1) {
%3 = tail call i32 @Root(i32 %1)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = tail call i32 @MinHeapify(i32* %0, i32 %6, i32 %1)
%8 = add nsw i32 %6, -1
%9 = icmp eq i32 %6, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret i32 0
}
int isxdigit(int c) {
  return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
          (c >= 'A' && c <= 'F'));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isxdigit+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <isxdigit+0x39>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isxdigit+0x52>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ iptables_do_command(char *);
void iptables_fw_clear_authservers(void) {
  iptables_do_command("-t filter -F "
                      "WiFiDog_$ID$_AuthServers");
  iptables_do_command("-t nat -F "
                      "WiFiDog_$ID$_AuthServers");
}


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

x86 assembly (clang, -O2):
<iptables_fw_clear_authservers>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <iptables_do_command@plt>
lea    0xf02(%rip),%rdi
pop    %rax
jmp    1030 <iptables_do_command@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"-t filter -F WiFiDog_$ID$_AuthServers\00"
@.str.1 = [35 x i8] c"-t nat -F WiFiDog_$ID$_AuthServers\00"
define void @iptables_fw_clear_authservers() {
%1 = call i32 @iptables_do_command(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @iptables_do_command(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"-t filter -F WiFiDog_$ID$_AuthServers\00"
@.str.1 = [35 x i8] c"-t nat -F WiFiDog_$ID$_AuthServers\00"
define void @iptables_fw_clear_authservers() {
%1 = tail call i32 @iptables_do_command(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @iptables_do_command(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int *);
int main(int argc, char *argv[]) {
  int *p = NULL;
  bar(p);
  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)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @bar(i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setakpos(int /*<<< orphan*/);
void op_setleft() { setakpos(0); }


x86 assembly (clang, -O0):
<op_setleft>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <setakpos@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_setleft>:
xor    %edi,%edi
jmp    1030 <setakpos@plt>

LLVM IR (-O0):
define void @op_setleft() {
%1 = call i32 @setakpos(i32 0)
ret void
}

LLVM IR (-O2):
define void @op_setleft() {
%1 = tail call i32 @setakpos(i32 0)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
const char *printColor(int32_t color) {
  switch (color) {
  case 0:
    return "white";
  case 1:
    return "black";
  default:
    return "unknown";
  }
}


x86 assembly (clang, -O0):
<printColor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <printColor+0x2b>
jmp    111a <printColor+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <printColor+0x3b>
jmp    114b <printColor+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <printColor+0x56>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <printColor+0x56>
lea    0xeba(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<printColor>:
cmp    $0x1,%edi
lea    0xefc(%rip),%rax
lea    0xefb(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"white\00"
@.str.1 = [6 x i8] c"black\00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @printColor(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"white\00"
@.str.1 = [6 x i8] c"black\00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @printColor(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void celt_notify(const char *str) {
  fprintf(stderr, "notification: %s\n", str);
}


x86 assembly (clang, -O0):
<celt_notify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celt_notify>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"notification: %s\0A\00"
define void @celt_notify(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *stdimpl_strcat(char *dst, const char *src) {
  char *start = dst;
  char c;
  do {
    c = *dst;
    dst++;
  } while (c);
  dst--;
  do {
    c = *src;
    *dst = c;
    src++;
    dst++;
  } while (c);
  return start;
}


x86 assembly (clang, -O0):
<stdimpl_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpb   $0x0,-0x19(%rbp)
jne    1114 <stdimpl_strcat+0x14>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpb   $0x0,-0x19(%rbp)
jne    113f <stdimpl_strcat+0x3f>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdimpl_strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <stdimpl_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 <stdimpl_strcat+0x20>
ret

LLVM IR (-O0):
define i8* @stdimpl_strcat(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
store i8* %7, i8** %5
br label %8
8: ; preds = %13, %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
store i8 %10, i8* %6
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %13
13: ; preds = %8
%14 = load i8, i8* %6
%15 = icmp ne i8 %14, 0
br i1 %15, label %8, label %16
16: ; preds = %13
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 -1
store i8* %18, i8** %3
br label %19
19: ; preds = %28, %16
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
store i8 %21, i8* %6
%22 = load i8, i8* %6
%23 = load i8*, i8** %3
store i8 %22, i8* %23
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
br label %28
28: ; preds = %19
%29 = load i8, i8* %6
%30 = icmp ne i8 %29, 0
br i1 %30, label %19, label %31
31: ; preds = %28
%32 = load i8*, i8** %5
ret i8* %32
}

LLVM IR (-O2):
define i8* @stdimpl_strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = icmp eq i8 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %12, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = load i8, i8* %9
store i8 %11, i8* %10
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = icmp eq i8 %11, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int strlen(char *);
int ContainSpace(char *ch) {
  int flag, i;
  flag = 0;
  for (i = 0; i < strlen(ch); i++)
    if (ch[i] == ' ')
      flag = 1;
  return flag;
}


x86 assembly (clang, -O0):
<ContainSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    1175 <ContainSpace+0x65>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1162 <ContainSpace+0x52>
movl   $0x1,-0xc(%rbp)
jmp    1167 <ContainSpace+0x57>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <ContainSpace+0x1a>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ContainSpace>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    114e <ContainSpace+0x3e>
xor    %ebx,%ebx
mov    $0x1,%r15d
xor    %ebp,%ebp
nopl   (%rax)
cmpb   $0x20,(%r14,%rbx,1)
cmove  %r15d,%ebp
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <ContainSpace+0x20>
jmp    1150 <ContainSpace+0x40>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ContainSpace(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %15
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
%10 = select i1 %9, i32 1, i32 %6
%11 = add nuw nsw i64 %5, 1
%12 = tail call i32 @strlen(i8* %0)
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %4, label %15
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
int black_button() {}


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

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

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

LLVM IR (-O2):
define i32 @black_button() {
ret i32 undef
}
void copyright_fileformats() {}


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

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

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

LLVM IR (-O2):
define void @copyright_fileformats() {
ret void
}
int main() {
  __complex double dc;
  double *dp = &(__real dc);
  *dp = 3.14;
  if ((__real dc) != 3.14)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1169 <main+0x49>
jp     1169 <main+0x49>
jmp    116e <main+0x4e>
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca { double, double }
%3 = alloca double*
store i32 0, i32* %1
%4 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 0
store double* %4, double** %3
%5 = load double*, double** %3
store double 3.140000e+00, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 0
%7 = load double, double* %6
%8 = fcmp une double %7, 3.140000e+00
br i1 %8, label %9, label %10
9: ; preds = %0
unreachable
10: ; preds = %0
unreachable
}

LLVM IR (-O2):
define i32 @main() {
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
int inb(int);
void delay(int count) {
  volatile int x;
  int i;
  for (i = 0; i < count; i++)
    x = inb(0x40);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1149 <delay+0x39>
mov    $0x40,%edi
call   1030 <inb@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <delay+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
jle    1133 <delay+0x23>
mov    %edi,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x40,%edi
call   1030 <inb@plt>
mov    %eax,0xc(%rsp)
add    $0xffffffff,%ebx
jne    1120 <delay+0x10>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @inb(i32 64)
store volatile i32 %7, i32* %2
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}