xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *string) {
  int i;
  for (i = 0;; i++) {
    if (string[i] == 0x00) {
      return i;
    }
  }
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1129 <strlen+0x29>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
jmp    112e <strlen+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int fileExists(const char *path) {
  struct stat s;
  return (stat(path, &s) == 0);
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fileExists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fileExists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float bar();
float __attribute__((cmse_nonsecure_entry)) foo(void) { return bar(); }


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

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

LLVM IR (-O0):
define float @foo() {
%1 = call float (...) @bar()
ret float %1
}

LLVM IR (-O2):
define float @foo() {
%1 = tail call float (...) @bar()
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ RTTrafficInfo_ClearAll();
int /*<<< orphan*/ RealtimeTrafficInfoPluginTerm();
void RTTrafficInfo_Term() {
  RTTrafficInfo_ClearAll();
  RealtimeTrafficInfoPluginTerm();
}


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

x86 assembly (clang, -O2):
<RTTrafficInfo_Term>:
push   %rax
xor    %eax,%eax
call   1040 <RTTrafficInfo_ClearAll@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <RealtimeTrafficInfoPluginTerm@plt>

LLVM IR (-O0):
define void @RTTrafficInfo_Term() {
%1 = call i32 (...) @RTTrafficInfo_ClearAll()
%2 = call i32 (...) @RealtimeTrafficInfoPluginTerm()
ret void
}

LLVM IR (-O2):
define void @RTTrafficInfo_Term() {
%1 = tail call i32 (...) @RTTrafficInfo_ClearAll()
%2 = tail call i32 (...) @RealtimeTrafficInfoPluginTerm()
ret void
}
int f2(volatile int *a) {
  int b = a[1];
  int c = a[0];
  int d = a[3];
  int e = a[2];
  return b + c + d + e;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    0x4(%rdi),%eax
add    (%rdi),%eax
add    0xc(%rdi),%eax
add    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load volatile i32, i32* %2
%4 = load volatile i32, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load volatile i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load volatile i32, i32* %7
%9 = add nsw i32 %4, %3
%10 = add nsw i32 %9, %6
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdefw(int v) { ngen("%s\t%d", ".quad", v); }


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

x86 assembly (clang, -O2):
<cgdefw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <ngen@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s\09%d\00"
@.str.1 = [6 x i8] c".quad\00"
define void @cgdefw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void _ret_void() { return; }


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

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

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

LLVM IR (-O2):
define void @_ret_void() {
ret void
}
/* Type definitions */
typedef void group;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_store_return_metadata(void *, char *);
void *getgrgid(int /*<<< orphan*/);
__attribute__((__weak__, __always___)) struct group *
softboundmpx_getgrgid(gid_t gid) {
  void *ret_ptr = getgrgid(gid);
  __softboundmpx_store_return_metadata(ret_ptr, (char *)ret_ptr + 1024 * 1024);
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx_getgrgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getgrgid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x100000,%rsi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_getgrgid>:
push   %rbx
call   1030 <getgrgid@plt>
mov    %rax,%rbx
lea    0x100000(%rax),%rsi
mov    %rax,%rdi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.group = type opaque
define weak %struct.group* @softboundmpx_getgrgid(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @getgrgid(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1048576
%9 = call i32 @__softboundmpx_store_return_metadata(i8* %6, i8* %8)
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to %struct.group*
ret %struct.group* %11
}

LLVM IR (-O2):
%struct.group = type opaque
define weak %struct.group* @softboundmpx_getgrgid(i32 %0) {
%2 = tail call i8* @getgrgid(i32 %0)
%3 = getelementptr inbounds i8, i8* %2, i64 1048576
%4 = tail call i32 @__softboundmpx_store_return_metadata(i8* %2, i8* %3)
%5 = bitcast i8* %2 to %struct.group*
ret %struct.group* %5
}
/* Variables and functions */
int recvwait(int, unsigned char *, int);
int recvbyte(int sock) {
  unsigned char buffer[1];
  int ret;
  ret = recvwait(sock, buffer, 1);
  if (ret < 0)
    return ret;
  return buffer[0];
}


x86 assembly (clang, -O0):
<recvbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <recvwait@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1144 <recvbyte+0x34>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <recvbyte+0x3b>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recvbyte>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <recvwait@plt>
test   %eax,%eax
movzbl 0x7(%rsp),%ecx
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @recvbyte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1 x i8]
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
%8 = call i32 @recvwait(i32 %6, i8* %7, i32 1)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %5
store i32 %12, i32* %2
br label %17
13: ; preds = %1
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @recvbyte(i32 %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = call i32 @recvwait(i32 %0, i8* %3, i32 1)
%5 = icmp slt i32 %4, 0
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = select i1 %5, i32 %4, i32 %7
ret i32 %8
}
int test2(int a, int b) { return a ? (void)a, b : a; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <test2+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <test2+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test2(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 0, i32 %1
ret i32 %4
}
void VMR3Suspend(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3Suspend() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("The length of int %d.\n", sizeof(int));
  printf("The length of long %d.\n", sizeof(long));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"The length of int %d.\0A\00"
@.str.1 = [24 x i8] c"The length of long %d.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"The length of int %d.\0A\00"
@.str.1 = [24 x i8] c"The length of long %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 8)
ret i32 0
}
long durationToCm(long duration) { return duration / 58.2; }


x86 assembly (clang, -O0):
<durationToCm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<durationToCm>:
cvtsi2sd %rdi,%xmm0
divsd  0xef3(%rip),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @durationToCm(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = fdiv double %4, 5.820000e+01
%6 = fptosi double %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @durationToCm(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fdiv double %2, 5.820000e+01
%4 = fptosi double %3 to i64
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void put_padding(int length, FILE *f) {
  int i;
  for (i = 0; i < length; i++) {
    fputc(0x00, f);
  }
}


x86 assembly (clang, -O0):
<put_padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114b <put_padding+0x3b>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <put_padding+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_padding>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112f <put_padding+0x1f>
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax)
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1120 <put_padding+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @put_padding(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fputc(i32 0, i32* %1)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtpd_ps(int /*<<< orphan*/);
__m128 __attribute__((no, unused)) test(__m128d p) { return _mm_cvtpd_ps(p); }


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_cvtpd_ps@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = tail call i32 @_mm_cvtpd_ps(i32 %0)
ret i32 %2
}
void setCallback(void *f) { (void)f; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __thinthin_destroy_trampoline(struct gcc_trampoline *);
void destroy_trampoline(struct gcc_trampoline *m_tramp) {
  __thinthin_destroy_trampoline(m_tramp);
}


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

x86 assembly (clang, -O2):
<destroy_trampoline>:
jmp    1030 <__thinthin_destroy_trampoline@plt>

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

LLVM IR (-O2):
%struct.gcc_trampoline = type { i32 }
define void @destroy_trampoline(%struct.gcc_trampoline* %0) {
%2 = tail call i32 @__thinthin_destroy_trampoline(%struct.gcc_trampoline* %0)
ret void
}
void closegraph() {}


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

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

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

LLVM IR (-O2):
define void @closegraph() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, char *);
int ini_writesection(FILE *file, char *name) {
  return fprintf(file, "[%s]\n", name);
}


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

x86 assembly (clang, -O2):
<ini_writesection>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"[%s]\0A\00"
define i32 @ini_writesection(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 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"[%s]\0A\00"
define i32 @ini_writesection(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %3
}
int test_imm_EFuint16_mem(unsigned short *val) {
  return ((*val) & (0xEF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_EFuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 239
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int jhash(char const *, int, int);
int ppi_hash_name(const char *name) {
  return jhash(name, 16, (0x3af5f2ee)) & ((1 << (8)) - 1);
}


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

x86 assembly (clang, -O2):
<ppi_hash_name>:
push   %rax
mov    $0x10,%esi
mov    $0x3af5f2ee,%edx
call   1030 <jhash@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ppi_hash_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @jhash(i8* %3, i32 16, i32 989197038)
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @ppi_hash_name(i8* %0) {
%2 = tail call i32 @jhash(i8* %0, i32 16, i32 989197038)
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ glutSolidSphere(double, int, int);
void store_head_SL2(void) {
  glPushMatrix();
  glTranslatef(0.0, 0.8 + 0.2, 0.0);
  glScalef(0.2, 0.2, 0.1);
  glutSolidSphere(1.0, 10, 10);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<store_head_SL2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
xorps  %xmm2,%xmm2
movsd  0xe9a(%rip),%xmm1
movaps %xmm2,%xmm0
call   1070 <glTranslatef@plt>
movsd  0xe92(%rip),%xmm1
movsd  0xe92(%rip),%xmm2
movaps %xmm1,%xmm0
call   1040 <glScalef@plt>
movsd  0xe72(%rip),%xmm0
mov    $0xa,%esi
mov    %esi,%edi
call   1060 <glutSolidSphere@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_head_SL2>:
push   %rax
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
movsd  0xea0(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1070 <glTranslatef@plt>
movsd  0xe95(%rip),%xmm0
movsd  0xe95(%rip),%xmm2
movaps %xmm0,%xmm1
call   1040 <glScalef@plt>
movsd  0xe75(%rip),%xmm0
mov    $0xa,%edi
mov    $0xa,%esi
call   1060 <glutSolidSphere@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @store_head_SL2() {
%1 = call i32 (...) @glPushMatrix()
%2 = call i32 @glTranslatef(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%3 = call i32 @glScalef(double 2.000000e-01, double 2.000000e-01, double 1.000000e-01)
%4 = call i32 @glutSolidSphere(double 1.000000e+00, i32 10, i32 10)
%5 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @store_head_SL2() {
%1 = tail call i32 (...) @glPushMatrix()
%2 = tail call i32 @glTranslatef(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%3 = tail call i32 @glScalef(double 2.000000e-01, double 2.000000e-01, double 1.000000e-01)
%4 = tail call i32 @glutSolidSphere(double 1.000000e+00, i32 10, i32 10)
%5 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_SUBW(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xf9);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_SUBW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xf9,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_SUBW>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xf9,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_SUBW(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 249)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_SUBW(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 249)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
unsigned char _ucAsyncSend(unsigned char ucChar) { return (1); }


x86 assembly (clang, -O0):
<_ucAsyncSend>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ucAsyncSend>:
mov    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @_ucAsyncSend(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @_ucAsyncSend(i8 zeroext %0) {
ret i8 1
}
/* Type definitions */
struct map_session_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ atcommand_killmonster_sub(int const,
                                             struct map_session_data *,
                                             char const *, int);
atcommand_killmonster(const int fd, struct map_session_data *sd,
                      const char *command, const char *message) {
  atcommand_killmonster_sub(fd, sd, message, 1);
  return 0;
}


x86 assembly (clang, -O0):
<atcommand_killmonster>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <atcommand_killmonster_sub@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atcommand_killmonster>:
push   %rax
mov    %rcx,%rdx
mov    $0x1,%ecx
call   1030 <atcommand_killmonster_sub@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.map_session_data = type { i32 }
define i32 @atcommand_killmonster(i32 %0, %struct.map_session_data* %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @atcommand_killmonster_sub(i32 %0, %struct.map_session_data* %1, i8* %3, i32 1)
ret i32 0
}
void I2CPECPositionConfig(unsigned long ulBase, unsigned long ulPECPosition) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000800;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= ulPECPosition;
}


x86 assembly (clang, -O0):
<I2CPECPositionConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffff7ff,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CPECPositionConfig>:
andq   $0xfffffffffffff7ff,(%rdi)
or     %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @I2CPECPositionConfig(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 0
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -2049
store volatile i64 %9, i64* %7
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = add i64 %11, 0
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @I2CPECPositionConfig(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -2049
store volatile i64 %5, i64* %3
%6 = load volatile i64, i64* %3
%7 = or i64 %6, %1
store volatile i64 %7, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void g_tcp_close(int sck) {
  if (sck == 0) {
    return;
  }
  close(sck);
}


x86 assembly (clang, -O0):
<g_tcp_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112a <g_tcp_close+0x1a>
jmp    1132 <g_tcp_close+0x22>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_tcp_close>:
test   %edi,%edi
je     1119 <g_tcp_close+0x9>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @g_tcp_close(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
void CRSetCrashLogMessage(const char *msg) {}


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

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

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

LLVM IR (-O2):
define void @CRSetCrashLogMessage(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ferror(int /*<<< orphan*/ *);
size_t fwrite(void *, size_t, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ perrordie(char *);
size_t safe_fwrite(void *ptr, size_t size, size_t nmemb, FILE *f) {
  size_t r = fwrite(ptr, size, nmemb, f);
  if (r == 0 && ferror(f))
    perrordie("fread");
  return r;
}


x86 assembly (clang, -O0):
<safe_fwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1050 <fwrite@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    118b <safe_fwrite+0x5b>
mov    -0x20(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     118b <safe_fwrite+0x5b>
lea    0xe7a(%rip),%rdi
call   1040 <perrordie@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fwrite>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
call   1050 <fwrite@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115d <safe_fwrite+0x2d>
mov    %r14,%rdi
call   1030 <ferror@plt>
test   %rax,%rax
je     115d <safe_fwrite+0x2d>
lea    0xea8(%rip),%rdi
call   1040 <perrordie@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"fread\00"
define i64 @safe_fwrite(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i32*, i32** %8
%14 = call i64 @fwrite(i8* %10, i64 %11, i64 %12, i32* %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %4
%18 = load i32*, i32** %8
%19 = call i64 @ferror(i32* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 @perrordie(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %17, %4
%24 = load i64, i64* %9
ret i64 %24
}

LLVM IR (-O2):
@.str = [6 x i8] c"fread\00"
define i64 @safe_fwrite(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = tail call i64 @ferror(i32* %3)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @perrordie(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %7, %4
ret i64 %5
}
void xo_syslog_handle_close(void *opaque __attribute__((__unused__))) {}


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

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

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

LLVM IR (-O2):
define void @xo_syslog_handle_close(i8* nocapture %0) {
ret void
}
int fun1150() { return 1150; }


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

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

LLVM IR (-O0):
define i32 @fun1150() {
ret i32 1150
}

LLVM IR (-O2):
define i32 @fun1150() {
ret i32 1150
}
double get_temperature(double mv) {
  double d;
  d = mv - 0.500;
  d = (d * 1000.0) / 10.0;
  return (d);
}


x86 assembly (clang, -O0):
<get_temperature>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_temperature>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_temperature(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 5.000000e-01
store double %5, double* %3
%6 = load double, double* %3
%7 = fmul double %6, 1.000000e+03
%8 = fdiv double %7, 1.000000e+01
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @get_temperature(double %0) {
%2 = fadd double %0, -5.000000e-01
%3 = fmul double %2, 1.000000e+03
%4 = fdiv double %3, 1.000000e+01
ret double %4
}
void d2i_ASN1_UINTEGER(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ASN1_UINTEGER() {
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_event_add_post(void *e, void **s, void *callback, void *userdata) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_add_post>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
mov    0x2ec3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_event_add_post>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_add_post(i8* %0, i8** %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_add_post(i8* nocapture readnone %0, i8** nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Variables and functions */
int random();
int randnum(void) { return random(); }


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

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

LLVM IR (-O0):
define i32 @randnum() {
%1 = call i32 (...) @random()
ret i32 %1
}

LLVM IR (-O2):
define i32 @randnum() {
%1 = tail call i32 (...) @random()
ret i32 %1
}
int clamp(int value, int from, int to) {
  return value < from ? from : value > to ? to : value;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <clamp+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int);
void param_fwritei(FILE *fp, char *var_name, int val) {
  fprintf(fp, "%s = %d;\n", var_name, val);
}


x86 assembly (clang, -O0):
<param_fwritei>:
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),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_fwritei>:
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s = %d;\0A\00"
define void @param_fwritei(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s = %d;\0A\00"
define void @param_fwritei(i32* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_smean(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_smean(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1030 <stdlib_strided_smean@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_smean@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_smean(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_smean(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_erro(char *);
int /*<<< orphan*/ log_info(char *);
int /*<<< orphan*/ log_warning(char *);
int main(void) {
  log_warning("Deu um warning aqui bro");
  log_erro("Deu um erro aqui bro");
  log_info("Deu um info aqui bro");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <log_warning@plt>
lea    0xed1(%rip),%rdi
call   1030 <log_erro@plt>
lea    0xeda(%rip),%rdi
call   1040 <log_info@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <log_warning@plt>
lea    0xed4(%rip),%rdi
call   1030 <log_erro@plt>
lea    0xedd(%rip),%rdi
call   1040 <log_info@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Deu um warning aqui bro\00"
@.str.1 = [21 x i8] c"Deu um erro aqui bro\00"
@.str.2 = [21 x i8] c"Deu um info aqui bro\00"
define i32 @main() {
%1 = call i32 @log_warning(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @log_erro(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @log_info(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Deu um warning aqui bro\00"
@.str.1 = [21 x i8] c"Deu um erro aqui bro\00"
@.str.2 = [21 x i8] c"Deu um info aqui bro\00"
define i32 @main() {
%1 = tail call i32 @log_warning(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @log_erro(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @log_info(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
void OutputDebugString(char *string) { syslog(LOG_DEBUG, "%s", string); }


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

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

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

LLVM IR (-O2):
@LOG_DEBUG = global i32 0
@.str = [3 x i8] c"%s\00"
define void @OutputDebugString(i8* %0) {
%2 = load i32, i32* @LOG_DEBUG
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct c2tool_state {
  int dummy;
};

/* Variables and functions */
int __handle_cmd(struct c2tool_state *, int, char **, int /*<<< orphan*/ *);
int handle_cmd(struct c2tool_state *state, int argc, char **argv) {
  return __handle_cmd(state, argc, argv, NULL);
}


x86 assembly (clang, -O0):
<handle_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <__handle_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_cmd>:
xor    %ecx,%ecx
jmp    1030 <__handle_cmd@plt>

LLVM IR (-O0):
%struct.c2tool_state = type { i32 }
define i32 @handle_cmd(%struct.c2tool_state* %0, i32 %1, i8** %2) {
%4 = alloca %struct.c2tool_state*
%5 = alloca i32
%6 = alloca i8**
store %struct.c2tool_state* %0, %struct.c2tool_state** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.c2tool_state*, %struct.c2tool_state** %4
%8 = load i32, i32* %5
%9 = load i8**, i8*** %6
%10 = call i32 @__handle_cmd(%struct.c2tool_state* %7, i32 %8, i8** %9, i32* null)
ret i32 %10
}

LLVM IR (-O2):
%struct.c2tool_state = type { i32 }
define i32 @handle_cmd(%struct.c2tool_state* %0, i32 %1, i8** %2) {
%4 = tail call i32 @__handle_cmd(%struct.c2tool_state* %0, i32 %1, i8** %2, i32* null)
ret i32 %4
}