xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
__attribute__((hot)) int sr_cmpu32(char *a, size_t asz, char *b, size_t bsz,
                                   void *arg __attribute__((unused))) {
  (void)asz;
  (void)bsz;
  register uint32_t av = *(uint32_t *)a;
  register uint32_t bv = *(uint32_t *)b;
  if (av == bv)
    return 0;
  return (av > bv) ? 1 : -1;
}


x86 assembly (clang, -O0):
<sr_cmpu32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x40(%rbp),%rax
jne    1148 <sr_cmpu32+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1163 <sr_cmpu32+0x63>
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rsi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_cmpu32>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %esi,%esi
cmp    (%rdx),%rax
setg   %sil
lea    -0x1(%rsi,%rsi,1),%eax
cmove  %ecx,%eax
ret
cs nopw 0x0(%rax,%rax,1)

LLVM IR (-O0):
define i32 @sr_cmpu32(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
%14 = load i64, i64* %8
%15 = load i64, i64* %10
%16 = load i8*, i8** %7
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
store i64 %18, i64* %12
%19 = load i8*, i8** %9
%20 = bitcast i8* %19 to i64*
%21 = load i64, i64* %20
store i64 %21, i64* %13
%22 = load i64, i64* %12
%23 = load i64, i64* %13
%24 = icmp eq i64 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %5
store i32 0, i32* %6
br label %32
26: ; preds = %5
%27 = load i64, i64* %12
%28 = load i64, i64* %13
%29 = icmp sgt i64 %27, %28
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 1, i32 -1
store i32 %31, i32* %6
br label %32
32: ; preds = %26, %25
%33 = load i32, i32* %6
ret i32 %33
}

LLVM IR (-O2):
define i32 @sr_cmpu32(i8* nocapture %0, i64 %1, i8* nocapture %2, i64 %3, i8* nocapture readnone %4) {
%6 = bitcast i8* %0 to i64*
%7 = load i64, i64* %6
%8 = bitcast i8* %2 to i64*
%9 = load i64, i64* %8
%10 = icmp eq i64 %7, %9
%11 = icmp sgt i64 %7, %9
%12 = select i1 %11, i32 1, i32 -1
%13 = select i1 %10, i32 0, i32 %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_heap(void *ptr) {
  if (NULL != (void *)ptr) {
    free(ptr);
  }
  ptr = NULL;
}


x86 assembly (clang, -O0):
<free_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1131 <free_heap+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_heap>:
test   %rdi,%rdi
je     111a <free_heap+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @free_heap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* null, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
store i8* null, i8** %2
ret void
}

LLVM IR (-O2):
define void @free_heap(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare_str(const void *str1, const void *str2) {
  int retval;
  if ((retval = strcmp((const char *)str1, (const char *)str2)) > 0)
    return 1;
  if (retval < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jle    1145 <compare_str+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1162 <compare_str+0x52>
cmpl   $0x0,-0x1c(%rbp)
jge    115b <compare_str+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <compare_str+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_str>:
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
test   %eax,%eax
mov    $0x1,%eax
cmovle %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @compare_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = ashr i32 %3, 31
%5 = icmp slt i32 %3, 1
%6 = select i1 %5, i32 %4, i32 1
ret i32 %6
}
/* Type definitions */
struct syslog_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ STUB0(int (*)(int, struct syslog_data *));
int setlogmask_r(int a, struct syslog_data *b) {
  (void)a;
  (void)b;
  STUB0(setlogmask_r);
}


x86 assembly (clang, -O0):
<setlogmask_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rdi
call   1030 <STUB0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlogmask_r>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <STUB0@plt>

LLVM IR (-O0):
%struct.syslog_data = type { i32 }
define i32 @setlogmask_r(i32 %0, %struct.syslog_data* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.syslog_data*
store i32 %0, i32* %4
store %struct.syslog_data* %1, %struct.syslog_data** %5
%6 = load i32, i32* %4
%7 = load %struct.syslog_data*, %struct.syslog_data** %5
%8 = call i32 @STUB0(i32 (i32, %struct.syslog_data*)* @setlogmask_r)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
%struct.syslog_data = type { i32 }
define i32 @setlogmask_r(i32 %0, %struct.syslog_data* nocapture readnone %1) {
%3 = tail call i32 @STUB0(i32 (i32, %struct.syslog_data*)* @setlogmask_r)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __stack_chk_fail();
void __attribute__((noreturn)) __stack_chk_fail_local(void) {
  __stack_chk_fail();
}


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

x86 assembly (clang, -O2):
<__stack_chk_fail_local>:
push   %rax
xor    %eax,%eax
call   1030 <__stack_chk_fail@plt>

LLVM IR (-O0):
define void @__stack_chk_fail_local() {
%1 = call i32 (...) @__stack_chk_fail()
unreachable
}

LLVM IR (-O2):
define void @__stack_chk_fail_local() {
%1 = tail call i32 (...) @__stack_chk_fail()
unreachable
}
int ft_isalpha(int c) {
  return (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'));
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1124 <ft_isalpha+0x24>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1147 <ft_isalpha+0x47>
xor    %eax,%eax
mov    $0x61,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jg     1141 <ft_isalpha+0x41>
cmpl   $0x7a,-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):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 65, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sle i32 97, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *strndup(char *, int);
char *strrchr(char *, char);
char *ft_get_parent_path(char *path) {
  char *last_slash;
  char *parent;
  last_slash = strrchr(path, '/');
  parent = strndup(path, last_slash - path);
  return (parent);
}


x86 assembly (clang, -O0):
<ft_get_parent_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1040 <strndup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_get_parent_path>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
sub    %ebx,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <strndup@plt>

LLVM IR (-O0):
define i8* @ft_get_parent_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = ptrtoint i8* %8 to i64
%11 = ptrtoint i8* %9 to i64
%12 = sub i64 %10, %11
%13 = trunc i64 %12 to i32
%14 = call i8* @strndup(i8* %7, i32 %13)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @ft_get_parent_path(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = ptrtoint i8* %2 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = tail call i8* @strndup(i8* %0, i32 %6)
ret i8* %7
}
/* Variables and functions */
char *BDISASM_GetFixReg(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void BDISASM_PrintFixRegPF(int i) {
  char *s;
  s = BDISASM_GetFixReg(i, 0);
  if (s)
    printf("%s, ", s);
}


x86 assembly (clang, -O0):
<BDISASM_PrintFixRegPF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <BDISASM_GetFixReg@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <BDISASM_PrintFixRegPF+0x34>
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BDISASM_PrintFixRegPF>:
push   %rax
xor    %esi,%esi
call   1040 <BDISASM_GetFixReg@plt>
test   %rax,%rax
je     113d <BDISASM_PrintFixRegPF+0x1d>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s, \00"
define void @BDISASM_PrintFixRegPF(i32 %0) {
%2 = tail call i8* @BDISASM_GetFixReg(i32 %0, i32 0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %6
6: ; preds = %4, %1
ret void
}
void ByteToFloatRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ByteToFloatRow_NEON() {
ret void
}
/* Variables and functions */
unsigned short ntohs(unsigned short);
unsigned short network_short_to_host(unsigned short x) { return ntohs(x); }


x86 assembly (clang, -O0):
<network_short_to_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <ntohs@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_short_to_host>:
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
define zeroext i16 @network_short_to_host(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @ntohs(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @network_short_to_host(i16 zeroext %0) {
%2 = tail call zeroext i16 @ntohs(i16 zeroext %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void *hello(void *arg) {
  char *msg = "Hola";
  printf("%s\n", msg);
}


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

x86 assembly (clang, -O2):
<hello>:
lea    0xeee(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"Hola\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define noalias i8* @hello(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ perfeito(double);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double k = 1;
  scanf("%lf", &k);
  printf("\nPerfeito: %lf\n", perfeito(k));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <perfeito@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rsp)
lea    0xeba(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <perfeito@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"\0APerfeito: %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 1.000000e+00, double* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call i32 @perfeito(double %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_cfendack(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0004 | 0x00F0);
}


x86 assembly (clang, -O0):
<ieee80211_is_cfendack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xf4,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_cfendack>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xf4,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_cfendack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 244)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_cfendack(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 244)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
char *skip_to_fmt(char *s) {
  while (*s && *s != '%')
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_to_fmt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_to_fmt+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_to_fmt+0x3d>
jmp    114e <skip_to_fmt+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_to_fmt+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_to_fmt>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <skip_to_fmt+0x22>
cmp    $0x25,%cl
je     1122 <skip_to_fmt+0x22>
add    $0x1,%rax
jmp    1110 <skip_to_fmt+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_to_fmt(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 37, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
ret i8* %3
}
int main() {
  char out = 0x55;
  __asm__("movb $0xFF, %%al; cmpb $0xFE, %%al; setc %%al" : "=a"(out));
  return out;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
mov    $0xff,%al
cmp    $0xfe,%al
setb   %al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xff,%al
cmp    $0xfe,%al
setb   %al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
%3 = call i8 asm "movb $$0xFF, %al; cmpb $$0xFE, %al; setc %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "movb $$0xFF, %al; cmpb $$0xFE, %al; setc %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = sext i8 %1 to i32
ret i32 %2
}
int test_imm_E1uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xE1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E1uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14745600
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *utf8_skip_char(const char *in) {
  if (!(in[0] & 0x80)) {
    return (char *)in + 1;
  } else {
    in++;
    while ((((in[0]) & 0xc0) == 0x80))
      in++;
    return (char *)in;
  }
}


x86 assembly (clang, -O0):
<utf8_skip_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    112e <utf8_skip_char+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116a <utf8_skip_char+0x6a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1162 <utf8_skip_char+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113a <utf8_skip_char+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_skip_char>:
mov    %rdi,%rax
cmpb   $0x0,(%rdi)
js     1110 <utf8_skip_char+0x10>
add    $0x1,%rax
ret
nopl   (%rax)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
and    $0xc0,%cl
cmp    $0x80,%cl
je     1110 <utf8_skip_char+0x10>
ret

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

LLVM IR (-O2):
define i8* @utf8_skip_char(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
br label %12
6: ; preds = %1, %6
%7 = phi i8* [ %8, %6 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = and i8 %9, -64
%11 = icmp eq i8 %10, -128
br i1 %11, label %6, label %12
12: ; preds = %6, %4
%13 = phi i8* [ %5, %4 ], [ %8, %6 ]
ret i8* %13
}
/* Type definitions */
struct UPort {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ digisparkBufferFlush(struct UPort *, int);
void DigisparkWait(struct UPort *up) { digisparkBufferFlush(up, 0x0C); }


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

x86 assembly (clang, -O2):
<DigisparkWait>:
mov    $0xc,%esi
jmp    1030 <digisparkBufferFlush@plt>

LLVM IR (-O0):
%struct.UPort = type { i32 }
define void @DigisparkWait(%struct.UPort* %0) {
%2 = alloca %struct.UPort*
store %struct.UPort* %0, %struct.UPort** %2
%3 = load %struct.UPort*, %struct.UPort** %2
%4 = call i32 @digisparkBufferFlush(%struct.UPort* %3, i32 12)
ret void
}

LLVM IR (-O2):
%struct.UPort = type { i32 }
define void @DigisparkWait(%struct.UPort* %0) {
%2 = tail call i32 @digisparkBufferFlush(%struct.UPort* %0, i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int foo2(int z, int x) {
  if (x == 1) {
    bar();
    return z;
  } else
    return x - z;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    113a <foo2+0x2a>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <foo2+0x33>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1,%esi
jne    1121 <foo2+0x11>
xor    %eax,%eax
call   1030 <bar@plt>
jmp    1125 <foo2+0x15>
sub    %ebx,%esi
mov    %esi,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @foo2(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @bar()
br label %8
6: ; preds = %2
%7 = sub nsw i32 %1, %0
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %0, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int real_main(int argc, char **argv) {
  printf("Hello world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @real_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @real_main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t decomposeCharacter(unsigned char character, unsigned char *buffer,
                          size_t length) {
  return 0;
}


x86 assembly (clang, -O0):
<decomposeCharacter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @decomposeCharacter(i8 zeroext %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
ret i64 0
}

LLVM IR (-O2):
define i64 @decomposeCharacter(i8 zeroext %0, i8* nocapture readnone %1, i64 %2) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void KeyboardFunc(unsigned char key, int x, int y) {
  int foo;
  foo = x + y;
  if ('q' == key || 'Q' == key || 27 == key)
    exit(0);
}


x86 assembly (clang, -O0):
<KeyboardFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x71,%eax
cmp    %ecx,%eax
je     1160 <KeyboardFunc+0x50>
movzbl -0x1(%rbp),%ecx
mov    $0x51,%eax
cmp    %ecx,%eax
je     1160 <KeyboardFunc+0x50>
movzbl -0x1(%rbp),%ecx
mov    $0x1b,%eax
cmp    %ecx,%eax
jne    1167 <KeyboardFunc+0x57>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KeyboardFunc>:
cmp    $0x1b,%dil
je     1123 <KeyboardFunc+0x13>
cmp    $0x71,%dil
je     1123 <KeyboardFunc+0x13>
cmp    $0x51,%dil
je     1123 <KeyboardFunc+0x13>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @KeyboardFunc(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = add nsw i32 %8, %9
store i32 %10, i32* %7
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp eq i32 113, %12
br i1 %13, label %22, label %14
14: ; preds = %3
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = icmp eq i32 81, %16
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = icmp eq i32 27, %20
br i1 %21, label %22, label %24
22: ; preds = %18, %14, %3
%23 = call i32 @exit(i32 0)
unreachable
24: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @KeyboardFunc(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %6 [
i8 113, label %4
i8 81, label %4
i8 27, label %4
]
4: ; preds = %3, %3, %3
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %3
ret void
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ window;
};
typedef TYPE_1__ XMapRequestEvent;
struct TYPE_5__ {
  TYPE_1__ xmaprequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int /*<<< orphan*/ getclient(int /*<<< orphan*/);
int /*<<< orphan*/ manage(int /*<<< orphan*/);
void maprequest(const XEvent *e) {
  const XMapRequestEvent *ev = &e->xmaprequest;
  if (!getclient(ev->window))
    manage(ev->window);
}


x86 assembly (clang, -O0):
<maprequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <getclient@plt>
cmp    $0x0,%eax
jne    1153 <maprequest+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <manage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maprequest>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <getclient@plt>
test   %eax,%eax
je     1131 <maprequest+0x11>
pop    %rbx
ret
mov    (%rbx),%edi
pop    %rbx
jmp    1030 <manage@plt>

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

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
define void @maprequest(%struct.TYPE_5__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @getclient(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = tail call i32 @manage(i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ USART2_Send_Packet(scalar_t__, scalar_t__ *);
void WF121_MessageSend(uint8_t msg_len, uint8_t *msg_data, uint16_t data_len,
                       uint8_t *data) {
  USART2_Send_Packet(msg_len, msg_data);
  if (data_len && data)
    USART2_Send_Packet(data_len, data);
}


x86 assembly (clang, -O0):
<WF121_MessageSend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <USART2_Send_Packet@plt>
cmpq   $0x0,-0x18(%rbp)
je     1158 <WF121_MessageSend+0x48>
cmpq   $0x0,-0x20(%rbp)
je     1158 <WF121_MessageSend+0x48>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <USART2_Send_Packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WF121_MessageSend>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
call   1030 <USART2_Send_Packet@plt>
test   %rbx,%rbx
je     113b <WF121_MessageSend+0x2b>
test   %r14,%r14
je     113b <WF121_MessageSend+0x2b>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <USART2_Send_Packet@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @WF121_MessageSend(i64 %0, i64* %1, i64 %2, i64* %3) {
%5 = tail call i32 @USART2_Send_Packet(i64 %0, i64* %1)
%6 = icmp ne i64 %2, 0
%7 = icmp ne i64* %3, null
%8 = and i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @USART2_Send_Packet(i64 %2, i64* %3)
br label %11
11: ; preds = %9, %4
ret void
}
int main(int argc, char *argv[]) {
  const int i = 0;
  int *p = (int *)&i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
unsigned int f(int a, long long b) {
  int c = b;
  c &= ~0xf0;
  c |= (a & 0xf) << 4;
  return c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0xffffff0f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
shl    $0x4,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
and    $0xffffff0f,%esi
shl    $0x4,%edi
movzbl %dil,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = and i32 %8, -241
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = and i32 %10, 15
%12 = shl i32 %11, 4
%13 = load i32, i32* %5
%14 = or i32 %13, %12
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @f(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = and i32 %3, -241
%5 = shl i32 %0, 4
%6 = and i32 %5, 240
%7 = or i32 %4, %6
ret i32 %7
}
const char *ftk_text_no_translate(void *ctx, const char *text) { return text; }


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

x86 assembly (clang, -O2):
<ftk_text_no_translate>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @ftk_text_no_translate(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @ftk_text_no_translate(i8* nocapture readnone %0, i8* readnone returned %1) {
ret i8* %1
}
int some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes(
    int some_argument_with_a_really_long_name_that_must_be_longer_than_64_bytes) {
  int some_variable_with_a_really_long_name_that_must_be_longer_than_64_bytes =
      0;
  int i;
  for (i = 0;
       i <=
       some_argument_with_a_really_long_name_that_must_be_longer_than_64_bytes;
       i++) {
    some_variable_with_a_really_long_name_that_must_be_longer_than_64_bytes +=
        i;
  }
  return some_variable_with_a_really_long_name_that_must_be_longer_than_64_bytes;
}


x86 assembly (clang, -O0):
<some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes+0x38>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes>:
mov    %edi,%eax
lea    -0x1(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
add    %edi,%ecx
xor    %eax,%eax
test   %edi,%edi
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = zext i32 %0 to i33
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = lshr i33 %6, 1
%8 = trunc i33 %7 to i32
%9 = add i32 %8, %0
%10 = select i1 %2, i32 0, i32 %9
ret i32 %10
}
void fd39(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    p012A:
      goto p012A;
      goto a;
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  a:;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd39>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd39+0x7>

x86 assembly (clang, -O2):
<fd39>:
jmp    1100 <fd39>

LLVM IR (-O0):
define void @fd39(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %17
17: ; preds = %17, %14
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd39(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct id {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct id *);
void freeId(struct id *i) { free(i); }


x86 assembly (clang, -O0):
<freeId>:
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):
<freeId>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.id = type { i32 }
define void @freeId(%struct.id* %0) {
%2 = alloca %struct.id*
store %struct.id* %0, %struct.id** %2
%3 = load %struct.id*, %struct.id** %2
%4 = call i32 @free(%struct.id* %3)
ret void
}

LLVM IR (-O2):
%struct.id = type { i32 }
define void @freeId(%struct.id* nocapture %0) {
%2 = tail call i32 @free(%struct.id* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ eventfd_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
int eventfd_write(int fd __attribute__((unused)),
                  eventfd_t value __attribute__((unused))) {
  printf("eventfd_write\n");
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<eventfd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eventfd_write>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
mov    0x2eb3(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"eventfd_write\0A\00"
@EINVAL = global i32 0
@errno = global i32 0
define i32 @eventfd_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EINVAL
store i32 %6, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
@str = [14 x i8] c"eventfd_write\00"
define i32 @eventfd_write(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ ChangeColor(int /*<<< orphan*/);
void SetColorRed() { ChangeColor(COLOR_RED); }


x86 assembly (clang, -O0):
<SetColorRed>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <ChangeColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetColorRed>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ChangeColor@plt>

LLVM IR (-O0):
@COLOR_RED = global i32 0
define void @SetColorRed() {
%1 = load i32, i32* @COLOR_RED
%2 = call i32 @ChangeColor(i32 %1)
ret void
}

LLVM IR (-O2):
@COLOR_RED = global i32 0
define void @SetColorRed() {
%1 = load i32, i32* @COLOR_RED
%2 = tail call i32 @ChangeColor(i32 %1)
ret void
}
int sum(n) { n; }


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

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

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
ret i32 undef
}
int mul_add(int x, int y, int z) { return x * y + z; }


x86 assembly (clang, -O0):
<mul_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_add>:
imul   %esi,%edi
lea    (%rdi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @mul_add(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 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mul_add(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
float __strtof_nan(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
float __nanf(const char *tagp) { return __strtof_nan(tagp, NULL, 0); }


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

x86 assembly (clang, -O2):
<__nanf>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__strtof_nan@plt>

LLVM IR (-O0):
define float @__nanf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call float @__strtof_nan(i8* %3, i32* null, i32 0)
ret float %4
}

LLVM IR (-O2):
define float @__nanf(i8* %0) {
%2 = tail call float @__strtof_nan(i8* %0, i32* null, i32 0)
ret float %2
}