xunge/DecIR huggingface dataset:
/* Variables and functions */
int posix_memalign(void **, int, int);
int main(void) {
  void *a;
  int ret = posix_memalign(&a, sizeof(void *) * 2, 42);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x10,%esi
mov    $0x2a,%edx
call   1030 <posix_memalign@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
mov    $0x10,%esi
mov    $0x2a,%edx
call   1030 <posix_memalign@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @posix_memalign(i8** %2, i32 16, i32 42)
store i32 %4, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i32 @posix_memalign(i8** %1, i32 16, i32 42)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpge_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpge_sd(__m128d A, __m128d B) { return _mm_cmpge_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cmpge_sd>:
jmp    1030 <_mm_cmpge_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpge_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpge_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_alpha_args(char *args) {
  if (args != NULL)
    free(args);
}


x86 assembly (clang, -O0):
<free_alpha_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_alpha_args+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @free_alpha_args(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 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @free_alpha_args(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
struct genomeRangeTree {
  int dummy;
};

/* Variables and functions */
struct genomeRangeTree *genomeRangeTreeNewSize(int /*<<< orphan*/);
struct genomeRangeTree *genomeRangeTreeNew() {
  return genomeRangeTreeNewSize(0);
}


x86 assembly (clang, -O0):
<genomeRangeTreeNew>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <genomeRangeTreeNewSize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genomeRangeTreeNew>:
xor    %edi,%edi
jmp    1030 <genomeRangeTreeNewSize@plt>

LLVM IR (-O0):
%struct.genomeRangeTree = type { i32 }
define %struct.genomeRangeTree* @genomeRangeTreeNew() {
%1 = call %struct.genomeRangeTree* @genomeRangeTreeNewSize(i32 0)
ret %struct.genomeRangeTree* %1
}

LLVM IR (-O2):
%struct.genomeRangeTree = type { i32 }
define %struct.genomeRangeTree* @genomeRangeTreeNew() {
%1 = tail call %struct.genomeRangeTree* @genomeRangeTreeNewSize(i32 0)
ret %struct.genomeRangeTree* %1
}
/* Variables and functions */
char *charToHex(int);
int /*<<< orphan*/ free(char *);
int hexToChar(int, char *);
int testHexChar() {
  int charHexIdentity = 1;
  int i = 0;
  for (; i < 128; i++) {
    char *res = charToHex(i);
    charHexIdentity &= i == hexToChar(8, res);
    free(res);
  }
  return charHexIdentity;
}


x86 assembly (clang, -O0):
<testHexChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    119f <testHexChar+0x6f>
mov    -0x8(%rbp),%edi
call   1030 <charToHex@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x8,%edi
call   1050 <hexToChar@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <testHexChar+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testHexChar>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <charToHex@plt>
mov    %rax,%r14
mov    $0x8,%edi
mov    %rax,%rsi
call   1050 <hexToChar@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
and    %ecx,%ebx
mov    %r14,%rdi
call   1040 <free@plt>
add    $0x1,%ebp
cmp    $0x80,%ebp
jne    1140 <testHexChar+0x10>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @testHexChar() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 1, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 128
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i8* @charToHex(i32 %8)
store i8* %9, i8** %3
%10 = load i32, i32* %2
%11 = load i8*, i8** %3
%12 = call i32 @hexToChar(i32 8, i8* %11)
%13 = icmp eq i32 %10, %12
%14 = zext i1 %13 to i32
%15 = load i32, i32* %1
%16 = and i32 %15, %14
store i32 %16, i32* %1
%17 = load i8*, i8** %3
%18 = call i32 @free(i8* %17)
br label %19
19: ; preds = %7
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %4
22: ; preds = %4
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @testHexChar() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %10, %1 ]
%4 = tail call i8* @charToHex(i32 %3)
%5 = tail call i32 @hexToChar(i32 8, i8* %4)
%6 = icmp eq i32 %3, %5
%7 = zext i1 %6 to i32
%8 = and i32 %2, %7
%9 = tail call i32 @free(i8* %4)
%10 = add nuw nsw i32 %3, 1
%11 = icmp eq i32 %10, 128
br i1 %11, label %12, label %1
12: ; preds = %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void fatal(char *str) {
  perror(str);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @fatal(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int tor_open_socket_with_extensions(int, int, int, int, int /*<<< orphan*/);
int tor_open_socket(int domain, int type, int protocol) {
  return tor_open_socket_with_extensions(domain, type, protocol, 1, 0);
}


x86 assembly (clang, -O0):
<tor_open_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1030 <tor_open_socket_with_extensions@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor_open_socket>:
mov    $0x1,%ecx
xor    %r8d,%r8d
jmp    1030 <tor_open_socket_with_extensions@plt>

LLVM IR (-O0):
define i32 @tor_open_socket(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 = load i32, i32* %6
%10 = call i32 @tor_open_socket_with_extensions(i32 %7, i32 %8, i32 %9, i32 1, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @tor_open_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @tor_open_socket_with_extensions(i32 %0, i32 %1, i32 %2, i32 1, i32 0)
ret i32 %4
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ str_cats(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *str_sjoin(char *s1, char *s2) {
  char *p = malloc(strlen(s1) + strlen(s2) + 2);
  strcpy(p, s1);
  str_cats(p, s2);
  return p;
}


x86 assembly (clang, -O0):
<str_sjoin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x2,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <str_cats@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_sjoin>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1050 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x2,%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <str_cats@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_sjoin(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 2
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @str_cats(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @str_sjoin(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 2
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @str_cats(i8* %7, i8* %1)
ret i8* %7
}
int test_imm_59int64_midword_reg(long long val) {
  return ((val >> 16) & (0x59 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_59int64_midword_reg>:
test   $0x590000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_59int64_midword_reg(i64 %0) {
%2 = and i64 %0, 5832704
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
int alphasort(struct dirent const **, struct dirent const **);
int reverseSortLogFileName(const struct dirent **e1, const struct dirent **e2) {
  return alphasort(e2, e1);
}


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

x86 assembly (clang, -O2):
<reverseSortLogFileName>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <alphasort@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @reverseSortLogFileName(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %4
%6 = load %struct.dirent**, %struct.dirent*** %3
%7 = call i32 @alphasort(%struct.dirent** %5, %struct.dirent** %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @reverseSortLogFileName(%struct.dirent** %0, %struct.dirent** %1) {
%3 = tail call i32 @alphasort(%struct.dirent** %1, %struct.dirent** %0)
ret i32 %3
}
int hash_cmp_num(x, y)
int x, y;
{ return ((x) != (y)); }


x86 assembly (clang, -O0):
<hash_cmp_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_cmp_num>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @hash_cmp_num(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash_cmp_num(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned char error_code;
};
struct TYPE_4__ {
  TYPE_1__ xerror;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xerror_error_code(void *_p, unsigned char _v) {
  ((XEvent *)_p)->xerror.error_code = (unsigned char)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xerror_error_code>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xerror_error_code>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i8 }
define void @set_XEvent_xerror_error_code(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i8 %5, i8* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xerror_error_code(i8* nocapture writeonly %0, i8 zeroext %1) {
store i8 %1, i8* %0
ret void
}
unsigned int supplementalHash(unsigned int h) {
  return ((h << 7) - h + (h >> 9) + (h >> 17));
}


x86 assembly (clang, -O0):
<supplementalHash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x7,%eax
sub    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x9,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x11,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<supplementalHash>:
mov    %edi,%ecx
shl    $0x7,%ecx
sub    %edi,%ecx
mov    %edi,%eax
shr    $0x9,%eax
add    %ecx,%eax
shr    $0x11,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @supplementalHash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 7
%5 = load i32, i32* %2
%6 = sub i32 %4, %5
%7 = load i32, i32* %2
%8 = lshr i32 %7, 9
%9 = add i32 %6, %8
%10 = load i32, i32* %2
%11 = lshr i32 %10, 17
%12 = add i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @supplementalHash(i32 %0) {
%2 = mul i32 %0, 127
%3 = lshr i32 %0, 9
%4 = add i32 %2, %3
%5 = lshr i32 %0, 17
%6 = add i32 %4, %5
ret i32 %6
}
double minimus(double x, double y) {
  if (x <= y) {
    return x;
  }
  return y;
}


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

x86 assembly (clang, -O2):
<minimus>:
movapd %xmm0,%xmm2
cmplesd %xmm1,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @minimus(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* %4
%7 = load double, double* %5
%8 = fcmp ole double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
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 @minimus(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int _locale_charsets(void) {
  puts("ISO_10646");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"ISO_10646\00"
define i32 @_locale_charsets() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int _pclose(int /*<<< orphan*/ *);
int pipeclose(FILE *p) { return _pclose(p); }


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

x86 assembly (clang, -O2):
<pipeclose>:
jmp    1030 <_pclose@plt>

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

LLVM IR (-O2):
define i32 @pipeclose(i32* %0) {
%2 = tail call i32 @_pclose(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBDevMode(uint32_t ui32Base) {
  ;
  (*((volatile unsigned char *)(ui32Base + 0x0000041C))) =
      0x00000002 | 0x00000001;
}


x86 assembly (clang, -O0):
<USBDevMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x3,0x41c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevMode>:
movb   $0x3,0x41c(%rdi)
ret

LLVM IR (-O0):
define void @USBDevMode(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1052
%5 = inttoptr i64 %4 to i8*
store volatile i8 3, i8* %5
ret void
}

LLVM IR (-O2):
define void @USBDevMode(i64 %0) {
%2 = add nsw i64 %0, 1052
%3 = inttoptr i64 %2 to i8*
store volatile i8 3, i8* %3
ret void
}
/* Variables and functions */
int isprint(char);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", isprint('a'));
  printf("%d\n", isprint('\t'));
  printf("%d\n", isprint(' '));
  printf("%d\n", isprint('.'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1040 <isprint@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x9,%edi
call   1040 <isprint@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x20,%edi
call   1040 <isprint@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2e,%edi
call   1040 <isprint@plt>
mov    %eax,%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x61,%edi
call   1040 <isprint@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x9,%edi
call   1040 <isprint@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x20,%edi
call   1040 <isprint@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2e,%edi
call   1040 <isprint@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @isprint(i8 signext 97)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @isprint(i8 signext 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @isprint(i8 signext 32)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @isprint(i8 signext 46)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @isprint(i8 signext 97)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isprint(i8 signext 9)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isprint(i8 signext 32)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @isprint(i8 signext 46)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
void fpga_mgr_debugfs_add(struct fpga_manager *mgr) {}


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

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

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

LLVM IR (-O2):
%struct.fpga_manager = type opaque
define void @fpga_mgr_debugfs_add(%struct.fpga_manager* nocapture %0) {
ret void
}
void getrule(char *buf, char *result) {
  while (*buf != ' ') {
    *result++ = *buf++;
  }
  *result = '\0';
}


x86 assembly (clang, -O0):
<getrule>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1143 <getrule+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <getrule+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrule>:
mov    (%rdi),%al
cmp    $0x20,%al
je     1121 <getrule+0x21>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rsi)
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
cmp    $0x20,%al
jne    1110 <getrule+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @getrule(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 32
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 32
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
/* Variables and functions */
double sqrt(long long);
int Check(long long int r, long long int s) {
  double q;
  q = sqrt(r);
  if (q - (int)q == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<Check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
cvttsd2si -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115f <Check+0x4f>
jp     115f <Check+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1166 <Check+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Check>:
push   %rax
call   1030 <sqrt@plt>
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Check(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca double
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = call double @sqrt(i64 %7)
store double %8, double* %6
%9 = load double, double* %6
%10 = load double, double* %6
%11 = fptosi double %10 to i32
%12 = sitofp i32 %11 to double
%13 = fsub double %9, %12
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @Check(i64 %0, i64 %1) {
%3 = tail call double @sqrt(i64 %0)
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = fsub double %3, %5
%7 = fcmp oeq double %6, 0.000000e+00
%8 = zext i1 %7 to i32
ret i32 %8
}
void tlog3a_xgcb_length(const char *args, const char **unused) {}


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

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

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

LLVM IR (-O2):
define void @tlog3a_xgcb_length(i8* nocapture %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void OTG_HS_WKUP_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @OTG_HS_WKUP_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @OTG_HS_WKUP_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int somefunction() { return 42; }


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

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

LLVM IR (-O0):
define i32 @somefunction() {
ret i32 42
}

LLVM IR (-O2):
define i32 @somefunction() {
ret i32 42
}
/* Type definitions */
struct mtd_info_user {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ MEMGETINFO;
int ioctl(int, int /*<<< orphan*/, struct mtd_info_user *);
int getmeminfo(int fd, struct mtd_info_user *mtd) {
  return (ioctl(fd, MEMGETINFO, mtd));
}


x86 assembly (clang, -O0):
<getmeminfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmeminfo>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.mtd_info_user = type { i32 }
@MEMGETINFO = global i32 0
define i32 @getmeminfo(i32 %0, %struct.mtd_info_user* %1) {
%3 = alloca i32
%4 = alloca %struct.mtd_info_user*
store i32 %0, i32* %3
store %struct.mtd_info_user* %1, %struct.mtd_info_user** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @MEMGETINFO
%7 = load %struct.mtd_info_user*, %struct.mtd_info_user** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, %struct.mtd_info_user* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.mtd_info_user = type { i32 }
@MEMGETINFO = global i32 0
define i32 @getmeminfo(i32 %0, %struct.mtd_info_user* %1) {
%3 = load i32, i32* @MEMGETINFO
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.mtd_info_user* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bitmapGet(char *, int);
int bitmapFirstFit(char *bitmap) {
  int bit_mask[8] = {128, 64, 32, 16, 8, 4, 2, 1};
  int i;
  for (i = 0; i < (128); i++) {
    if (!bitmapGet(bitmap, i)) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<bitmapFirstFit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x80,-0x34(%rbp)
jge    118f <bitmapFirstFit+0x7f>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <bitmapGet@plt>
cmp    $0x0,%eax
jne    117c <bitmapFirstFit+0x6c>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1196 <bitmapFirstFit+0x86>
jmp    1181 <bitmapFirstFit+0x71>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114f <bitmapFirstFit+0x3f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmapFirstFit>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <bitmapGet@plt>
test   %eax,%eax
je     113e <bitmapFirstFit+0x2e>
add    $0x1,%ebx
cmp    $0x80,%ebx
jne    1120 <bitmapFirstFit+0x10>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.bitmapFirstFit.bit_mask = [8 x i32] [i32 128, i32 64, i32 32, i32 16, i32 8, i32 4, i32 2, i32 1]
define i32 @bitmapFirstFit(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [8 x i32]
%5 = alloca i32
store i8* %0, i8** %3
%6 = bitcast [8 x i32]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %18, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 128
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = call i32 @bitmapGet(i8* %11, i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %10
%16 = load i32, i32* %5
store i32 %16, i32* %2
br label %22
17: ; preds = %10
br label %18
18: ; preds = %17
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %7
21: ; preds = %7
store i32 -1, i32* %2
br label %22
22: ; preds = %21, %15
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @bitmapFirstFit(i8* %0) {
br label %2
2: ; preds = %1, %6
%3 = phi i32 [ 0, %1 ], [ %7, %6 ]
%4 = tail call i32 @bitmapGet(i8* %0, i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 128
br i1 %8, label %9, label %2
9: ; preds = %6, %2
%10 = phi i32 [ %3, %2 ], [ -1, %6 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int);
main() {
  char str1[] = "Hello";
  char str2[] = "world";
  int y = 2;
  printf("%s %s! I'm sample %d.\n", str1, str2, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xedc(%rip),%ax
mov    %ax,-0x2(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
lea    -0x6(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    -0x10(%rbp),%ecx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x6f,0x14(%rsp)
movl   $0x6c6c6548,0x10(%rsp)
6c
movw   $0x64,0xc(%rsp)
movl   $0x6c726f77,0x8(%rsp)
6c
lea    0xed3(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    $0x2,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str1 = [6 x i8] c"Hello\00"
@__const.main.str2 = [6 x i8] c"world\00"
@.str = [23 x i8] c"%s %s! I'm sample %d.\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = alloca i32
%4 = bitcast [6 x i8]* %1 to i8*
%5 = bitcast [6 x i8]* %2 to i8*
store i32 2, i32* %3
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [6 x i8] c"Hello\00"
@__const.main.str2 = [6 x i8] c"world\00"
@.str = [23 x i8] c"%s %s! I'm sample %d.\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4, i32 2)
ret i32 0
}
int empty(const char *s) {
  while (*s == ' ' || *s == '\t' || *s == '\n' || *s == '\r')
    s++;
  return (!*s);
}


x86 assembly (clang, -O0):
<empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1157 <empty+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1157 <empty+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1157 <empty+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <empty+0x67>
jmp    1178 <empty+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <empty+0x8>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty>:
movabs $0x100002600,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
cmp    $0x20,%rcx
ja     1125 <empty+0x25>
bt     %rcx,%rax
jae    1125 <empty+0x25>
add    $0x1,%rdi
jmp    1110 <empty+0x10>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @empty(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
i8 10, label %5
i8 13, label %5
]
5: ; preds = %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
%8 = icmp eq i8 %4, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
void g(int i, int j, int k) {
  int a = 3;
  int b = 5;
  int c = 7;
  a = i + 3;
  b = j + 1;
  c = k * 2;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x7,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @g(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *xstrdup(const char *s) {
  char *t;
  t = xmalloc(strlen(s) + 1);
  strcpy(t, s);
  return t;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ stricmp(char *, char *);
int32_t entcmp(const void *entry1, const void *entry2) {
  return stricmp(*(char **)entry1, *(char **)entry2);
}


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

x86 assembly (clang, -O2):
<entcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <stricmp@plt>

LLVM IR (-O0):
define i32 @entcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @stricmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @entcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @stricmp(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ infinite();
void call_infinite() { infinite(); }


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

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

LLVM IR (-O0):
define void @call_infinite() {
%1 = call i32 (...) @infinite()
ret void
}

LLVM IR (-O2):
define void @call_infinite() {
%1 = tail call i32 (...) @infinite()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  int a, b;
  a = 2;
  b = 4;
  if ((a = 2) & (b = 4))
    printf(" TAK\n");
  else
    printf("NIE\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1151 <main+0x41>
jmp    1162 <main+0x52>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <main+0x5e>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c" TAK\0A\00"
@.str.1 = [5 x i8] c"NIE\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
store i32 4, i32* %7
store i32 2, i32* %6
store i32 4, i32* %7
br i1 false, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"NIE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int __builtin_ptx_read_nctaid_w();
int __builtin_ptx_read_nctaid_x();
int __builtin_ptx_read_nctaid_y();
int __builtin_ptx_read_nctaid_z();
int read_nctaid() {
  int x = __builtin_ptx_read_nctaid_x();
  int y = __builtin_ptx_read_nctaid_y();
  int z = __builtin_ptx_read_nctaid_z();
  int w = __builtin_ptx_read_nctaid_w();
  return x + y + z + w;
}


x86 assembly (clang, -O0):
<read_nctaid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__builtin_ptx_read_nctaid_x@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__builtin_ptx_read_nctaid_y@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__builtin_ptx_read_nctaid_z@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <__builtin_ptx_read_nctaid_w@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_nctaid>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__builtin_ptx_read_nctaid_x@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <__builtin_ptx_read_nctaid_y@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <__builtin_ptx_read_nctaid_z@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <__builtin_ptx_read_nctaid_w@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_nctaid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @__builtin_ptx_read_nctaid_x()
store i32 %5, i32* %1
%6 = call i32 (...) @__builtin_ptx_read_nctaid_y()
store i32 %6, i32* %2
%7 = call i32 (...) @__builtin_ptx_read_nctaid_z()
store i32 %7, i32* %3
%8 = call i32 (...) @__builtin_ptx_read_nctaid_w()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_nctaid() {
%1 = tail call i32 (...) @__builtin_ptx_read_nctaid_x()
%2 = tail call i32 (...) @__builtin_ptx_read_nctaid_y()
%3 = tail call i32 (...) @__builtin_ptx_read_nctaid_z()
%4 = tail call i32 (...) @__builtin_ptx_read_nctaid_w()
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, %4
ret i32 %7
}
float angcos(float angle) { return cosf((angle)*0.01745329252); }


x86 assembly (clang, -O0):
<angcos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <cosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angcos>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <cosf@plt>

LLVM IR (-O0):
define float @angcos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3F91DF46A252DD11
%6 = fptrunc double %5 to float
%7 = call float @cosf(float %6)
ret float %7
}

LLVM IR (-O2):
define float @angcos(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3F91DF46A252DD11
%4 = fptrunc double %3 to float
%5 = tail call float @cosf(float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void thread_buf_destroy(void *buf) {
  if (buf)
    free(buf);
}


x86 assembly (clang, -O0):
<thread_buf_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <thread_buf_destroy+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @thread_buf_destroy(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 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @thread_buf_destroy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int ctoi(char c) { return (c - '0'); }


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

x86 assembly (clang, -O2):
<ctoi>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ctoi(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @ctoi(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}