xunge/DecIR huggingface dataset:
/* Variables and functions */
char *kore_malloc(size_t);
int /*<<< orphan*/ kore_strlcpy(char *, char const *, size_t);
int strlen(char const *);
char *kore_strdup(const char *str) {
  size_t len;
  char *nstr;
  len = strlen(str) + 1;
  nstr = kore_malloc(len);
  (void)kore_strlcpy(nstr, str, len);
  return (nstr);
}


x86 assembly (clang, -O0):
<kore_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <kore_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <kore_strlcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kore_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1030 <kore_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <kore_strlcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @kore_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @kore_malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @kore_strlcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @kore_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @kore_malloc(i64 %4)
%6 = tail call i32 @kore_strlcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
int stm_read_argv(struct sent *sts, int sts_max, int argc, char **argv) {
  (void)sts;
  (void)sts_max;
  (void)argc;
  (void)argv;
  return (0);
}


x86 assembly (clang, -O0):
<stm_read_argv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sent = type opaque
define i32 @stm_read_argv(%struct.sent* %0, i32 %1, i32 %2, i8** %3) {
%5 = alloca %struct.sent*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
store %struct.sent* %0, %struct.sent** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load %struct.sent*, %struct.sent** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8**, i8*** %8
ret i32 0
}

LLVM IR (-O2):
%struct.sent = type opaque
define i32 @stm_read_argv(%struct.sent* nocapture readnone %0, i32 %1, i32 %2, i8** nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ null_size();
int /*<<< orphan*/ out_of_mem();
void *xmalloc(size_t size) {
  void *ptr;
  if (size == 0)
    null_size();
  ptr = malloc(size);
  if (ptr == NULL)
    out_of_mem();
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114e <xmalloc+0x1e>
mov    $0x0,%al
call   1040 <null_size@plt>
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116d <xmalloc+0x3d>
mov    $0x0,%al
call   1050 <out_of_mem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1140 <xmalloc+0x10>
xor    %eax,%eax
call   1040 <null_size@plt>
mov    %rbx,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1157 <xmalloc+0x27>
xor    %eax,%eax
call   1050 <out_of_mem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @null_size()
br label %5
5: ; preds = %3, %1
%6 = tail call i8* @malloc(i64 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @out_of_mem()
br label %10
10: ; preds = %8, %5
ret i8* %6
}
/* Variables and functions */
scalar_t__ abs(int);
int maxa(int x, int y) { return abs(x) > abs(y) ? x : y; }


x86 assembly (clang, -O0):
<maxa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
jle    114d <maxa+0x3d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <maxa+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxa>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <abs@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1030 <abs@plt>
cmp    %rax,%r14
cmovg  %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @maxa(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 = call i64 @abs(i32 %5)
%7 = load i32, i32* %4
%8 = call i64 @abs(i32 %7)
%9 = icmp sgt i64 %6, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %14
12: ; preds = %2
%13 = load i32, i32* %4
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @maxa(i32 %0, i32 %1) {
%3 = tail call i64 @abs(i32 %0)
%4 = tail call i64 @abs(i32 %1)
%5 = icmp sgt i64 %3, %4
%6 = select i1 %5, i32 %0, i32 %1
ret i32 %6
}
/* Variables and functions */
char *read_value(char *);
char vcpfr_read_char(char *propertyName) {
  char *value = read_value(propertyName);
  if (value != NULL)
    return *value;
  else
    return '\0';
}


x86 assembly (clang, -O0):
<vcpfr_read_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <read_value@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1142 <vcpfr_read_char+0x32>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
jmp    1146 <vcpfr_read_char+0x36>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcpfr_read_char>:
push   %rax
call   1030 <read_value@plt>
test   %rax,%rax
je     111f <vcpfr_read_char+0xf>
mov    (%rax),%al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define signext i8 @vcpfr_read_char(i8* %0) {
%2 = tail call i8* @read_value(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = load i8, i8* %2
br label %6
6: ; preds = %1, %4
%7 = phi i8 [ %5, %4 ], [ 0, %1 ]
ret i8 %7
}
int ft_power(int nb, int pow) {
  if (pow < 0)
    return (0);
  if (pow == 0)
    return (1);
  if (pow >= 2)
    return (nb * ft_power(nb, pow - 1));
  else
    return (nb);
}


x86 assembly (clang, -O0):
<ft_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1134 <ft_power+0x24>
movl   $0x0,-0x4(%rbp)
jmp    117e <ft_power+0x6e>
cmpl   $0x0,-0xc(%rbp)
jne    114a <ft_power+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    117e <ft_power+0x6e>
cmpl   $0x2,-0xc(%rbp)
jl     1178 <ft_power+0x68>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <ft_power@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    117e <ft_power+0x6e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_power>:
test   %esi,%esi
js     1128 <ft_power+0x28>
mov    $0x1,%eax
test   %esi,%esi
je     111f <ft_power+0x1f>
nopl   (%rax)
cmp    $0x1,%esi
je     1124 <ft_power+0x24>
add    $0xffffffff,%esi
imul   %edi,%eax
test   %esi,%esi
jne    1110 <ft_power+0x10>
mov    $0x1,%edi
imul   %edi,%eax
ret
xor    %edi,%edi
mov    $0x1,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_power(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 slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %25
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 1, i32* %3
br label %25
13: ; preds = %9
%14 = load i32, i32* %5
%15 = icmp sge i32 %14, 2
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %4
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
%21 = call i32 @ft_power(i32 %18, i32 %20)
%22 = mul nsw i32 %17, %21
store i32 %22, i32* %3
br label %25
23: ; preds = %13
%24 = load i32, i32* %4
store i32 %24, i32* %3
br label %25
25: ; preds = %23, %16, %12, %8
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @ft_power(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %7
%5 = phi i32 [ %8, %7 ], [ %1, %2 ]
%6 = phi i32 [ %9, %7 ], [ 1, %2 ]
switch i32 %5, label %7 [
i32 0, label %10
i32 1, label %11
]
7: ; preds = %4
%8 = add nsw i32 %5, -1
%9 = mul nsw i32 %6, %0
br label %4
10: ; preds = %4
br label %11
11: ; preds = %4, %10, %2
%12 = phi i32 [ 1, %2 ], [ %6, %10 ], [ %6, %4 ]
%13 = phi i32 [ 0, %2 ], [ 1, %10 ], [ %0, %4 ]
%14 = mul nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void sqlite3_assert_msg(int rc, const char *msg) {
  if (!rc)
    return;
  fprintf(stderr, "Database error: %s:\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<sqlite3_assert_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113f <sqlite3_assert_msg+0x1f>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sqlite3_assert_msg>:
test   %edi,%edi
jne    1125 <sqlite3_assert_msg+0x5>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Database error: %s:\0A\00"
define void @sqlite3_assert_msg(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 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Database error: %s:\0A\00"
define void @sqlite3_assert_msg(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %2
ret void
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i32 @exit(i32 1)
unreachable
}
int fun610() { return 610; }


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

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

LLVM IR (-O0):
define i32 @fun610() {
ret i32 610
}

LLVM IR (-O2):
define i32 @fun610() {
ret i32 610
}
/* Variables and functions */
int getlinelength(char *, int);
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  int length;
  char line[1000];
  while ((length = getlinelength(line, 1000)) > 0)
    if (length > 80)
      printf("Larger than %d: %s", 80, line);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getlinelength@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1176 <main+0x56>
cmpl   $0x50,-0x8(%rbp)
jle    1171 <main+0x51>
lea    -0x3f0(%rbp),%rdx
lea    0xe99(%rip),%rdi
mov    $0x50,%esi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getlinelength@plt>
test   %eax,%eax
jle    1178 <main+0x58>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getlinelength@plt>
test   %eax,%eax
jle    1178 <main+0x58>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Larger than %d: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getlinelength(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 80
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 80, i8* %12)
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [19 x i8] c"Larger than %d: %s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getlinelength(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 80, i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getlinelength(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
void RTTarExtractFileToBuf(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarExtractFileToBuf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ turnRightC(unsigned int, unsigned int);
void turnRight_degree(unsigned int speed, unsigned int angle) {
  turnRightC(speed, angle * 546 / 90);
}


x86 assembly (clang, -O0):
<turnRight_degree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   $0x222,-0x8(%rbp),%eax
mov    $0x5a,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%esi
call   1030 <turnRightC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnRight_degree>:
imul   $0x222,%esi,%eax
shr    %eax
mov    $0xb60b60b7,%esi
imul   %rax,%rsi
shr    $0x25,%rsi
jmp    1030 <turnRightC@plt>

LLVM IR (-O0):
define void @turnRight_degree(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul i32 %6, 546
%8 = udiv i32 %7, 90
%9 = call i32 @turnRightC(i32 %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @turnRight_degree(i32 %0, i32 %1) {
%3 = mul i32 %1, 546
%4 = udiv i32 %3, 90
%5 = tail call i32 @turnRightC(i32 %0, i32 %4)
ret void
}
int attr_copy_fd(const char *src_path, int src_fd, const char *dst_path,
                 int dst_fd, int (*check)(const char *, struct error_context *),
                 struct error_context *ctx) {
  return 0;
}


x86 assembly (clang, -O0):
<attr_copy_fd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.error_context = type opaque
%struct.error_context.0 = type opaque
define i32 @attr_copy_fd(i8* %0, i32 %1, i8* %2, i32 %3, i32 (i8*, %struct.error_context*)* %4, %struct.error_context.0* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32 (i8*, %struct.error_context*)*
%12 = alloca %struct.error_context.0*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 (i8*, %struct.error_context*)* %4, i32 (i8*, %struct.error_context*)** %11
store %struct.error_context.0* %5, %struct.error_context.0** %12
ret i32 0
}

LLVM IR (-O2):
%struct.error_context = type opaque
%struct.error_context.0 = type opaque
define i32 @attr_copy_fd(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i32 (i8*, %struct.error_context*)* nocapture readnone %4, %struct.error_context.0* nocapture readnone %5) {
ret i32 0
}
/* Type definitions */
struct DataMap {
  int dummy;
};
typedef int /*<<< orphan*/ gzFile;

/* Variables and functions */
struct DataMap *DataMapReadBlockZ(int /*<<< orphan*/, int /*<<< orphan*/ *);
struct DataMap *DataMapReadZ(gzFile file) {
  return DataMapReadBlockZ(file, NULL);
}


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

x86 assembly (clang, -O2):
<DataMapReadZ>:
xor    %esi,%esi
jmp    1030 <DataMapReadBlockZ@plt>

LLVM IR (-O0):
%struct.DataMap = type { i32 }
define %struct.DataMap* @DataMapReadZ(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.DataMap* @DataMapReadBlockZ(i32 %3, i32* null)
ret %struct.DataMap* %4
}

LLVM IR (-O2):
%struct.DataMap = type { i32 }
define %struct.DataMap* @DataMapReadZ(i32 %0) {
%2 = tail call %struct.DataMap* @DataMapReadBlockZ(i32 %0, i32* null)
ret %struct.DataMap* %2
}
/* Type definitions */
struct PdTransport {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct PdTransport *);
void free_(struct PdTransport *ts) {
  if (NULL != ts) {
    free(ts);
  }
}


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

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

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

LLVM IR (-O2):
%struct.PdTransport = type { i32 }
define void @free_(%struct.PdTransport* %0) {
%2 = icmp eq %struct.PdTransport* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.PdTransport* %0)
br label %5
5: ; preds = %3, %1
ret void
}
long bound_long(long x, long min, long max) {
  return x < min ? min : x > max ? max : x;
}


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

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

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

LLVM IR (-O2):
define i64 @bound_long(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ FileError(char *, char *);
void revalued_warning(char *s) {
  FileError("the value of %s has been redeclared", s);
}


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

x86 assembly (clang, -O2):
<revalued_warning>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <FileError@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"the value of %s has been redeclared\00"
define void @revalued_warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @FileError(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"the value of %s has been redeclared\00"
define void @revalued_warning(i8* %0) {
%2 = tail call i32 @FileError(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x29_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x29_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x29_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x29_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x29_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void a() { puts("a2.c"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"a2.c\00"
define void @a() {
%1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"a2.c\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t get_data_tag_in_SecAltIDGrp(size_t __tag) {
  (void)__tag;
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @get_data_tag_in_SecAltIDGrp(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 0
}

LLVM IR (-O2):
define i64 @get_data_tag_in_SecAltIDGrp(i64 %0) {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ ems1Rep(char const *, char const *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int *);
void emsRep(const char *err, const char *text, int *status) {
  va_list args;
  ems1Rep(err, text, 0, args, status);
}


x86 assembly (clang, -O0):
<emsRep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8
xor    %edx,%edx
call   1030 <ems1Rep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emsRep>:
mov    %rdx,%r8
xor    %edx,%edx
jmp    1030 <ems1Rep@plt>

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

LLVM IR (-O2):
define void @emsRep(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32 @ems1Rep(i8* %0, i8* %1, i32 0, i32 undef, i32* %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct v4l2_ext_controls {
  TYPE_1__ *controls;
};
struct TYPE_2__ {
  int /*<<< orphan*/ value;
};

/* Variables and functions */
int main(void) {
  struct v4l2_ext_controls ext;
  return !!&ext.controls->value;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.v4l2_ext_controls = type { %struct.TYPE_2__* }
%struct.TYPE_2__ = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.v4l2_ext_controls
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.v4l2_ext_controls, %struct.v4l2_ext_controls* %2, i32 0, i32 0
%4 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = icmp ne i32* %5, null
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 poison
}
/* Variables and functions */
int FLT_EPSILON;
int fabs(float);
bool is_zero_flt(float a) { return (fabs(a) <= FLT_EPSILON * fabs(a)); }


x86 assembly (clang, -O0):
<is_zero_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
mov    -0xc(%rbp),%ecx
mov    %eax,%edx
mov    -0x8(%rbp),%eax
imul   %edx,%ecx
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_zero_flt>:
push   %rbp
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <fabs@plt>
mov    %eax,%ebx
mov    0x2eb9(%rip),%rax
mov    (%rax),%ebp
movss  0x4(%rsp),%xmm0
call   1030 <fabs@plt>
imul   %ebp,%eax
xor    %ecx,%ecx
cmp    %eax,%ebx
setle  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@FLT_EPSILON = global i32 0
define i32 @is_zero_flt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @fabs(float %3)
%5 = load i32, i32* @FLT_EPSILON
%6 = load float, float* %2
%7 = call i32 @fabs(float %6)
%8 = mul nsw i32 %5, %7
%9 = icmp sle i32 %4, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@FLT_EPSILON = global i32 0
define i32 @is_zero_flt(float %0) {
%2 = tail call i32 @fabs(float %0)
%3 = load i32, i32* @FLT_EPSILON
%4 = tail call i32 @fabs(float %0)
%5 = mul nsw i32 %4, %3
%6 = icmp sle i32 %2, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void caller_2_1_1_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_1_1_1_2_1() {
ret void
}
double f4_sum_pre_double_short(double v0, short v) {
  return v0 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_double_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
movsd  %xmm0,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movsd  -0x8(%rbp),%xmm0
movswl -0xa(%rbp),%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_short>:
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_short(double %0, i16 signext %1) {
%3 = alloca double
%4 = alloca i16
store double %0, double* %3
store i16 %1, i16* %4
%5 = load double, double* %3
%6 = load i16, i16* %4
%7 = sitofp i16 %6 to double
%8 = fadd double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @f4_sum_pre_double_short(double %0, i16 signext %1) {
%3 = sitofp i16 %1 to double
%4 = fadd double %3, %0
ret double %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_standard_one_homogenization(int lintype) {
  int fail;
  int *b;
  double *c;
  fail = _ada_use_c2phc4c(891, &lintype, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_standard_one_homogenization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x37b,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_standard_one_homogenization>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x37b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_standard_one_homogenization(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 891, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_standard_one_homogenization(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 891, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int u8_wc_toutf8(char *, unsigned int);
int u8_wc_toutf8_nul(char *dest, unsigned int ch) {
  int sz = u8_wc_toutf8(dest, ch);
  dest[sz] = '\0';
  return sz;
}


x86 assembly (clang, -O0):
<u8_wc_toutf8_nul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <u8_wc_toutf8@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8_wc_toutf8_nul>:
push   %rbx
mov    %rdi,%rbx
call   1030 <u8_wc_toutf8@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @u8_wc_toutf8_nul(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @u8_wc_toutf8(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @u8_wc_toutf8_nul(i8* %0, i32 %1) {
%3 = tail call i32 @u8_wc_toutf8(i8* %0, i32 %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret i32 %3
}
void do_nothing(void) {}


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

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

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

LLVM IR (-O2):
define void @do_nothing() {
ret void
}
int fz_exclusion_byte(int bd, int s) {
  return bd + s - ((((bd) * ((s) + ((s) >> 7))) >> 8) << 1);
}


x86 assembly (clang, -O0):
<fz_exclusion_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%esi
sar    $0x7,%esi
add    %esi,%edx
imul   %edx,%ecx
sar    $0x8,%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_exclusion_byte>:
lea    (%rsi,%rdi,1),%eax
mov    %esi,%ecx
sar    $0x7,%ecx
add    %esi,%ecx
imul   %edi,%ecx
sar    $0x7,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fz_exclusion_byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %4
%11 = ashr i32 %10, 7
%12 = add nsw i32 %9, %11
%13 = mul nsw i32 %8, %12
%14 = ashr i32 %13, 8
%15 = shl i32 %14, 1
%16 = sub nsw i32 %7, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @fz_exclusion_byte(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = ashr i32 %1, 7
%5 = add nsw i32 %4, %1
%6 = mul nsw i32 %5, %0
%7 = ashr i32 %6, 7
%8 = and i32 %7, -2
%9 = sub i32 %3, %8
ret i32 %9
}
void fn_test2(void) {
  int a = 0;
  a++;
}


x86 assembly (clang, -O0):
<fn_test2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fn_test2() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @fn_test2() {
ret void
}
void debugpins_slot_toggle() {}


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

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

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

LLVM IR (-O2):
define void @debugpins_slot_toggle() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
void *MALLOC(size_t size) { return (void *)malloc(size); }


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

x86 assembly (clang, -O2):
<MALLOC>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @MALLOC(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @MALLOC(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
long regd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) {}


x86 assembly (clang, -O0):
<regd_ioctl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.file = type opaque
define i64 @regd_ioctl(%struct.file* %0, i32 %1, i64 %2) {
%4 = alloca i64
%5 = alloca %struct.file*
%6 = alloca i32
%7 = alloca i64
store %struct.file* %0, %struct.file** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
%8 = load i64, i64* %4
ret i64 %8
}

LLVM IR (-O2):
%struct.file = type opaque
define i64 @regd_ioctl(%struct.file* nocapture readnone %0, i32 %1, i64 %2) {
ret i64 undef
}
int target_initialize(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @target_initialize() {
ret i32 0
}
void cbor_null_float8_callback(void *_ctx, double _val) {}


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

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

LLVM IR (-O0):
define void @cbor_null_float8_callback(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
define void @cbor_null_float8_callback(i8* nocapture %0, double %1) {
ret void
}
int nint(const double x) {
  return ((x) >= 0. ? (int)((x) + 0.5) : (int)((x)-0.5));
}


x86 assembly (clang, -O0):
<nint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <nint+0x34>
movsd  0xedd(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <nint+0x4c>
movsd  -0x8(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nint>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setb   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @nint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = fptosi double %7 to i32
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fsub double %10, 5.000000e-01
%12 = fptosi double %11 to i32
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %8, %5 ], [ %12, %9 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @nint(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Variables and functions */
double abs3(double, double, double);
double abs(double a, double b, double c) { return abs3(a, b, c); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <abs3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
jmp    1030 <abs3@plt>

LLVM IR (-O0):
define double @abs(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @abs3(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @abs(double %0, double %1, double %2) {
%4 = tail call double @abs3(double %0, double %1, double %2)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ GEN_DNS;
int do_x509_check(int /*<<< orphan*/ *, unsigned char *, size_t, unsigned int,
                  int /*<<< orphan*/);
int X509_check_host(X509 *x, const char *chk, size_t chklen, unsigned int flags,
                    char **peername) {
  return do_x509_check(x, (unsigned char *)chk, chklen, flags, GEN_DNS);
}


x86 assembly (clang, -O0):
<X509_check_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    0x2ea7(%rip),%rax
mov    (%rax),%r8d
call   1030 <do_x509_check@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_check_host>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%r8d
jmp    1030 <do_x509_check@plt>

LLVM IR (-O0):
@GEN_DNS = global i32 0
define i32 @X509_check_host(i32* %0, i8* %1, i64 %2, i32 %3, i8** %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i8**
store i32* %0, i32** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
store i8** %4, i8*** %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32, i32* %9
%15 = load i32, i32* @GEN_DNS
%16 = call i32 @do_x509_check(i32* %11, i8* %12, i64 %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@GEN_DNS = global i32 0
define i32 @X509_check_host(i32* %0, i8* %1, i64 %2, i32 %3, i8** nocapture readnone %4) {
%6 = load i32, i32* @GEN_DNS
%7 = tail call i32 @do_x509_check(i32* %0, i8* %1, i64 %2, i32 %3, i32 %6)
ret i32 %7
}
VAL_BTSN(bb, len, reg, nn) int *bb, len, reg, nn;
{ VMS_BTSN(bb, reg, nn, nn); }


x86 assembly (clang, -O0):
<VAL_BTSN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    $0x0,%al
call   1030 <VMS_BTSN@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VAL_BTSN>:
mov    %edx,%esi
mov    %ecx,%edx
xor    %eax,%eax
jmp    1030 <VMS_BTSN@plt>

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

LLVM IR (-O2):
define i32 @VAL_BTSN(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32*, i32, i32, i32, ...) bitcast (i32 (...)* @VMS_BTSN to i32 (i32*, i32, i32, i32, ...)*)(i32* %0, i32 %2, i32 %3, i32 %3)
ret i32 undef
}
/* Type definitions */
struct cec_msg {
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void cec_ops_set_system_audio_mode(const struct cec_msg *msg,
                                   __u8 *sys_aud_status) {
  *sys_aud_status = msg->msg[2];
}


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

x86 assembly (clang, -O2):
<cec_ops_set_system_audio_mode>:
mov    (%rdi),%rax
mov    0x8(%rax),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_set_system_audio_mode(%struct.cec_msg* %0, i32* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32* %1, i32** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_set_system_audio_mode(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void greet() { printf("I am lib02!\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"I am lib02!\0A\00"
define void @greet() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"I am lib02!\00"
define void @greet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void record_play(char *word) { printf("%s\n", word); }


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

x86 assembly (clang, -O2):
<record_play>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @record_play(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int ksmbd_rdma_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ksmbd_rdma_init() {
ret i32 0
}