xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_sp();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%%esp: 0x%#010x\n", get_sp());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_sp@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <get_sp@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"%%esp: 0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_sp()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int main() {
  int sum = 0;
  do {
    sum += 1;
    return 5;
  } while (1);
  return sum;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
store i32 5, i32* %1
br label %9
6: ; No predecessors!
br i1 true, label %3, label %7
7: ; preds = %6
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %3
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ alarm(unsigned int);
int recv(int, char *, int, int /*<<< orphan*/);
int recv_socket(int sock, char *buf, int size, unsigned int timeout) {
  int bytes_read = 0;
  alarm(timeout);
  bytes_read = recv(sock, buf, size, 0);
  alarm(0);
  if (bytes_read <= 0)
    return (-1);
  return (bytes_read);
}


x86 assembly (clang, -O0):
<recv_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <alarm@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x1c(%rbp)
xor    %edi,%edi
call   1040 <alarm@plt>
cmpl   $0x0,-0x1c(%rbp)
jg     1175 <recv_socket+0x55>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <recv_socket+0x5b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_socket>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ecx,%edi
call   1040 <alarm@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <alarm@plt>
test   %ebx,%ebx
mov    $0xffffffff,%eax
cmovg  %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @recv_socket(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @alarm(i32 %3)
%6 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
%7 = tail call i32 @alarm(i32 0)
%8 = icmp slt i32 %6, 1
%9 = select i1 %8, i32 -1, i32 %6
ret i32 %9
}
void bzero(b, length) unsigned char *b;
int length;
{ memset(b, 0, length); }


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
movslq %esi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %3, i1 false)
ret void
}
/* Variables and functions */
int sendPlace(int);
int game_place(int column) { return sendPlace(column); }


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

x86 assembly (clang, -O2):
<game_place>:
jmp    1030 <sendPlace@plt>

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

LLVM IR (-O2):
define i32 @game_place(i32 %0) {
%2 = tail call i32 @sendPlace(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int getgrouplist(char const *, int /*<<< orphan*/, int /*<<< orphan*/ *, int *);
int mygetgrouplist(const char *user, gid_t group, gid_t *groups, int *ngroups) {
  return getgrouplist(user, group, groups, ngroups);
}


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

x86 assembly (clang, -O2):
<mygetgrouplist>:
jmp    1030 <getgrouplist@plt>

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

LLVM IR (-O2):
define i32 @mygetgrouplist(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 @getgrouplist(i8* %0, i32 %1, i32* %2, i32* %3)
ret i32 %5
}
void foo067(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo067(i32 %0) {
ret void
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ printf(char *, char *, int, int);
void show_version(char *prog) {
  printf("%s-%d.%d\n", basename(prog), 1, 9);
  return;
}


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,%rsi
lea    0xec1(%rip),%rdi
mov    $0x1,%edx
mov    $0x9,%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_version>:
push   %rax
call   1040 <basename@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
mov    $0x1,%edx
mov    $0x9,%ecx
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s-%d.%d\0A\00"
define void @show_version(i8* %0) {
%2 = tail call i8* @basename(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2, i32 1, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int drv_LEDMatrix_list(void) {
  printf("LEDMATRIX by Till Harbaum");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"LEDMATRIX by Till Harbaum\00"
define i32 @drv_LEDMatrix_list() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"LEDMATRIX by Till Harbaum\00"
define i32 @drv_LEDMatrix_list() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ alpha(char);
int alphan(char c) {
  if (alpha(c))
    return (1);
  if (c <= '9' && c >= '0')
    return (1);
  if (c == '$')
    return (1);
  if (c == '@')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<alphan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <alpha@plt>
cmp    $0x0,%rax
je     113d <alphan+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    119c <alphan+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1163 <alphan+0x53>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1163 <alphan+0x53>
movl   $0x1,-0x4(%rbp)
jmp    119c <alphan+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x24,%eax
jne    117c <alphan+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    119c <alphan+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x40,%eax
jne    1195 <alphan+0x85>
movl   $0x1,-0x4(%rbp)
jmp    119c <alphan+0x8c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphan>:
push   %rbx
mov    %edi,%ebx
call   1030 <alpha@plt>
test   %rax,%rax
setne  %al
lea    -0x30(%rbx),%ecx
cmp    $0xa,%cl
setb   %cl
or     %al,%cl
cmp    $0x24,%bl
sete   %al
cmp    $0x40,%bl
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @alphan(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @alpha(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %28
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 57
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 48
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %2
br label %28
17: ; preds = %12, %8
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 36
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 1, i32* %2
br label %28
22: ; preds = %17
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 64
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 1, i32* %2
br label %28
27: ; preds = %22
store i32 0, i32* %2
br label %28
28: ; preds = %27, %26, %21, %16, %7
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @alphan(i8 signext %0) {
%2 = tail call i64 @alpha(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = add i8 %0, -48
%5 = icmp ult i8 %4, 10
%6 = or i1 %5, %3
%7 = icmp eq i8 %0, 36
%8 = icmp eq i8 %0, 64
%9 = or i1 %7, %8
%10 = or i1 %9, %6
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int test_sat_parser_should_fail(char *);
int test09(void) { return test_sat_parser_should_fail("(a or 5b)"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"(a or 5b)\00"
define i32 @test09() {
%1 = tail call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ traverse(struct TreeNode *, int **, int *);
int *postorderTraversal0(struct TreeNode *root, int *returnSize) {
  if (!root)
    return NULL;
  int *arr = (int *)malloc(sizeof(int));
  *returnSize = 0;
  traverse(root, &arr, returnSize);
  return arr;
}


x86 assembly (clang, -O0):
<postorderTraversal0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <postorderTraversal0+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1179 <postorderTraversal0+0x59>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rsi
call   1030 <traverse@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<postorderTraversal0>:
test   %rdi,%rdi
je     115e <postorderTraversal0+0x3e>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,(%rsp)
movl   $0x0,(%r14)
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <traverse@plt>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32* @postorderTraversal0(%struct.TreeNode* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca %struct.TreeNode*
%5 = alloca i32*
%6 = alloca i32*
store %struct.TreeNode* %0, %struct.TreeNode** %4
store i32* %1, i32** %5
%7 = load %struct.TreeNode*, %struct.TreeNode** %4
%8 = icmp ne %struct.TreeNode* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i32* null, i32** %3
br label %18
10: ; preds = %2
%11 = call i64 @malloc(i32 4)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %6
%13 = load i32*, i32** %5
store i32 0, i32* %13
%14 = load %struct.TreeNode*, %struct.TreeNode** %4
%15 = load i32*, i32** %5
%16 = call i32 @traverse(%struct.TreeNode* %14, i32** %6, i32* %15)
%17 = load i32*, i32** %6
store i32* %17, i32** %3
br label %18
18: ; preds = %10, %9
%19 = load i32*, i32** %3
ret i32* %19
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32* @postorderTraversal0(%struct.TreeNode* %0, i32* %1) {
%3 = alloca i32*
%4 = icmp eq %struct.TreeNode* %0, null
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = bitcast i32** %3 to i8*
%7 = tail call i64 @malloc(i32 4)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %3
store i32 0, i32* %1
%9 = call i32 @traverse(%struct.TreeNode* %0, i32** %3, i32* %1)
%10 = load i32*, i32** %3
br label %11
11: ; preds = %2, %5
%12 = phi i32* [ %10, %5 ], [ null, %2 ]
ret i32* %12
}
/* Variables and functions */
scalar_t__ frexp(float, int *);
float frexpf(float x, int *expn) { return (float)frexp(x, expn); }


x86 assembly (clang, -O0):
<frexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <frexp@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frexpf>:
push   %rax
call   1030 <frexp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @frexpf(float %0, i32* %1) {
%3 = alloca float
%4 = alloca i32*
store float %0, float* %3
store i32* %1, i32** %4
%5 = load float, float* %3
%6 = load i32*, i32** %4
%7 = call i64 @frexp(float %5, i32* %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @frexpf(float %0, i32* nocapture %1) {
%3 = tail call i64 @frexp(float %0, i32* %1)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int abs(int);
int randommove() {
  long time();
  int i;
  i = abs((int)time((long *)0));
  return (i % 9);
}


x86 assembly (clang, -O0):
<randommove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
mov    $0x0,%al
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <abs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randommove>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <time@plt>
mov    %eax,%ecx
neg    %ecx
cmovns %ecx,%eax
imul   $0x38e38e39,%rax,%rcx
shr    $0x21,%rcx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @randommove() {
%1 = alloca i32
%2 = call i64 (i64*, ...) bitcast (i64 (...)* @time to i64 (i64*, ...)*)(i64* null)
%3 = trunc i64 %2 to i32
%4 = call i32 @abs(i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = srem i32 %5, 9
ret i32 %6
}

LLVM IR (-O2):
define i32 @randommove() {
%1 = tail call i64 (i64*, ...) bitcast (i64 (...)* @time to i64 (i64*, ...)*)(i64* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @llvm.abs.i32(i32 %2, i1 true)
%4 = urem i32 %3, 9
ret i32 %4
}
/* Variables and functions */
int addfunc(int, int);
void main() {
  int i, j, k;
  k = addfunc(i, j);
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <addfunc@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @addfunc(i32 %4, i32 %5)
store i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @addfunc(i32 undef, i32 undef)
ret void
}
/* Variables and functions */
size_t M_E;
int M_PI;
size_t log2(size_t);
size_t sqrt(int);
double stirling_f(size_t n) {
  return log2(sqrt(2 * M_PI * n)) + n * log2(n / M_E);
}


x86 assembly (clang, -O0):
<stirling_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
imul   %eax,%edi
add    %edi,%edi
call   1040 <sqrt@plt>
mov    %rax,%rdi
call   1030 <log2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e7b(%rip),%rcx
mov    (%rcx),%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
call   1030 <log2@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
imul   %rdx,%rcx
add    %rcx,%rax
movq   %rax,%xmm0
movaps 0xe75(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xe79(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stirling_f>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
imul   %ebx,%edi
add    %edi,%edi
call   1040 <sqrt@plt>
mov    %rax,%rdi
call   1030 <log2@plt>
mov    %rax,%r14
mov    0x2e8c(%rip),%rax
mov    (%rax),%rcx
mov    %rbx,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1165 <stirling_f+0x45>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
jmp    116b <stirling_f+0x4b>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
mov    %rax,%rdi
call   1030 <log2@plt>
imul   %rbx,%rax
add    %r14,%rax
movq   %rax,%xmm1
punpckldq 0xe79(%rip),%xmm1
subpd  0xe81(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI = global i32 0
@M_E = global i64 0
define double @stirling_f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @M_PI
%4 = mul nsw i32 2, %3
%5 = sext i32 %4 to i64
%6 = load i64, i64* %2
%7 = mul i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @sqrt(i32 %8)
%10 = call i64 @log2(i64 %9)
%11 = load i64, i64* %2
%12 = load i64, i64* %2
%13 = load i64, i64* @M_E
%14 = udiv i64 %12, %13
%15 = call i64 @log2(i64 %14)
%16 = mul i64 %11, %15
%17 = add i64 %10, %16
%18 = uitofp i64 %17 to double
ret double %18
}

LLVM IR (-O2):
@M_PI = global i32 0
@M_E = global i64 0
define double @stirling_f(i64 %0) {
%2 = load i32, i32* @M_PI
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 1
%5 = mul i32 %4, %2
%6 = tail call i64 @sqrt(i32 %5)
%7 = tail call i64 @log2(i64 %6)
%8 = load i64, i64* @M_E
%9 = udiv i64 %0, %8
%10 = tail call i64 @log2(i64 %9)
%11 = mul i64 %10, %0
%12 = add i64 %11, %7
%13 = uitofp i64 %12 to double
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_strmap_keyvalue(char *key, char *value) {
  printf("[%s=%s]", key, value);
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"[%s=%s]\00"
define void @print_strmap_keyvalue(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
call6e(f, d, uc, us, ui, ul) float f;
double d;
unsigned char uc;
unsigned short us;
unsigned int ui;
unsigned long ul;
{
  f = f;
  call6f(d, uc, us, ui, ul);
}


x86 assembly (clang, -O0):
<call6e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %esi,%eax
cvtsd2ss %xmm0,%xmm0
mov    %dil,%sil
movss  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %sil,-0x11(%rbp)
mov    %ax,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movzbl -0x11(%rbp),%edi
movzwl -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%al
call   1030 <call6f@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call6e>:
movaps %xmm1,%xmm0
movzbl %dil,%edi
movzwl %si,%esi
mov    $0x1,%al
jmp    1030 <call6f@plt>

LLVM IR (-O0):
define i32 @call6e(double %0, double %1, i32 %2, i32 %3, i32 %4, i64 %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca double
%10 = alloca i8
%11 = alloca i16
%12 = alloca i32
%13 = alloca i64
%14 = fptrunc double %0 to float
%15 = trunc i32 %2 to i8
%16 = trunc i32 %3 to i16
store float %14, float* %8
store double %1, double* %9
store i8 %15, i8* %10
store i16 %16, i16* %11
store i32 %4, i32* %12
store i64 %5, i64* %13
%17 = load float, float* %8
store float %17, float* %8
%18 = load double, double* %9
%19 = load i8, i8* %10
%20 = zext i8 %19 to i32
%21 = load i16, i16* %11
%22 = zext i16 %21 to i32
%23 = load i32, i32* %12
%24 = load i64, i64* %13
%25 = call i32 (double, i32, i32, i32, i64, ...) bitcast (i32 (...)* @call6f to i32 (double, i32, i32, i32, i64, ...)*)(double %18, i32 %20, i32 %22, i32 %23, i64 %24)
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @call6e(double %0, double %1, i32 %2, i32 %3, i32 %4, i64 %5) {
%7 = and i32 %2, 255
%8 = and i32 %3, 65535
%9 = tail call i32 (double, i32, i32, i32, i64, ...) bitcast (i32 (...)* @call6f to i32 (double, i32, i32, i32, i64, ...)*)(double %1, i32 %7, i32 %8, i32 %4, i64 %5)
ret i32 undef
}
/* Variables and functions */
char *dou2pre(double);
scalar_t__ malloc(int);
double pre2dou(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char *in;
  scanf("%s", in);
  double result;
  result = pre2dou(in);
  char *out;
  out = (char *)malloc(sizeof(char) * 33);
  out = dou2pre(result);
  printf("%s\n", out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <pre2dou@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x21,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <dou2pre@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1060 <scanf@plt>
call   1030 <pre2dou@plt>
movsd  %xmm0,(%rsp)
mov    $0x21,%edi
call   1050 <malloc@plt>
movsd  (%rsp),%xmm0
call   1070 <dou2pre@plt>
lea    0xe81(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca double
%4 = alloca i8*
store i32 0, i32* %1
%5 = load i8*, i8** %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call double @pre2dou(i8* %7)
store double %8, double* %3
%9 = call i64 @malloc(i32 33)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load double, double* %3
%12 = call i8* @dou2pre(double %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* undef)
%2 = tail call double @pre2dou(i8* undef)
%3 = tail call i64 @malloc(i32 33)
%4 = tail call i8* @dou2pre(double %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) {
  return -1;
}


x86 assembly (clang, -O0):
<pthread_mutexattr_settype>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_settype(i32* nocapture readnone %0, i32 %1) {
ret i32 -1
}
int tst(void) {
  long long value = 3;
  return -value;
}


x86 assembly (clang, -O0):
<tst>:
push   %rbp
mov    %rsp,%rbp
movq   $0x3,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tst() {
%1 = alloca i64
store i64 3, i64* %1
%2 = load i64, i64* %1
%3 = sub nsw i64 0, %2
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @tst() {
ret i32 -3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XEvent;

/* Variables and functions */
void set_XEvent_type(void *_p, int _v) { ((XEvent *)_p)->type = (int)_v; }


x86 assembly (clang, -O0):
<set_XEvent_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_type>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
unsigned base64_encode_length(unsigned length) {
  return (((length)*8 + 4) / 6);
}


x86 assembly (clang, -O0):
<base64_encode_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0x4,%eax
mov    $0x6,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode_length>:
lea    0x4(,%rdi,8),%ecx
mov    $0xaaaaaaab,%eax
imul   %rcx,%rax
shr    $0x22,%rax
ret

LLVM IR (-O0):
define i32 @base64_encode_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 8
%5 = add i32 %4, 4
%6 = udiv i32 %5, 6
ret i32 %6
}

LLVM IR (-O2):
define i32 @base64_encode_length(i32 %0) {
%2 = shl i32 %0, 3
%3 = or i32 %2, 4
%4 = udiv i32 %3, 6
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int create_quaddobl_Laurent_cascade_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(791, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<create_quaddobl_Laurent_cascade_homotopy>:
mov    $0x317,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @create_quaddobl_Laurent_cascade_homotopy() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 791, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int main(int argc, char **argv) {
  argc -= 1;
  if (argc == 0)
    return 0;
  else {
    switch (argc) {
    case 1:
      return 1;
    default:
      return 2;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <main+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1155 <main+0x55>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    114e <main+0x4e>
jmp    1142 <main+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1155 <main+0x55>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    -0x1(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    $0x2,%edx
sub    %ecx,%edx
xor    %eax,%eax
add    $0xffffffff,%edi
cmovne %edx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %15
11: ; preds = %2
%12 = load i32, i32* %4
switch i32 %12, label %14 [
i32 1, label %13
]
13: ; preds = %11
store i32 1, i32* %3
br label %15
14: ; preds = %11
store i32 2, i32* %3
br label %15
15: ; preds = %14, %13, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i32 1, i32 2
%6 = icmp eq i32 %3, 0
%7 = select i1 %6, i32 0, i32 %5
ret i32 %7
}
void UARTModemControlClear(unsigned long ulBase, unsigned long ulControl) {
  unsigned long ulTemp;
  ;
  ;
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000030)));
  ulTemp &= ~(ulControl & (0x00000800));
  (*((volatile unsigned long *)(ulBase + 0x00000030))) = ulTemp;
}


x86 assembly (clang, -O0):
<UARTModemControlClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x800,%rax
xor    $0xffffffffffffffff,%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlClear>:
not    %esi
or     $0xfffffffffffff7ff,%rsi
and    %rsi,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @UARTModemControlClear(i64 %0, i64 %1) {
%3 = add i64 %0, 48
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %1, 2048
%7 = xor i64 %6, -1
%8 = and i64 %5, %7
store volatile i64 %8, i64* %4
ret void
}
/* Variables and functions */
char *__wstr_printf(char *, long);
int /*<<< orphan*/ assert(void const *);
char *wtypeInt_toString(const void *element) {
  assert(element);
  return __wstr_printf("%ld", (long)element);
}


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

x86 assembly (clang, -O2):
<wtypeInt_toString>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <__wstr_printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i8* @wtypeInt_toString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i64
%7 = call i8* @__wstr_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i8* @wtypeInt_toString(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = ptrtoint i8* %0 to i64
%4 = tail call i8* @__wstr_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i8* %4
}
int sys$update(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(27), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$update>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x1b,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$update>:
mov    $0x1b,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$update"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 27, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$update"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 27, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
unsigned short unsignedshort_ignoring_longlong(unsigned short x, long long y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_longlong(i16 returned zeroext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ acc_copyin(int *, int);
int main(int argc, char *argv[]) {
  int i;
#pragma acc enter data create(i)
  acc_copyin(&i, sizeof i);
  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)
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1030 <acc_copyin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @acc_copyin(i32* %3, i32 4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(const time_t *t) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define noalias %struct.tm* @gmtime(i32* nocapture readnone %0) {
ret %struct.tm* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void test_exit() { exit(1); }


x86 assembly (clang, -O0):
<test_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<test_exit>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @test_exit() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @test_exit() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int do_444() { return 444; }


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

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

LLVM IR (-O0):
define i32 @do_444() {
ret i32 444
}

LLVM IR (-O2):
define i32 @do_444() {
ret i32 444
}
/* Variables and functions */
int /*<<< orphan*/ mudstrlcpy(char *, char const *, int);
const char *smash_tilde(const char *str) {
  static char buf[4096];
  mudstrlcpy(buf, str, 4096);
  smash_tilde(buf);
  return buf;
}


x86 assembly (clang, -O0):
<smash_tilde>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f09(%rip),%rdi
mov    $0x1000,%edx
call   1040 <mudstrlcpy@plt>
lea    0x2ef8(%rip),%rdi
call   1030 <smash_tilde@plt>
lea    0x2eec(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smash_tilde>:
push   %rbx
mov    %rdi,%rsi
lea    0x2f25(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x1000,%edx
call   1030 <mudstrlcpy@plt>
mov    %rbx,%rsi
jmp    1120 <smash_tilde+0x10>

LLVM IR (-O0):
@smash_tilde.buf = internal global [4096 x i8] zeroinitializer
define i8* @smash_tilde(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mudstrlcpy(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @smash_tilde.buf, i64 0, i64 0), i8* %3, i32 4096)
%5 = call i8* @smash_tilde(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @smash_tilde.buf, i64 0, i64 0))
ret i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @smash_tilde.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@smash_tilde.buf = internal global [4096 x i8] zeroinitializer
define i8* @smash_tilde(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ getelementptr inbounds ([4096 x i8], [4096 x i8]* @smash_tilde.buf, i64 0, i64 0), %2 ]
%4 = tail call i32 @mudstrlcpy(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @smash_tilde.buf, i64 0, i64 0), i8* %3, i32 4096)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int /*<<< orphan*/ __VERIFIER_assume(int);
int __VERIFIER_nondet_int();
void main() {
  int x;
  int i;
  x = __VERIFIER_nondet_int();
  __VERIFIER_assume(x >= 0);
  i = 0;
  while (i < x) {
    i++;
  }
  __VERIFIER_assert(i == x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1174 <main+0x44>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <main+0x2a>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
not    %ebx
shr    $0x1f,%ebx
mov    %ebx,%edi
call   1050 <__VERIFIER_assume@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <__VERIFIER_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp sge i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @__VERIFIER_assume(i32 %6)
store i32 0, i32* %2
br label %8
8: ; preds = %12, %0
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %8
15: ; preds = %8
%16 = load i32, i32* %2
%17 = load i32, i32* %1
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @__VERIFIER_assert(i32 %19)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = xor i32 %1, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @__VERIFIER_assume(i32 %3)
%5 = xor i32 %1, -1
%6 = lshr i32 %5, 31
%7 = tail call i32 @__VERIFIER_assert(i32 %6)
ret void
}
long long fi5(long long j, signed int *b, int i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fi5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi5>:
movslq %edx,%rax
movslq (%rsi,%rax,4),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @fi5(i64 %0, i32* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32
store i64 %0, i64* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = add nsw i64 %7, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @fi5(i64 %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, %0
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int our_strlen(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char test[200];
  printf("bir cumle giriniz.\n");
  gets(test);
  printf("test uzunlugu: %d\n", our_strlen(test));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
call   1040 <gets@plt>
lea    -0xd0(%rbp),%rdi
call   1050 <our_strlen@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1060 <our_strlen@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"bir cumle giriniz.\0A\00"
@.str.1 = [19 x i8] c"test uzunlugu: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%7 = call i32 @our_strlen(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"test uzunlugu: %d\0A\00"
@str = [19 x i8] c"bir cumle giriniz.\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @our_strlen(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}