xunge/DecIR huggingface dataset:
void pr_state(const struct ddf_super *ddf, const char *msg) {}


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

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

LLVM IR (-O0):
%struct.ddf_super = type opaque
define void @pr_state(%struct.ddf_super* %0, i8* %1) {
%3 = alloca %struct.ddf_super*
%4 = alloca i8*
store %struct.ddf_super* %0, %struct.ddf_super** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.ddf_super = type opaque
define void @pr_state(%struct.ddf_super* nocapture %0, i8* nocapture %1) {
ret void
}
bdoswr(kind, buff, len) register char *buff;
{
  register int count;
  for (count = len; count--;)
    bdos(kind, *buff++);
  return len;
}


x86 assembly (clang, -O0):
<bdoswr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     115d <bdoswr+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
mov    $0x0,%al
call   1030 <bdos@plt>
jmp    1128 <bdoswr+0x18>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdoswr>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
test   %edx,%edx
je     1147 <bdoswr+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
mov    %r14d,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbp,1),%esi
mov    %r12d,%edi
xor    %eax,%eax
call   1030 <bdos@plt>
add    $0x1,%rbp
cmp    %ebp,%ebx
jne    1130 <bdoswr+0x20>
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @bdoswr(i32 %0, i8* nocapture %1, i32 returned %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %2, %3 ]
%7 = phi i8* [ %9, %5 ], [ %1, %3 ]
%8 = add nsw i32 %6, -1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @bdos to i32 (i32, i32, ...)*)(i32 %0, i32 %11)
%13 = icmp eq i32 %8, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("Usage: %s <file>\n", name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s <file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s <file>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void mdp4_dsi_cmd_overlay_restore(void) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_dsi_cmd_overlay_restore() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int BSEG_UpdateProgressBar(int bReady) {
  printf("*");
  return -1;
}


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

x86 assembly (clang, -O2):
<BSEG_UpdateProgressBar>:
push   %rax
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @BSEG_UpdateProgressBar(i32 %0) {
%2 = tail call i32 @putchar(i32 42)
ret i32 -1
}
float swabfloat(float w) {
  char octets[4];
  char ret_octets[4];
  float ret;
  memcpy(octets, &w, 4);
  ret_octets[0] = octets[3];
  ret_octets[1] = octets[2];
  ret_octets[2] = octets[1];
  ret_octets[3] = octets[0];
  memcpy(&ret, ret_octets, 4);
  return ret;
}


x86 assembly (clang, -O0):
<swabfloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0xc(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<swabfloat>:
movd   %xmm0,%eax
bswap  %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
define float @swabfloat(float %0) {
%2 = alloca float
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
%5 = alloca float
store float %0, float* %2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = bitcast float* %2 to i8*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%9 = load i8, i8* %8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
store i8 %9, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%12 = load i8, i8* %11
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
store i8 %12, i8* %13
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%15 = load i8, i8* %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 %15, i8* %16
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%18 = load i8, i8* %17
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
store i8 %18, i8* %19
%20 = bitcast float* %5 to i8*
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%22 = load float, float* %5
ret float %22
}

LLVM IR (-O2):
define float @swabfloat(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
void f(int i, char v[]) { v[0] = i; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %dil,(%rsi)
ret

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

LLVM IR (-O2):
define void @f(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *parse_array_value(char **str) {
  char *value = *str;
  char *next = strchr(*str, ',');
  if (next == NULL) {
    *str = NULL;
    return value;
  }
  *str = next + 1;
  return value;
}


x86 assembly (clang, -O0):
<parse_array_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115f <parse_array_value+0x4f>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <parse_array_value+0x66>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_array_value>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%r14
mov    %r14,%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rax,%rcx
mov    %rcx,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @parse_array_value(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %4
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = call i8* @strchr(i8* %9, i8 signext 44)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i8**, i8*** %3
store i8* null, i8** %14
%15 = load i8*, i8** %4
store i8* %15, i8** %2
br label %21
16: ; preds = %1
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8**, i8*** %3
store i8* %18, i8** %19
%20 = load i8*, i8** %4
store i8* %20, i8** %2
br label %21
21: ; preds = %16, %13
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @parse_array_value(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 44)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* null, i8* %5
store i8* %6, i8** %0
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct sr_strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ sr_strbuf_prepend_str(struct sr_strbuf *, char *);
char *sr_vasprintf(char const *, int /*<<< orphan*/);
struct sr_strbuf *sr_strbuf_prepend_strfv(struct sr_strbuf *strbuf,
                                          const char *format, va_list p) {
  char *string_ptr = sr_vasprintf(format, p);
  sr_strbuf_prepend_str(strbuf, string_ptr);
  free(string_ptr);
  return strbuf;
}


x86 assembly (clang, -O0):
<sr_strbuf_prepend_strfv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <sr_vasprintf@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <sr_strbuf_prepend_str@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_strbuf_prepend_strfv>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
call   1040 <sr_vasprintf@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <sr_strbuf_prepend_str@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sr_strbuf = type { i32 }
define %struct.sr_strbuf* @sr_strbuf_prepend_strfv(%struct.sr_strbuf* %0, i8* %1, i32 %2) {
%4 = alloca %struct.sr_strbuf*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store %struct.sr_strbuf* %0, %struct.sr_strbuf** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @sr_vasprintf(i8* %8, i32 %9)
store i8* %10, i8** %7
%11 = load %struct.sr_strbuf*, %struct.sr_strbuf** %4
%12 = load i8*, i8** %7
%13 = call i32 @sr_strbuf_prepend_str(%struct.sr_strbuf* %11, i8* %12)
%14 = load i8*, i8** %7
%15 = call i32 @free(i8* %14)
%16 = load %struct.sr_strbuf*, %struct.sr_strbuf** %4
ret %struct.sr_strbuf* %16
}

LLVM IR (-O2):
%struct.sr_strbuf = type { i32 }
define %struct.sr_strbuf* @sr_strbuf_prepend_strfv(%struct.sr_strbuf* returned %0, i8* %1, i32 %2) {
%4 = tail call i8* @sr_vasprintf(i8* %1, i32 %2)
%5 = tail call i32 @sr_strbuf_prepend_str(%struct.sr_strbuf* %0, i8* %4)
%6 = tail call i32 @free(i8* %4)
ret %struct.sr_strbuf* %0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ go_child();
int /*<<< orphan*/ go_parent();
int main() {
  pid_t pid;
  pid = fork();
  if (pid == -1)
    abort();
  if (pid == 0)
    go_child();
  else
    go_parent();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    117a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1190 <main+0x40>
mov    $0x0,%al
call   1040 <go_child@plt>
jmp    1197 <main+0x47>
mov    $0x0,%al
call   1060 <go_parent@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <fork@plt>
test   %eax,%eax
je     1168 <main+0x18>
cmp    $0xffffffff,%eax
jne    1171 <main+0x21>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %eax,%eax
call   1040 <go_child@plt>
jmp    1178 <main+0x28>
xor    %eax,%eax
call   1060 <go_parent@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @fork()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @go_child()
br label %15
13: ; preds = %8
%14 = call i32 (...) @go_parent()
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* @EXIT_SUCCESS
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %6 [
i32 -1, label %2
i32 0, label %4
]
2: ; preds = %0
%3 = tail call i32 (...) @abort()
unreachable
4: ; preds = %0
%5 = tail call i32 (...) @go_child()
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @go_parent()
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}
void Debug_Timer_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @Debug_Timer_SaveConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(int, unsigned char);
void SensorSetMirrorFlip_OV7670(unsigned char val) {
  unsigned char x;
  val = ~val;
  VIM_SIF_I2cReadByte(0x1e, &x);
  VIM_SIF_I2cWriteByte(0x1e, (unsigned char)(x & 0xcf) | ((val & 0x03) << 4));
}


x86 assembly (clang, -O0):
<SensorSetMirrorFlip_OV7670>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0x1(%rbp)
mov    $0x1e,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
and    $0xcf,%eax
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
and    $0x3,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    $0x1e,%edi
movzbl %al,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMirrorFlip_OV7670>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xf(%rsp),%rsi
mov    $0x1e,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0xf(%rsp),%al
and    $0xcf,%al
shl    $0x4,%bl
and    $0x30,%bl
or     %al,%bl
xor    $0x30,%bl
movzbl %bl,%esi
mov    $0x1e,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @SensorSetMirrorFlip_OV7670(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = call i32 @VIM_SIF_I2cReadByte(i32 30, i8* %3)
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = and i32 %10, 207
%12 = trunc i32 %11 to i8
%13 = zext i8 %12 to i32
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = and i32 %15, 3
%17 = shl i32 %16, 4
%18 = or i32 %13, %17
%19 = trunc i32 %18 to i8
%20 = call i32 @VIM_SIF_I2cWriteByte(i32 30, i8 zeroext %19)
ret void
}

LLVM IR (-O2):
define void @SensorSetMirrorFlip_OV7670(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 30, i8* %2)
%4 = load i8, i8* %2
%5 = and i8 %4, -49
%6 = shl i8 %0, 4
%7 = and i8 %6, 48
%8 = or i8 %5, %7
%9 = xor i8 %8, 48
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 30, i8 zeroext %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_pxpat0(unsigned port) {
  return readl((void *)0xb0010000 + (port * 0x100) + (0x40));
}


x86 assembly (clang, -O0):
<read_pxpat0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%edi
add    %rax,%rdi
add    $0x40,%rdi
call   1030 <readl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pxpat0>:
shl    $0x8,%edi
mov    $0xb0010040,%eax
add    %rax,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_pxpat0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 256
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 64
%8 = call i32 @readl(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_pxpat0(i32 %0) {
%2 = shl i32 %0, 8
%3 = zext i32 %2 to i64
%4 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %3
%5 = getelementptr i8, i8* %4, i64 64
%6 = tail call i32 @readl(i8* %5)
ret i32 %6
}
/* Type definitions */
struct mcuio_packet {
  int dummy;
};

/* Variables and functions */
int BIT(int);
int mcuio_packet_type(struct mcuio_packet *);
int /*<<< orphan*/ mcuio_set_packet_type(struct mcuio_packet *, int);
void mcuio_packet_set_fill_data(struct mcuio_packet *p) {
  mcuio_set_packet_type(p, mcuio_packet_type(p) | BIT(7));
}


x86 assembly (clang, -O0):
<mcuio_packet_set_fill_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mcuio_packet_type@plt>
mov    %eax,-0x14(%rbp)
mov    $0x7,%edi
call   1030 <BIT@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdi
or     %eax,%esi
call   1050 <mcuio_set_packet_type@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcuio_packet_set_fill_data>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <mcuio_packet_type@plt>
mov    %eax,%ebp
mov    $0x7,%edi
call   1030 <BIT@plt>
or     %eax,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mcuio_set_packet_type@plt>

LLVM IR (-O0):
%struct.mcuio_packet = type { i32 }
define void @mcuio_packet_set_fill_data(%struct.mcuio_packet* %0) {
%2 = alloca %struct.mcuio_packet*
store %struct.mcuio_packet* %0, %struct.mcuio_packet** %2
%3 = load %struct.mcuio_packet*, %struct.mcuio_packet** %2
%4 = load %struct.mcuio_packet*, %struct.mcuio_packet** %2
%5 = call i32 @mcuio_packet_type(%struct.mcuio_packet* %4)
%6 = call i32 @BIT(i32 7)
%7 = or i32 %5, %6
%8 = call i32 @mcuio_set_packet_type(%struct.mcuio_packet* %3, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.mcuio_packet = type { i32 }
define void @mcuio_packet_set_fill_data(%struct.mcuio_packet* %0) {
%2 = tail call i32 @mcuio_packet_type(%struct.mcuio_packet* %0)
%3 = tail call i32 @BIT(i32 7)
%4 = or i32 %3, %2
%5 = tail call i32 @mcuio_set_packet_type(%struct.mcuio_packet* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void printCtxtInfo(const char *cmd) {
  (void)cmd;
  output("Context switches\t0\t0\t1/s\n");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Context switches\090\090\091/s\0A\00"
define void @printCtxtInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Context switches\090\090\091/s\0A\00"
define void @printCtxtInfo(i8* nocapture readnone %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isinf(double);
scalar_t__ isnan(double);
int isSpecial(double value) { return isnan(value) || isinf(value); }


x86 assembly (clang, -O0):
<isSpecial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115d <isSpecial+0x3d>
movsd  -0x8(%rbp),%xmm0
call   1040 <isinf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSpecial>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <isnan@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113a <isSpecial+0x1a>
pop    %rcx
ret
movsd  (%rsp),%xmm0
call   1040 <isinf@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isSpecial(double %0) {
%2 = tail call i64 @isnan(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isinf(double %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int array[3] = {[0] = 5, [2] = 10};
  printf("array[0]"
         " = %d\n",
         (array[0]));
  printf("array[1]"
         " = %d\n",
         (array[1]));
  printf("array[2]"
         " = %d\n",
         (array[2]));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"array[0] = %d\0A\00"
@.str.1 = [15 x i8] c"array[1] = %d\0A\00"
@.str.2 = [15 x i8] c"array[2] = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int n;
strlen(register char *s) {
  register n;
  n = 0;
  while (*s++)
    n++;
  return (n);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@n = global i32 0
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@n = global i32 0
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void X509_PURPOSE_get0(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_PURPOSE_get0() {
ret void
}
/* Variables and functions */
void *shmat(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void *cwirc_shm_attach(int shmid) { return (shmat(shmid, NULL, 0)); }


x86 assembly (clang, -O0):
<cwirc_shm_attach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <shmat@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @cwirc_shm_attach(i32 %0) {
%2 = tail call i8* @shmat(i32 %0, i32* null, i32 0)
ret i8* %2
}
int __wrap_shutdown(int socket, int how) { return 0; }


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

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

LLVM IR (-O0):
define i32 @__wrap_shutdown(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @__wrap_shutdown(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void print_com_error(char *com, int status) {
  fprintf(stderr, "ERROR: \"%s\" exited with status code %d.\n", com, status);
}


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

x86 assembly (clang, -O2):
<print_com_error>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"ERROR: \22%s\22 exited with status code %d.\0A\00"
define void @print_com_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"ERROR: \22%s\22 exited with status code %d.\0A\00"
define void @print_com_error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
double average(int *array) {
  double sum = 0;
  int i;
  for (i = 0; i < 8; i++) {
    sum += array[i];
  }
  return sum / 8;
}


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1146 <average+0x46>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <average+0x17>
movsd  -0x10(%rbp),%xmm0
movsd  0xead(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
cvtdq2pd (%rdi),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl 0x8(%rdi),%xmm0
cvtsi2sdl 0xc(%rdi),%xmm2
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rdi),%xmm0
addsd  %xmm2,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x14(%rdi),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sdl 0x18(%rdi),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sdl 0x1c(%rdi),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
mulsd  0xea3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @average(i32* %0) {
%2 = alloca i32*
%3 = alloca double
%4 = alloca i32
store i32* %0, i32** %2
store double 0.000000e+00, double* %3
store i32 0, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to double
%15 = load double, double* %3
%16 = fadd double %15, %14
store double %16, double* %3
br label %17
17: ; preds = %8
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
%21 = load double, double* %3
%22 = fdiv double %21, 8.000000e+00
ret double %22
}

LLVM IR (-O2):
define double @average(i32* nocapture %0) {
%2 = bitcast i32* %0 to <2 x i32>*
%3 = load <2 x i32>, <2 x i32>* %2
%4 = sitofp <2 x i32> %3 to <2 x double>
%5 = shufflevector <2 x double> %4, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%6 = fadd <2 x double> %5, %4
%7 = extractelement <2 x double> %6, i64 0
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = fadd double %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to double
%15 = fadd double %11, %14
%16 = getelementptr inbounds i32, i32* %0, i64 4
%17 = load i32, i32* %16
%18 = sitofp i32 %17 to double
%19 = fadd double %15, %18
%20 = getelementptr inbounds i32, i32* %0, i64 5
%21 = load i32, i32* %20
%22 = sitofp i32 %21 to double
%23 = fadd double %19, %22
%24 = getelementptr inbounds i32, i32* %0, i64 6
%25 = load i32, i32* %24
%26 = sitofp i32 %25 to double
%27 = fadd double %23, %26
%28 = getelementptr inbounds i32, i32* %0, i64 7
%29 = load i32, i32* %28
%30 = sitofp i32 %29 to double
%31 = fadd double %27, %30
%32 = fmul double %31, 1.250000e-01
ret double %32
}
int wctomb_ascii(void *map, char *s, int wc) {
  if (!s)
    return 0;
  if (wc & ~0x7f)
    return -1;
  *s = wc;
  return 1;
}


x86 assembly (clang, -O0):
<wctomb_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1126 <wctomb_ascii+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1153 <wctomb_ascii+0x53>
mov    -0x1c(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
je     1141 <wctomb_ascii+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <wctomb_ascii+0x53>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctomb_ascii>:
test   %rsi,%rsi
je     1117 <wctomb_ascii+0x17>
mov    $0xffffffff,%eax
cmp    $0x7f,%edx
ja     1116 <wctomb_ascii+0x16>
mov    %dl,(%rsi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @wctomb_ascii(i8* nocapture readnone %0, i8* writeonly %1, i32 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = icmp ult i32 %2, 128
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = trunc i32 %2 to i8
store i8 %8, i8* %1
br label %9
9: ; preds = %5, %3, %7
%10 = phi i32 [ 1, %7 ], [ 0, %3 ], [ -1, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void test55(int x, int y) {
  int u;
  if (x == 5 && y) {
    u = x + 22;
    if (u != 27)
      link_error();
  }
}


x86 assembly (clang, -O0):
<test55>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    1151 <test55+0x41>
cmpl   $0x0,-0x8(%rbp)
je     1151 <test55+0x41>
mov    -0x4(%rbp),%eax
add    $0x16,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1b,-0xc(%rbp)
je     114c <test55+0x3c>
mov    $0x0,%al
call   1030 <link_error@plt>
jmp    1151 <test55+0x41>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test55(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* %3
%7 = icmp eq i32 %6, 5
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 22
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 27
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 (...) @link_error()
br label %18
18: ; preds = %16, %11
br label %19
19: ; preds = %18, %8, %2
ret void
}

LLVM IR (-O2):
define void @test55(i32 %0, i32 %1) {
ret void
}
void g_unicode_canonical_decomposition() {}


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

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

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

LLVM IR (-O2):
define void @g_unicode_canonical_decomposition() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t z80_cb_80_res_0(uint8_t value) { return value & 0xfe; }


x86 assembly (clang, -O0):
<z80_cb_80_res_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfe,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<z80_cb_80_res_0>:
mov    %edi,%eax
and    $0xfe,%eax
ret

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

LLVM IR (-O2):
define i32 @z80_cb_80_res_0(i32 %0) {
%2 = and i32 %0, 254
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ scan(char *);
int /*<<< orphan*/ sleep(int);
void scanChild() {
  int i;
  scan("/Users/tomoaki/Develop.localized/Sebastian/plugin");
  for (;;)
    sleep(1);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<scanChild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <scan@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1134 <scanChild+0x14>

x86 assembly (clang, -O2):
<scanChild>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <scan@plt>
nopl   (%rax)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <scanChild+0x10>

LLVM IR (-O0):
@.str = [50 x i8] c"/Users/tomoaki/Develop.localized/Sebastian/plugin\00"
@EXIT_SUCCESS = global i32 0
define void @scanChild() {
%1 = alloca i32
%2 = call i32 @scan(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
%4 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@.str = [50 x i8] c"/Users/tomoaki/Develop.localized/Sebastian/plugin\00"
@EXIT_SUCCESS = global i32 0
define void @scanChild() {
%1 = tail call i32 @scan(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
double distance_to_line_dichotomy_xing(double, double, double, double, double,
                                       double, double *, double *);
double distance_to_line_dichotomy(double latitude, double longitude,
                                  double latitude_a, double longitude_a,
                                  double latitude_b, double longitude_b) {
  double x_latitude, x_longitude;
  return distance_to_line_dichotomy_xing(latitude, longitude, latitude_a,
                                         longitude_a, latitude_b, longitude_b,
                                         &x_latitude, &x_longitude);
}


x86 assembly (clang, -O0):
<distance_to_line_dichotomy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
lea    -0x38(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <distance_to_line_dichotomy_xing@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_to_line_dichotomy>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <distance_to_line_dichotomy_xing@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @distance_to_line_dichotomy(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%15 = load double, double* %7
%16 = load double, double* %8
%17 = load double, double* %9
%18 = load double, double* %10
%19 = load double, double* %11
%20 = load double, double* %12
%21 = call double @distance_to_line_dichotomy_xing(double %15, double %16, double %17, double %18, double %19, double %20, double* %13, double* %14)
ret double %21
}

LLVM IR (-O2):
define double @distance_to_line_dichotomy(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %7 to i8*
%10 = bitcast double* %8 to i8*
%11 = call double @distance_to_line_dichotomy_xing(double %0, double %1, double %2, double %3, double %4, double %5, double* %7, double* %8)
ret double %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float ntohf(uint32_t p) {
  float f = ((p >> 16) & 0x7fff);
  f += (p & 0xffff) / 65536.0f;
  if (((p >> 31) & 0x1) == 0x1) {
    f = -f;
  }
  return f;
}


x86 assembly (clang, -O0):
<ntohf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0x7fff,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
cvtsi2ss %eax,%xmm0
movss  0xed1(%rip),%xmm1
divss  %xmm1,%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1166 <ntohf+0x66>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohf>:
mov    %edi,%eax
shr    $0x10,%eax
and    $0x7fff,%eax
cvtsi2ss %eax,%xmm1
movzwl %di,%eax
cvtsi2ss %eax,%xmm0
mulss  0xee3(%rip),%xmm0
addss  %xmm1,%xmm0
test   %edi,%edi
jns    112c <ntohf+0x2c>
xorps  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ntohf(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 16
%6 = and i32 %5, 32767
%7 = sitofp i32 %6 to float
store float %7, float* %3
%8 = load i32, i32* %2
%9 = and i32 %8, 65535
%10 = sitofp i32 %9 to float
%11 = fdiv float %10, 6.553600e+04
%12 = load float, float* %3
%13 = fadd float %12, %11
store float %13, float* %3
%14 = load i32, i32* %2
%15 = ashr i32 %14, 31
%16 = and i32 %15, 1
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %1
%19 = load float, float* %3
%20 = fneg float %19
store float %20, float* %3
br label %21
21: ; preds = %18, %1
%22 = load float, float* %3
ret float %22
}

LLVM IR (-O2):
define float @ntohf(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 32767
%4 = sitofp i32 %3 to float
%5 = and i32 %0, 65535
%6 = sitofp i32 %5 to float
%7 = fmul float %6, 0x3EF0000000000000
%8 = fadd float %7, %4
%9 = icmp slt i32 %0, 0
%10 = fneg float %8
%11 = select i1 %9, float %10, float %8
ret float %11
}
/* Variables and functions */
double pow(int, double);
int note_to_period_mix(int n, int b) {
  double d = (double)n + (double)b / 12800;
  return (int)(8192.0 * 6847 / pow(2, d / 12));
}


x86 assembly (clang, -O0):
<note_to_period_mix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<note_to_period_mix>:
push   %rax
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm0
divsd  0xedf(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xedb(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xed1(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @note_to_period_mix(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.280000e+04
%11 = fadd double %7, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = fdiv double %12, 1.200000e+01
%14 = call double @pow(i32 2, double %13)
%15 = fdiv double 0x418ABF0000000000, %14
%16 = fptosi double %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @note_to_period_mix(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fdiv double %4, 1.280000e+04
%6 = fadd double %5, %3
%7 = fdiv double %6, 1.200000e+01
%8 = tail call double @pow(i32 2, double %7)
%9 = fdiv double 0x418ABF0000000000, %8
%10 = fptosi double %9 to i32
ret i32 %10
}
int decimal_int_int_int(int x, int y) { return 10 * x + y; }


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

x86 assembly (clang, -O2):
<decimal_int_int_int>:
lea    (%rdi,%rdi,4),%eax
lea    (%rsi,%rax,2),%eax
ret

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

LLVM IR (-O2):
define i32 @decimal_int_int_int(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 10
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sig_term_handler(int sig) {
  printf("SIGTERM/ABRT/INT received, halting Universal Machine!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sig_term_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_term_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"SIGTERM/ABRT/INT received, halting Universal Machine!\0A\00"
define void @sig_term_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [54 x i8] c"SIGTERM/ABRT/INT received, halting Universal Machine!\00"
define void @sig_term_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}