xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ERANGE;
int /*<<< orphan*/ errno;
char *getcwd(char *buf, size_t size) {
  if (size == 0) {
    errno = EINVAL;
    return NULL;
  }
  if (size < 1 + 1) {
    errno = ERANGE;
    return NULL;
  }
  buf[0] = '/';
  buf[1] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<getcwd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1136 <getcwd+0x36>
mov    0x2eb2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb1(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1177 <getcwd+0x77>
cmpq   $0x2,-0x18(%rbp)
jae    1160 <getcwd+0x60>
mov    0x2ea0(%rip),%rax
mov    (%rax),%ecx
mov    0x2e87(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1177 <getcwd+0x77>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd>:
cmp    $0x1,%rsi
je     1114 <getcwd+0x14>
test   %rsi,%rsi
jne    1129 <getcwd+0x29>
mov    0x2ebe(%rip),%rax
jmp    111b <getcwd+0x1b>
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
mov    0x2eb4(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret
mov    %rdi,%rax
movw   $0x2f,(%rdi)
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
@ERANGE = global i32 0
define i8* @getcwd(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @EINVAL
store i32 %9, i32* @errno
store i8* null, i8** %3
br label %21
10: ; preds = %2
%11 = load i64, i64* %5
%12 = icmp ult i64 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* @ERANGE
store i32 %14, i32* @errno
store i8* null, i8** %3
br label %21
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 47, i8* %17
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 0, i8* %19
%20 = load i8*, i8** %4
store i8* %20, i8** %3
br label %21
21: ; preds = %15, %13, %8
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
@ERANGE = global i32 0
define i8* @getcwd(i8* writeonly %0, i64 %1) {
switch i64 %1, label %7 [
i64 0, label %3
i64 1, label %5
]
3: ; preds = %2
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
br label %9
5: ; preds = %2
%6 = load i32, i32* @ERANGE
store i32 %6, i32* @errno
br label %9
7: ; preds = %2
store i8 47, i8* %0
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %8
br label %9
9: ; preds = %7, %5, %3
%10 = phi i8* [ null, %3 ], [ null, %5 ], [ %0, %7 ]
ret i8* %10
}
int test4(int a) { return a - 5 == a; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x5,%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 5
%5 = load i32, i32* %2
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test4(i32 %0) {
ret i32 0
}
void gtk_icon_info_get_filename() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_info_get_filename() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ slob_free(void *);
void free(void *addr) { slob_free(addr); }


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

x86 assembly (clang, -O2):
<free>:
jmp    1030 <slob_free@plt>

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @slob_free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int getw16(FILE *iob) {
  int temp;
  temp = getc(iob);
  temp |= getc(iob) << 8;
  if (temp & 0x8000)
    temp |= (~0) << 15;
  return temp;
}


x86 assembly (clang, -O0):
<getw16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1156 <getw16+0x46>
mov    -0xc(%rbp),%eax
or     $0xffff8000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getw16>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     %ebp,%eax
mov    %eax,%ecx
or     $0xffff8000,%ecx
test   $0x8000,%eax
cmovne %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getw16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = call i32 @getc(i32* %6)
%8 = shl i32 %7, 8
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = and i32 %11, 32768
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load i32, i32* %3
%16 = or i32 %15, -32768
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %1
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @getw16(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = and i32 %5, 32768
%7 = icmp eq i32 %6, 0
%8 = or i32 %5, -32768
%9 = select i1 %7, i32 %5, i32 %8
ret i32 %9
}
struct lmf_str *re_openlib(struct lmf_str *om_fptr, int outtty) {
  return om_fptr;
}


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

x86 assembly (clang, -O2):
<re_openlib>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.lmf_str = type opaque
define %struct.lmf_str* @re_openlib(%struct.lmf_str* %0, i32 %1) {
%3 = alloca %struct.lmf_str*
%4 = alloca i32
store %struct.lmf_str* %0, %struct.lmf_str** %3
store i32 %1, i32* %4
%5 = load %struct.lmf_str*, %struct.lmf_str** %3
ret %struct.lmf_str* %5
}

LLVM IR (-O2):
%struct.lmf_str = type opaque
define %struct.lmf_str* @re_openlib(%struct.lmf_str* readnone returned %0, i32 %1) {
ret %struct.lmf_str* %0
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stderr;
scalar_t__ system(char *);
void get_strings(char const *in) {
  char *cmd;
  asprintf(&cmd, "strings %s", in);
  if (system(cmd))
    fprintf(stderr, "something went wrong running %s.\n", cmd);
  free(cmd);
}


x86 assembly (clang, -O0):
<get_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1060 <asprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <system@plt>
cmp    $0x0,%rax
je     118c <get_strings+0x4c>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe84(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_strings>:
push   %rax
mov    %rdi,%rdx
lea    0xeb5(%rip),%rsi
mov    %rsp,%rdi
call   1060 <asprintf@plt>
mov    (%rsp),%rdi
call   1040 <system@plt>
test   %rax,%rax
je     117a <get_strings+0x3a>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rdx
lea    0xe96(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"strings %s\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"something went wrong running %s.\0A\00"
define void @get_strings(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %3
%7 = call i64 @system(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %3
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %9, %1
%14 = load i8*, i8** %3
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"strings %s\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"something went wrong running %s.\0A\00"
define void @get_strings(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i8*, i8** %2
%6 = call i64 @system(i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %2
%14 = call i32 @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StopTask(int);
void allTasksStop() {
  StopTask(1);
  StopTask(2);
  StopTask(3);
  StopTask(4);
}


x86 assembly (clang, -O0):
<allTasksStop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <StopTask@plt>
mov    $0x2,%edi
call   1030 <StopTask@plt>
mov    $0x3,%edi
call   1030 <StopTask@plt>
mov    $0x4,%edi
call   1030 <StopTask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<allTasksStop>:
push   %rax
mov    $0x1,%edi
call   1030 <StopTask@plt>
mov    $0x2,%edi
call   1030 <StopTask@plt>
mov    $0x3,%edi
call   1030 <StopTask@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <StopTask@plt>

LLVM IR (-O0):
define void @allTasksStop() {
%1 = call i32 @StopTask(i32 1)
%2 = call i32 @StopTask(i32 2)
%3 = call i32 @StopTask(i32 3)
%4 = call i32 @StopTask(i32 4)
ret void
}

LLVM IR (-O2):
define void @allTasksStop() {
%1 = tail call i32 @StopTask(i32 1)
%2 = tail call i32 @StopTask(i32 2)
%3 = tail call i32 @StopTask(i32 3)
%4 = tail call i32 @StopTask(i32 4)
ret void
}
/* Variables and functions */
int my_strcmp(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char *a = "This is a test";
  char *b = "This is a test";
  int l;
  l = my_strcmp(a, b);
  printf("Return val: %i\n", l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xebf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <my_strcmp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"This is a test\00"
@.str.1 = [16 x i8] c"Return val: %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %3
%7 = call i32 @my_strcmp(i8* %5, i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"This is a test\00"
@.str.1 = [16 x i8] c"Return val: %i\0A\00"
define i32 @main() {
%1 = tail call i32 @my_strcmp(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
void *mymalloc(unsigned int size) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @mymalloc(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
scalar_t__ setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
void makeMeLeader() {
  if (0 > setpgid(0, 0)) {
    perror("Cannot set current process as leader");
  } else {
    printf("This process is now leader of the group\n");
  }
}


x86 assembly (clang, -O0):
<makeMeLeader>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1050 <setpgid@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    115c <makeMeLeader+0x2c>
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
jmp    1168 <makeMeLeader+0x38>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeMeLeader>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1050 <setpgid@plt>
test   %rax,%rax
js     114c <makeMeLeader+0x1c>
lea    0xedf(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Cannot set current process as leader\00"
@.str.1 = [41 x i8] c"This process is now leader of the group\0A\00"
define void @makeMeLeader() {
%1 = call i64 @setpgid(i32 0, i32 0)
%2 = icmp sgt i64 0, %1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Cannot set current process as leader\00"
@str = [40 x i8] c"This process is now leader of the group\00"
define void @makeMeLeader() {
%1 = tail call i64 @setpgid(i32 0, i32 0)
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 1, b = 2, c = 3;
  printf("%d %d %d", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}
int checkSize(int x) {
  if (x == 2 || x == 4 || x == 8 || x == 16 || x == 32 || x == 64 || x == 128 ||
      x == 256 || x == 512)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<checkSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116a <checkSize+0x6a>
cmpl   $0x4,-0x8(%rbp)
je     116a <checkSize+0x6a>
cmpl   $0x8,-0x8(%rbp)
je     116a <checkSize+0x6a>
cmpl   $0x10,-0x8(%rbp)
je     116a <checkSize+0x6a>
cmpl   $0x20,-0x8(%rbp)
je     116a <checkSize+0x6a>
cmpl   $0x40,-0x8(%rbp)
je     116a <checkSize+0x6a>
cmpl   $0x80,-0x8(%rbp)
je     116a <checkSize+0x6a>
cmpl   $0x100,-0x8(%rbp)
je     116a <checkSize+0x6a>
cmpl   $0x200,-0x8(%rbp)
jne    1176 <checkSize+0x76>
movl   $0x1,-0x4(%rbp)
jmp    117d <checkSize+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkSize>:
mov    $0x1,%eax
cmp    $0x7f,%edi
jg     1123 <checkSize+0x23>
add    $0xfffffffe,%edi
cmp    $0x3e,%edi
ja     113b <checkSize+0x3b>
movabs $0x4000000040004045,%rcx
bt     %rdi,%rcx
jae    113b <checkSize+0x3b>
ret
cmp    $0x80,%edi
je     1122 <checkSize+0x22>
cmp    $0x100,%edi
je     1122 <checkSize+0x22>
cmp    $0x200,%edi
je     1122 <checkSize+0x22>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @checkSize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 2
br i1 %5, label %30, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 4
br i1 %8, label %30, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 8
br i1 %11, label %30, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 16
br i1 %14, label %30, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 32
br i1 %17, label %30, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 64
br i1 %20, label %30, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 128
br i1 %23, label %30, label %24
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 256
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 512
br i1 %29, label %30, label %31
30: ; preds = %27, %24, %21, %18, %15, %12, %9, %6, %1
store i32 1, i32* %2
br label %32
31: ; preds = %27
store i32 0, i32* %2
br label %32
32: ; preds = %31, %30
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @checkSize(i32 %0) {
switch i32 %0, label %2 [
i32 512, label %3
i32 256, label %3
i32 128, label %3
i32 64, label %3
i32 32, label %3
i32 16, label %3
i32 8, label %3
i32 4, label %3
i32 2, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ millis;

/* Variables and functions */
int /*<<< orphan*/ grid_assert_errno(int, char *);
int grid_setsockopt(int, int /*<<< orphan*/, int, int *, int);
void grid_set_recv_timeout(int sock, int millis) {
  int rc;
  rc = grid_setsockopt(sock, 0, 5, &millis, sizeof(millis));
  grid_assert_errno(rc == 0, "Can't set recv timeout");
}


x86 assembly (clang, -O0):
<grid_set_recv_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x5,%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1040 <grid_setsockopt@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xea3(%rip),%rsi
call   1030 <grid_assert_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_set_recv_timeout>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rcx
xor    %esi,%esi
mov    $0x5,%edx
mov    $0x4,%r8d
call   1040 <grid_setsockopt@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xeb5(%rip),%rsi
call   1030 <grid_assert_errno@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Can't set recv timeout\00"
define void @grid_set_recv_timeout(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @grid_setsockopt(i32 %6, i32 0, i32 5, i32* %4, i32 4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @grid_assert_errno(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Can't set recv timeout\00"
define void @grid_set_recv_timeout(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @grid_setsockopt(i32 %0, i32 0, i32 5, i32* %3, i32 4)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @grid_assert_errno(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
signed int vsprintf(char *pString, const char *pFormat, va_list ap) {
  return vsnprintf(pString, 512, pFormat, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x200,%esi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x200,%esi
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i32 512, i8* %1, i32 %2)
ret i32 %4
}
double OP_Neq(double op1, double op2) { return op1 != op2; }


x86 assembly (clang, -O0):
<OP_Neq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP_Neq>:
cmpneqsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @OP_Neq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp une double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @OP_Neq(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
int M_PI;
double deg(double number) { return ((180 / M_PI) * number); }


x86 assembly (clang, -O0):
<deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    $0xb4,%eax
mov    0x2ed3(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2sd %eax,%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg>:
mov    0x2ee1(%rip),%rcx
mov    $0xb4,%eax
xor    %edx,%edx
idivl  (%rcx)
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @M_PI
%4 = sdiv i32 180, %3
%5 = sitofp i32 %4 to double
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @deg(double %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 180, %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 3, b = 5, c = 0, d = 0, resultado = 0;
  d = ++a;
  c = --b;
  d = d + 2;
  c = c - 2;
  d = d + 3;
  c = c - 1;
  d = d - 1;
  resultado = (d * 4) / (c * 2);
  printf("%d\n", resultado);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe5d(%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
mov    $0x10,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 5, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
store i32 %10, i32* %3
store i32 %10, i32* %4
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 2
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 2
store i32 %14, i32* %4
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 3
store i32 %16, i32* %5
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %4
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = mul nsw i32 %21, 4
%23 = load i32, i32* %4
%24 = mul nsw i32 %23, 2
%25 = sdiv i32 %22, %24
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 16)
ret i32 0
}
/* Variables and functions */
char toupper(char);
void upCase(char str[24]) {
  for (int i = 0; i < 24; i++) {
    if (str[i] == '\0') {
      break;
    } else {
      str[i] = toupper(str[i]);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<upCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x18,-0xc(%rbp)
jge    1178 <upCase+0x68>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1147 <upCase+0x37>
jmp    1178 <upCase+0x68>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    116a <upCase+0x5a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <upCase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upCase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%eax
test   %al,%al
je     113f <upCase+0x2f>
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0x18,%rbx
jne    1120 <upCase+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @upCase(i8* nocapture %0) {
br label %2
2: ; preds = %1, %7
%3 = phi i64 [ 0, %1 ], [ %9, %7 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call signext i8 @toupper(i8 signext %5)
store i8 %8, i8* %4
%9 = add nuw nsw i64 %3, 1
%10 = icmp eq i64 %9, 24
br i1 %10, label %11, label %2
11: ; preds = %2, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
int /*<<< orphan*/ VtolSelfTuningStatsHandle();
void VtolSelfTuningStatsRequestUpdate() {
  UAVObjRequestUpdate(VtolSelfTuningStatsHandle());
}


x86 assembly (clang, -O0):
<VtolSelfTuningStatsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VtolSelfTuningStatsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VtolSelfTuningStatsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <VtolSelfTuningStatsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @VtolSelfTuningStatsRequestUpdate() {
%1 = call i32 (...) @VtolSelfTuningStatsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @VtolSelfTuningStatsRequestUpdate() {
%1 = tail call i32 (...) @VtolSelfTuningStatsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t *getaddress(void) {
  static int64_t ret;
  return &ret;
}


x86 assembly (clang, -O0):
<getaddress>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f19(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getaddress>:
lea    0x2f1d(%rip),%rax
ret

LLVM IR (-O0):
@getaddress.ret = internal global i32 0
define i32* @getaddress() {
ret i32* @getaddress.ret
}

LLVM IR (-O2):
@getaddress.ret = internal global i32 0
define i32* @getaddress() {
ret i32* @getaddress.ret
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ps(const char *s) {
  int c;
  while (1) {
    c = *s;
    if (c == 0)
      break;
    printf("%c", c);
    s++;
  }
}


x86 assembly (clang, -O0):
<ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1135 <ps+0x25>
jmp    1155 <ps+0x45>
mov    -0xc(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ps+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <ps+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ps+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @ps(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int work(long loop_count) {
  while (loop_count-- > 0) {
    syslog(LOG_INFO, "loglog");
  }
  return 0;
}


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
jle    114f <work+0x3f>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1030 <syslog@plt>
jmp    111c <work+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<work>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
jle    1145 <work+0x35>
mov    %rdi,%rbx
add    $0x1,%rbx
mov    0x2eb8(%rip),%r15
lea    0xed1(%rip),%r14
nop
mov    (%r15),%edi
mov    %r14,%rsi
call   1030 <syslog@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <work+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [7 x i8] c"loglog\00"
define i32 @work(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %7, %1
%4 = load i64, i64* %2
%5 = add nsw i64 %4, -1
store i64 %5, i64* %2
%6 = icmp sgt i64 %4, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* @LOG_INFO
%9 = call i32 @syslog(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [7 x i8] c"loglog\00"
define i32 @work(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i64 %4, -1
%6 = load i32, i32* @LOG_INFO
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp ugt i64 %4, 1
br i1 %8, label %3, label %9
9: ; preds = %3, %1
ret i32 0
}
void cw1200_debug_txed(struct cw1200_common *priv) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.cw1200_common = type opaque
define void @cw1200_debug_txed(%struct.cw1200_common* nocapture %0) {
ret void
}
void darwin_arm_init_mach_exception_handler() {}


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

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

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

LLVM IR (-O2):
define void @darwin_arm_init_mach_exception_handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sys_three(void) { printf("three\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"three\00"
define void @sys_three() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int f1(int x, int y) { return (int)((unsigned)x | (unsigned)y); }


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

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

LLVM IR (-O0):
define i32 @f1(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 = or i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
rlength(cs) struct tnode *cs;
{ return ((length(cs) + 01) & ~01); }


x86 assembly (clang, -O0):
<rlength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <length@plt>
add    $0x1,%eax
and    $0xfffffffe,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rlength>:
push   %rax
xor    %eax,%eax
call   1030 <length@plt>
add    $0x1,%eax
and    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tnode = type opaque
define i32 @rlength(%struct.tnode* %0) {
%2 = alloca %struct.tnode*
store %struct.tnode* %0, %struct.tnode** %2
%3 = load %struct.tnode*, %struct.tnode** %2
%4 = call i32 (%struct.tnode*, ...) bitcast (i32 (...)* @length to i32 (%struct.tnode*, ...)*)(%struct.tnode* %3)
%5 = add nsw i32 %4, 1
%6 = and i32 %5, -2
ret i32 %6
}

LLVM IR (-O2):
%struct.tnode = type opaque
define i32 @rlength(%struct.tnode* %0) {
%2 = tail call i32 (%struct.tnode*, ...) bitcast (i32 (...)* @length to i32 (%struct.tnode*, ...)*)(%struct.tnode* %0)
%3 = add nsw i32 %2, 1
%4 = and i32 %3, -2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_array(void **array, int size) {
  int i;
  for (i = 0; i < size; i++) {
    free(array[i]);
  }
  free(array);
}


x86 assembly (clang, -O0):
<free_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_array+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_array+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_array+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_array+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_array(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = bitcast i8** %8 to i8***
%10 = load i8**, i8*** %9
%11 = tail call i32 @free(i8** %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int FNDELAY;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int fileSetBlocking(int fd, int on) {
  return fcntl(fd, F_SETFL, on ? 0 : (FNDELAY | O_NONBLOCK)) != -1;
}


x86 assembly (clang, -O0):
<fileSetBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1144 <fileSetBlocking+0x34>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <fileSetBlocking+0x49>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    0x2e94(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileSetBlocking>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    0x2eaf(%rip),%r8
mov    0x2ec0(%rip),%rdx
mov    (%rdx),%ecx
or     (%r8),%ecx
xor    %edx,%edx
test   %esi,%esi
cmove  %ecx,%edx
mov    %eax,%esi
call   1030 <fcntl@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_SETFL = global i32 0
@FNDELAY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @fileSetBlocking(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* @F_SETFL
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %14
10: ; preds = %2
%11 = load i32, i32* @FNDELAY
%12 = load i32, i32* @O_NONBLOCK
%13 = or i32 %11, %12
br label %14
14: ; preds = %10, %9
%15 = phi i32 [ 0, %9 ], [ %13, %10 ]
%16 = call i32 @fcntl(i32 %5, i32 %6, i32 %15)
%17 = icmp ne i32 %16, -1
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@FNDELAY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @fileSetBlocking(i32 %0, i32 %1) {
%3 = load i32, i32* @F_SETFL
%4 = icmp eq i32 %1, 0
%5 = load i32, i32* @FNDELAY
%6 = load i32, i32* @O_NONBLOCK
%7 = or i32 %6, %5
%8 = select i1 %4, i32 %7, i32 0
%9 = tail call i32 @fcntl(i32 %0, i32 %3, i32 %8)
%10 = icmp ne i32 %9, -1
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *argv0) {
  printf("Usage: %s [OPTIONS]\n"
         "\n"
         "Options:\n"
         " -i <iface>  Use interface <iface>\n"
         " -t <timeo>  Stop after <timeo> seconds\n"
         " -s          Generate script-friendly output\n",
         argv0);
  return;
}


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

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

LLVM IR (-O0):
@.str = [151 x i8] c"Usage: %s [OPTIONS]\0A\0AOptions:\0A -i <iface> Use interface <iface>\0A -t <timeo> Stop after <timeo> seconds\0A -s Generate script-friendly output\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [151 x i8] c"Usage: %s [OPTIONS]\0A\0AOptions:\0A -i <iface> Use interface <iface>\0A -t <timeo> Stop after <timeo> seconds\0A -s Generate script-friendly output\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int cdc_tcxo_set_req_prio(int clk_id, int req_prio) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cdc_tcxo_set_req_prio(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint32_t __int32_t_clone_array(const int32_t *p, int32_t *q,
                               uint32_t elements) {
  uint32_t n = elements * sizeof(int32_t);
  memcpy(q, p, n);
  return n;
}


x86 assembly (clang, -O0):
<__int32_t_clone_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int32_t_clone_array>:
push   %rbx
mov    %rdi,%rax
lea    0x0(,%rdx,4),%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__int32_t_clone_array(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 4
%11 = trunc i64 %10 to i32
store i32 %11, i32* %7
%12 = load i32*, i32** %5
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = call i32 @memcpy(i32* %12, i32* %13, i32 %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @__int32_t_clone_array(i32* %0, i32* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i32* %1, i32* %0, i32 %4)
ret i32 %4
}