xunge/DecIR huggingface dataset:
/* Type definitions */
struct drm_file {
  int dummy;
};
struct drm_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DRM_DEBUG(char *);
int /*<<< orphan*/ LOCK_TEST_WITH_RETURN(struct drm_device *,
                                         struct drm_file *);
int r128_do_engine_reset(struct drm_device *);
int r128_engine_reset(struct drm_device *dev, void *data,
                      struct drm_file *file_priv) {
  DRM_DEBUG("\n");
  LOCK_TEST_WITH_RETURN(dev, file_priv);
  return r128_do_engine_reset(dev);
}


x86 assembly (clang, -O0):
<r128_engine_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
call   1050 <DRM_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <LOCK_TEST_WITH_RETURN@plt>
mov    -0x8(%rbp),%rdi
call   1040 <r128_do_engine_reset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r128_engine_reset>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
call   1050 <DRM_DEBUG@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <LOCK_TEST_WITH_RETURN@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <r128_do_engine_reset@plt>

LLVM IR (-O0):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @r128_engine_reset(%struct.drm_device* %0, i8* %1, %struct.drm_file* %2) {
%4 = alloca %struct.drm_device*
%5 = alloca i8*
%6 = alloca %struct.drm_file*
store %struct.drm_device* %0, %struct.drm_device** %4
store i8* %1, i8** %5
store %struct.drm_file* %2, %struct.drm_file** %6
%7 = call i32 @DRM_DEBUG(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load %struct.drm_device*, %struct.drm_device** %4
%9 = load %struct.drm_file*, %struct.drm_file** %6
%10 = call i32 @LOCK_TEST_WITH_RETURN(%struct.drm_device* %8, %struct.drm_file* %9)
%11 = load %struct.drm_device*, %struct.drm_device** %4
%12 = call i32 @r128_do_engine_reset(%struct.drm_device* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @r128_engine_reset(%struct.drm_device* %0, i8* nocapture readnone %1, %struct.drm_file* %2) {
%4 = tail call i32 @DRM_DEBUG(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @LOCK_TEST_WITH_RETURN(%struct.drm_device* %0, %struct.drm_file* %2)
%6 = tail call i32 @r128_do_engine_reset(%struct.drm_device* %0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
unsigned long PWMGenIntGet(unsigned long, unsigned long);
void PWMGenIntUnregister(unsigned long ulBase, unsigned long ulGen) {
  unsigned long ulInt;
  ;
  ;
  ulInt = PWMGenIntGet(ulBase, ulGen);
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<PWMGenIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <PWMGenIntGet@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <IntDisable@plt>
mov    -0x18(%rbp),%rdi
call   1050 <IntUnregister@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenIntUnregister>:
push   %rbx
call   1030 <PWMGenIntGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @PWMGenIntUnregister(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 @PWMGenIntGet(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = call i32 @IntDisable(i64 %9)
%11 = load i64, i64* %5
%12 = call i32 @IntUnregister(i64 %11)
ret void
}

LLVM IR (-O2):
define void @PWMGenIntUnregister(i64 %0, i64 %1) {
%3 = tail call i64 @PWMGenIntGet(i64 %0, i64 %1)
%4 = tail call i32 @IntDisable(i64 %3)
%5 = tail call i32 @IntUnregister(i64 %3)
ret void
}
unsigned int unsignedint_ignoring_signedlong(unsigned int x, signed long y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedint_ignoring_signedlong>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @unsignedint_ignoring_signedlong(i32 returned %0, i64 %1) {
ret i32 %0
}
void closeout() {}


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

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

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

LLVM IR (-O2):
define void @closeout() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
char *gsym(char *s) {
  static char name[16 + 2];
  name[0] = 'C';
  name[1] = 0;
  strcat(name, s);
  return name;
}


x86 assembly (clang, -O0):
<gsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x43,0x2f1d(%rip)
movb   $0x0,0x2f17(%rip)
mov    -0x8(%rbp),%rsi
lea    0x2f0b(%rip),%rdi
call   1030 <strcat@plt>
lea    0x2eff(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsym>:
push   %rbx
mov    %rdi,%rsi
movw   $0x43,0x2f23(%rip)
lea    0x2f1c(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@gsym.name = internal global [18 x i8] zeroinitializer
define i8* @gsym(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8 67, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 1)
%3 = load i8*, i8** %2
%4 = call i32 @strcat(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 0), i8* %3)
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 0)
}

LLVM IR (-O2):
@gsym.name = internal global [18 x i8] zeroinitializer
define i8* @gsym(i8* %0) {
store i8 67, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 1)
%2 = tail call i32 @strcat(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 0), i8* %0)
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 0)
}
/* Variables and functions */
int find_tok(int, char **, char *);
int exists_in_command_line(int argc, char *argv[], char *match,
                           int *found_list) {
  int i = find_tok(argc, argv, match);
  if (i == -1) {
    return 0;
  } else {
    found_list[i] = 1;
    return 1;
  }
}


x86 assembly (clang, -O0):
<exists_in_command_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <find_tok@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    1150 <exists_in_command_line+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1166 <exists_in_command_line+0x56>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists_in_command_line>:
push   %rbx
mov    %rcx,%rbx
call   1030 <find_tok@plt>
cmp    $0xffffffff,%eax
je     112e <exists_in_command_line+0x1e>
cltq
movl   $0x1,(%rbx,%rax,4)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @exists_in_command_line(i32 %0, i8** %1, i8* %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @find_tok(i32 %0, i8** %1, i8* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i32, i32* %3, i64 %8
store i32 1, i32* %9
br label %10
10: ; preds = %4, %7
%11 = phi i32 [ 1, %7 ], [ 0, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void httpCacheControl(const char *directive) {
  if (directive != NULL) {
    printf("Cache-Control: %s\n", directive);
  }
}


x86 assembly (clang, -O0):
<httpCacheControl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <httpCacheControl+0x27>
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpCacheControl>:
test   %rdi,%rdi
je     1124 <httpCacheControl+0x14>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Cache-Control: %s\0A\00"
define void @httpCacheControl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int bar(int);
int foo(int /*<<< orphan*/);
int main() { return foo(0) + bar(4); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <bar@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <foo@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1030 <bar@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0)
%3 = call i32 @bar(i32 4)
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 @bar(i32 4)
%3 = add nsw i32 %2, %1
ret i32 %3
}
int countSameAsStart(signed char *s, int max) {
  signed char v = *s;
  int i;
  if (max > 127)
    max = 127;
  for (i = 1; i < max; ++i)
    if (s[i] != v)
      break;
  return i;
}


x86 assembly (clang, -O0):
<countSameAsStart>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
cmpl   $0x7f,-0xc(%rbp)
jle    1125 <countSameAsStart+0x25>
movl   $0x7f,-0xc(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <countSameAsStart+0x68>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0xd(%rbp),%ecx
cmp    %ecx,%eax
je     1155 <countSameAsStart+0x55>
jmp    1168 <countSameAsStart+0x68>
jmp    115a <countSameAsStart+0x5a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112c <countSameAsStart+0x2c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countSameAsStart>:
cmp    $0x7f,%esi
mov    $0x7f,%ecx
cmovl  %esi,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jl     1130 <countSameAsStart+0x30>
mov    (%rdi),%dl
mov    %ecx,%esi
mov    $0x1,%eax
xchg   %ax,%ax
cmp    %dl,(%rdi,%rax,1)
jne    1130 <countSameAsStart+0x30>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1120 <countSameAsStart+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @countSameAsStart(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp slt i32 %1, 127
%5 = select i1 %4, i32 %1, i32 127
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = zext i32 %5 to i64
br label %9
9: ; preds = %7, %14
%10 = phi i64 [ 1, %7 ], [ %15, %14 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, %3
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %19, label %9
17: ; preds = %9
%18 = trunc i64 %10 to i32
br label %19
19: ; preds = %14, %17, %2
%20 = phi i32 [ 1, %2 ], [ %18, %17 ], [ %5, %14 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_radio() {
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (14 << 9) | (14 << 5) | (3)));
  delay(100);
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (14 << 9) | (14 << 5) | (3)));
  delay(100);
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (2 << 9) | (3 << 5) | (1)));
  delay(100);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_radio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc3,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc3,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc461,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_radio>:
push   %rax
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc3,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc3,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc461,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_radio() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56771)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56771)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 50273)
%6 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_radio() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56771)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56771)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 50273)
%6 = tail call i32 @delay(i32 100)
ret void
}
unsigned short port_word_in(unsigned short port) {
  unsigned short result;
  __asm__("in %%dx, %%al" : "=a"(result) : "d"(port));
  return result;
}


x86 assembly (clang, -O0):
<port_word_in>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_word_in>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i16 @port_word_in(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @port_word_in(i16 zeroext %0) {
%2 = tail call i16 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
int foo1(int foo1param) { return foo1param; }


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

x86 assembly (clang, -O2):
<foo1>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo1(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int voCore_gpioDirectionOut(char *);
int voCore_gpioSetValue(char *, char *);
int voCore_gpioInit(char *index) {
  int retourValeur = voCore_gpioDirectionOut(index);
  if (retourValeur != 200) {
    return retourValeur;
  }
  return voCore_gpioSetValue(index, "0");
}


x86 assembly (clang, -O0):
<voCore_gpioInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <voCore_gpioDirectionOut@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xc8,-0x14(%rbp)
je     1150 <voCore_gpioInit+0x30>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <voCore_gpioInit+0x43>
mov    -0x10(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1040 <voCore_gpioSetValue@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voCore_gpioInit>:
push   %rbx
mov    %rdi,%rbx
call   1030 <voCore_gpioDirectionOut@plt>
cmp    $0xc8,%eax
jne    1140 <voCore_gpioInit+0x20>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <voCore_gpioSetValue@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define i32 @voCore_gpioInit(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @voCore_gpioDirectionOut(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 200
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i32 @voCore_gpioSetValue(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define i32 @voCore_gpioInit(i8* %0) {
%2 = tail call i32 @voCore_gpioDirectionOut(i8* %0)
%3 = icmp eq i32 %2, 200
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @voCore_gpioSetValue(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %7
}
int acpi_is_wakeup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @acpi_is_wakeup() {
ret i32 0
}
/* Variables and functions */
float lfactorial(int);
int log(float);
float pois_logpmf(int k, float lambda) {
  return k * log(lambda) - lambda - lfactorial(k);
}


x86 assembly (clang, -O0):
<pois_logpmf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
cvtsi2ss %eax,%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <lfactorial@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pois_logpmf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %edi,%ebx
call   1030 <log@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
subss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %ebx,%edi
call   1040 <lfactorial@plt>
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @pois_logpmf(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = call i32 @log(float %6)
%8 = mul nsw i32 %5, %7
%9 = sitofp i32 %8 to float
%10 = load float, float* %4
%11 = fsub float %9, %10
%12 = load i32, i32* %3
%13 = call float @lfactorial(i32 %12)
%14 = fsub float %11, %13
ret float %14
}

LLVM IR (-O2):
define float @pois_logpmf(i32 %0, float %1) {
%3 = tail call i32 @log(float %1)
%4 = mul nsw i32 %3, %0
%5 = sitofp i32 %4 to float
%6 = fsub float %5, %1
%7 = tail call float @lfactorial(i32 %0)
%8 = fsub float %6, %7
ret float %8
}
void test_0(float *in, int *out) {
  out[3] = (int)in[0];
  out[2] = (int)in[1];
  out[1] = (int)in[2];
  out[0] = (int)in[3];
}


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

x86 assembly (clang, -O2):
<test_0>:
movups (%rdi),%xmm0
cvttps2dq %xmm0,%xmm0
pshufd $0x1b,%xmm0,%xmm0
movdqu %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @test_0(float* %0, i32* %1) {
%3 = alloca float*
%4 = alloca i32*
store float* %0, float** %3
store i32* %1, i32** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = fptosi float %7 to i32
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 %8, i32* %10
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fptosi float %13 to i32
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %14, i32* %16
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = fptosi float %19 to i32
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 1
store i32 %20, i32* %22
%23 = load float*, float** %3
%24 = getelementptr inbounds float, float* %23, i64 3
%25 = load float, float* %24
%26 = fptosi float %25 to i32
%27 = load i32*, i32** %4
%28 = getelementptr inbounds i32, i32* %27, i64 0
store i32 %26, i32* %28
ret void
}

LLVM IR (-O2):
define void @test_0(float* nocapture %0, i32* nocapture writeonly %1) {
%3 = bitcast float* %0 to <4 x float>*
%4 = load <4 x float>, <4 x float>* %3
%5 = fptosi <4 x float> %4 to <4 x i32>
%6 = shufflevector <4 x i32> %5, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%7 = bitcast i32* %1 to <4 x i32>*
store <4 x i32> %6, <4 x i32>* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned long long);
void memswap(void *a, void *b, void *t, unsigned long long len) {
  memcpy(t, a, len);
  memcpy(a, b, len);
  memcpy(b, t, len);
}


x86 assembly (clang, -O0):
<memswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memswap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %rdx,%rdi
mov    %r12,%rsi
mov    %rcx,%rdx
call   1030 <memcpy@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @memswap(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %5
%11 = load i64, i64* %8
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i64, i64* %8
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %6
%18 = load i8*, i8** %7
%19 = load i64, i64* %8
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
ret void
}

LLVM IR (-O2):
define void @memswap(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @memcpy(i8* %2, i8* %0, i64 %3)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %3)
%7 = tail call i32 @memcpy(i8* %1, i8* %2, i64 %3)
ret void
}
void fatal(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @fatal(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int getopt_internal(int, char **, char const *, struct option const *, int *,
                    int /*<<< orphan*/);
int getopt_long(int argc, char **argv, const char *shortopts,
                const struct option *longopts, int *longind) {
  return getopt_internal(argc, argv, shortopts, longopts, longind, 0);
}


x86 assembly (clang, -O0):
<getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long>:
xor    %r9d,%r9d
jmp    1030 <getopt_internal@plt>

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

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0)
ret i32 %6
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef scalar_t__ socklen_t;

/* Variables and functions */
scalar_t__ memcmp(struct sockaddr *, struct sockaddr *, scalar_t__);
int prv_check_addr(struct sockaddr *leftAddr, socklen_t leftAddrLen,
                   struct sockaddr *rightAddr, socklen_t rightAddrLen) {
  if (leftAddrLen != rightAddrLen)
    return 0;
  if (memcmp(leftAddr, rightAddr, leftAddrLen) != 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<prv_check_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1142 <prv_check_addr+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1170 <prv_check_addr+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
je     1169 <prv_check_addr+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1170 <prv_check_addr+0x60>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_check_addr>:
xor    %eax,%eax
cmp    %rcx,%rsi
jne    1135 <prv_check_addr+0x25>
push   %rax
mov    %rsi,%r8
mov    %rdx,%rsi
mov    %r8,%rdx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @prv_check_addr(%struct.sockaddr* %0, i64 %1, %struct.sockaddr* %2, i64 %3) {
%5 = icmp eq i64 %1, %3
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i64 @memcmp(%struct.sockaddr* %0, %struct.sockaddr* %2, i64 %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 0, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ helper_double_11_recursive(double *, int);
void helper_double_11(double *buf) { helper_double_11_recursive(buf, 11); }


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

x86 assembly (clang, -O2):
<helper_double_11>:
mov    $0xb,%esi
jmp    1030 <helper_double_11_recursive@plt>

LLVM IR (-O0):
define void @helper_double_11(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @helper_double_11_recursive(double* %3, i32 11)
ret void
}

LLVM IR (-O2):
define void @helper_double_11(double* %0) {
%2 = tail call i32 @helper_double_11_recursive(double* %0, i32 11)
ret void
}
void up(struct semaphore *sem) { return; }


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

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

LLVM IR (-O0):
%struct.semaphore = type opaque
define void @up(%struct.semaphore* %0) {
%2 = alloca %struct.semaphore*
store %struct.semaphore* %0, %struct.semaphore** %2
ret void
}

LLVM IR (-O2):
%struct.semaphore = type opaque
define void @up(%struct.semaphore* nocapture %0) {
ret void
}
/* Variables and functions */
char *ultoa_wp(unsigned long, char *, unsigned int, int /*<<< orphan*/, char);
char *ultoa(unsigned long val, char *buffer, unsigned int base) {
  return ultoa_wp(val, buffer, base, 0, ' ');
}


x86 assembly (clang, -O0):
<ultoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
mov    $0x20,%r8d
call   1030 <ultoa_wp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ultoa>:
xor    %ecx,%ecx
mov    $0x20,%r8d
jmp    1030 <ultoa_wp@plt>

LLVM IR (-O0):
define i8* @ultoa(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @ultoa_wp(i64 %7, i8* %8, i32 %9, i32 0, i8 signext 32)
ret i8* %10
}

LLVM IR (-O2):
define i8* @ultoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @ultoa_wp(i64 %0, i8* %1, i32 %2, i32 0, i8 signext 32)
ret i8* %4
}
void __attribute__((always_))
trace_dump_args(int argc __attribute__((unused)),
                char *argv[] __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @trace_dump_args(i32 %0, i8** nocapture %1) {
ret void
}
void test_toascii(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, toascii(i++));
}


x86 assembly (clang, -O0):
<test_toascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1179 <test_toascii+0x59>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <toascii@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe9a(%rip),%rdi
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test_toascii+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_toascii>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <toascii@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test_toascii+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_toascii = [13 x i8] c"test_toascii\00"
define void @test_toascii() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 (i32, ...) bitcast (i32 (...)* @toascii to i32 (i32, ...)*)(i32 %9)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_toascii, i64 0, i64 0), i32 %8, i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_toascii = [13 x i8] c"test_toascii\00"
define void @test_toascii() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @toascii to i32 (i32, ...)*)(i32 %2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_toascii, i64 0, i64 0), i32 %2, i32 %4)
%6 = icmp eq i32 %3, 256
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
/* Variables and functions */
char *diminuto_path_scan(char const *, char const *);
char *getenv(char const *);
char *diminuto_path_find(const char *keyword, const char *file) {
  char *path = (char *)0;
  const char *value;
  do {
    if (keyword == (const char *)0) {
      break;
    }
    value = getenv(keyword);
    path = diminuto_path_scan(value, file);
  } while (0);
  return path;
}


x86 assembly (clang, -O0):
<diminuto_path_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <diminuto_path_find+0x28>
jmp    1166 <diminuto_path_find+0x46>
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <diminuto_path_scan@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_path_find>:
test   %rdi,%rdi
je     113a <diminuto_path_find+0x1a>
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <diminuto_path_scan@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @diminuto_path_find(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i8* @getenv(i8* %0)
%6 = tail call i8* @diminuto_path_scan(i8* %5, i8* %1)
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ null, %2 ], [ %6, %4 ]
ret i8* %8
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
struct hle_t {
  int dummy;
};
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ alist_mix(struct hle_t *, int, int, int, int);
void MIXER(struct hle_t *hle, uint32_t w1, uint32_t w2) {
  uint16_t count = (w1 >> 12) & 0xff0;
  int16_t gain = w1;
  uint16_t dmemi = (w2 >> 16);
  uint16_t dmemo = w2;
  alist_mix(hle, dmemo, dmemi, count, gain);
}


x86 assembly (clang, -O0):
<MIXER>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0xc,%eax
and    $0xff0,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <alist_mix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIXER>:
mov    %esi,%r8d
mov    %esi,%ecx
shr    $0xc,%ecx
and    $0xff0,%ecx
mov    %edx,%eax
sar    $0x10,%eax
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <alist_mix@plt>

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @MIXER(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hle_t*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.hle_t* %0, %struct.hle_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = load i32, i32* %5
%12 = ashr i32 %11, 12
%13 = and i32 %12, 4080
store i32 %13, i32* %7
%14 = load i32, i32* %5
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = ashr i32 %15, 16
store i32 %16, i32* %9
%17 = load i32, i32* %6
store i32 %17, i32* %10
%18 = load %struct.hle_t*, %struct.hle_t** %4
%19 = load i32, i32* %10
%20 = load i32, i32* %9
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call i32 @alist_mix(%struct.hle_t* %18, i32 %19, i32 %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @MIXER(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = lshr i32 %1, 12
%5 = and i32 %4, 4080
%6 = ashr i32 %2, 16
%7 = tail call i32 @alist_mix(%struct.hle_t* %0, i32 %2, i32 %6, i32 %5, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void wait_for_page_switch(void) { udelay(5); }


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

x86 assembly (clang, -O2):
<wait_for_page_switch>:
mov    $0x5,%edi
jmp    1030 <udelay@plt>

LLVM IR (-O0):
define void @wait_for_page_switch() {
%1 = call i32 @udelay(i32 5)
ret void
}

LLVM IR (-O2):
define void @wait_for_page_switch() {
%1 = tail call i32 @udelay(i32 5)
ret void
}
int clist_destroy(struct clist_head *list) { return 0; }


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

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

LLVM IR (-O0):
%struct.clist_head = type opaque
define i32 @clist_destroy(%struct.clist_head* %0) {
%2 = alloca %struct.clist_head*
store %struct.clist_head* %0, %struct.clist_head** %2
ret i32 0
}

LLVM IR (-O2):
%struct.clist_head = type opaque
define i32 @clist_destroy(%struct.clist_head* nocapture readnone %0) {
ret i32 0
}
void get_info() {}


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

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

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

LLVM IR (-O2):
define void @get_info() {
ret void
}
void sdb_init_mysql(void) { ; }


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

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

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

LLVM IR (-O2):
define void @sdb_init_mysql() {
ret void
}
int ex2(int n) {
  if (n == 0)
    return 1;
  else
    return 2 * ex2(n - 1);
}


x86 assembly (clang, -O0):
<ex2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <ex2+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1142 <ex2+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ex2@plt>
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex2>:
test   %edi,%edi
je     1124 <ex2+0x14>
push   %rax
add    $0xffffffff,%edi
call   1030 <ex2@plt>
add    %eax,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ex2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @ex2(i32 %6)
%8 = shl nsw i32 %7, 1
br label %3
}
extern __attribute__((gnu_)) double carmen_fmin(double val1, double val2) {
  if (val2 < val1)
    return val2;
  return val1;
}


x86 assembly (clang, -O0):
<carmen_fmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <carmen_fmin+0x31>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <carmen_fmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_fmin>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @carmen_fmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @carmen_fmin(double %0, double %1) {
%3 = fcmp olt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void smpte_hbrmt_set_sample(uint8_t *p_hbrmt, uint8_t sample) {
  p_hbrmt[6] |= (sample & 0xf);
}


x86 assembly (clang, -O0):
<smpte_hbrmt_set_sample>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xf,%ecx
mov    -0x8(%rbp),%rax
or     0x18(%rax),%ecx
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_hbrmt_set_sample>:
and    $0xf,%esi
or     %esi,0x18(%rdi)
ret

LLVM IR (-O0):
define void @smpte_hbrmt_set_sample(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 15
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 6
%9 = load i32, i32* %8
%10 = or i32 %9, %6
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @smpte_hbrmt_set_sample(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 15
%4 = getelementptr inbounds i32, i32* %0, i64 6
%5 = load i32, i32* %4
%6 = or i32 %5, %3
store i32 %6, i32* %4
ret void
}