xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int sleep(unsigned int);
int /*<<< orphan*/ unix_error(char *);
unsigned int Sleep(unsigned int secs) {
  unsigned int n;
  if ((n = sleep(secs)) < 0)
    unix_error("Sleep error");
  return n;
}


x86 assembly (clang, -O0):
<Sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sleep@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jae    114b <Sleep+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleep>:
jmp    1030 <sleep@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Sleep error\00"
define i32 @Sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sleep(i32 %4)
store i32 %5, i32* %3
%6 = icmp ult i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @Sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_66(void) {
  { a_0_55(((((15)))), "OF?"); }
}


x86 assembly (clang, -O0):
<a_0_66>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
lea    0xee0(%rip),%rsi
call   1030 <a_0_55@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_0_66>:
lea    0xee9(%rip),%rsi
mov    $0xf,%edi
jmp    1030 <a_0_55@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"OF?\00"
define void @a_0_66() {
%1 = call i32 @a_0_55(i32 15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"OF?\00"
define void @a_0_66() {
%1 = tail call i32 @a_0_55(i32 15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
int decVal(int num) {
  if (num >= 10) {
    switch (num) {
    case 10:
      return 'a';
      break;
    case 11:
      return 'b';
      break;
    case 12:
      return 'c';
      break;
    case 13:
      return 'd';
      break;
    case 14:
      return 'e';
      break;
    case 15:
      return 'f';
      break;
    }
  } else {
    return num + '0';
  }
  return 1;
}


x86 assembly (clang, -O0):
<decVal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1187 <decVal+0x87>
mov    -0x8(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1182 <decVal+0x82>
mov    -0x10(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x61,-0x4(%rbp)
jmp    119c <decVal+0x9c>
movl   $0x62,-0x4(%rbp)
jmp    119c <decVal+0x9c>
movl   $0x63,-0x4(%rbp)
jmp    119c <decVal+0x9c>
movl   $0x64,-0x4(%rbp)
jmp    119c <decVal+0x9c>
movl   $0x65,-0x4(%rbp)
jmp    119c <decVal+0x9c>
movl   $0x66,-0x4(%rbp)
jmp    119c <decVal+0x9c>
jmp    1195 <decVal+0x95>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    119c <decVal+0x9c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decVal>:
cmp    $0xa,%edi
jl     1117 <decVal+0x17>
lea    -0xa(%rdi),%eax
add    $0x57,%edi
cmp    $0x6,%eax
mov    $0x1,%eax
cmovb  %edi,%eax
ret
add    $0x30,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @decVal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %3
switch i32 %7, label %14 [
i32 10, label %8
i32 11, label %9
i32 12, label %10
i32 13, label %11
i32 14, label %12
i32 15, label %13
]
8: ; preds = %6
store i32 97, i32* %2
br label %19
9: ; preds = %6
store i32 98, i32* %2
br label %19
10: ; preds = %6
store i32 99, i32* %2
br label %19
11: ; preds = %6
store i32 100, i32* %2
br label %19
12: ; preds = %6
store i32 101, i32* %2
br label %19
13: ; preds = %6
store i32 102, i32* %2
br label %19
14: ; preds = %6
br label %18
15: ; preds = %1
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 48
store i32 %17, i32* %2
br label %19
18: ; preds = %14
store i32 1, i32* %2
br label %19
19: ; preds = %18, %15, %13, %12, %11, %10, %9, %8
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @decVal(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = add i32 %0, -10
%5 = icmp ult i32 %4, 6
%6 = add i32 %0, 87
%7 = select i1 %5, i32 %6, i32 1
br label %10
8: ; preds = %1
%9 = add nsw i32 %0, 48
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ %9, %8 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ _write(char *, int);
void putchar(char c) {
  char buf[] = {c, '\0'};
  _write(buf, sizeof buf);
  return;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1030 <_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putchar(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %2
store i8 %5, i8* %4
%6 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i32 @_write(i8* %7, i32 2)
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
%5 = call i32 @_write(i8* %3, i32 2)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ printf(char *);
void *safe_malloc(size_t size) {
  void *mem = NULL;
  if (size == 0)
    printf("Allocating 0 bytes!");
  if ((mem = malloc(size)) != NULL)
    return mem;
  else {
    printf("Memory allocation error");
    return NULL;
  }
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <safe_malloc+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116f <safe_malloc+0x4f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1183 <safe_malloc+0x63>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1135 <safe_malloc+0x15>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1151 <safe_malloc+0x31>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Allocating 0 bytes!\00"
@.str.1 = [24 x i8] c"Memory allocation error\00"
define i8* @safe_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* null, i8** %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i64, i64* %3
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i8*, i8** %4
store i8* %14, i8** %2
br label %17
15: ; preds = %9
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
store i8* null, i8** %2
br label %17
17: ; preds = %15, %13
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [20 x i8] c"Allocating 0 bytes!\00"
@.str.1 = [24 x i8] c"Memory allocation error\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i8* @malloc(i64 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %5, %8
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ write_frame_buf8(int, unsigned char);
void write_frame_buf32(signed int t, unsigned int data) {
  write_frame_buf8(t, (unsigned char)(data >> 24));
  write_frame_buf8(t, (unsigned char)(data >> 16));
  write_frame_buf8(t, (unsigned char)(data >> 8));
  write_frame_buf8(t, (unsigned char)data);
}


x86 assembly (clang, -O0):
<write_frame_buf32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
movzbl %al,%esi
call   1030 <write_frame_buf8@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
movzbl %al,%esi
call   1030 <write_frame_buf8@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
movzbl %al,%esi
call   1030 <write_frame_buf8@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
movzbl %al,%esi
call   1030 <write_frame_buf8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_frame_buf32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%eax
shr    $0x18,%eax
mov    %eax,%esi
call   1030 <write_frame_buf8@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%esi
mov    %ebp,%edi
call   1030 <write_frame_buf8@plt>
movzbl %bh,%esi
mov    %ebp,%edi
call   1030 <write_frame_buf8@plt>
movzbl %bl,%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write_frame_buf8@plt>

LLVM IR (-O0):
define void @write_frame_buf32(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 = lshr i32 %6, 24
%8 = trunc i32 %7 to i8
%9 = call i32 @write_frame_buf8(i32 %5, i8 zeroext %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = lshr i32 %11, 16
%13 = trunc i32 %12 to i8
%14 = call i32 @write_frame_buf8(i32 %10, i8 zeroext %13)
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = lshr i32 %16, 8
%18 = trunc i32 %17 to i8
%19 = call i32 @write_frame_buf8(i32 %15, i8 zeroext %18)
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = trunc i32 %21 to i8
%23 = call i32 @write_frame_buf8(i32 %20, i8 zeroext %22)
ret void
}

LLVM IR (-O2):
define void @write_frame_buf32(i32 %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
%5 = tail call i32 @write_frame_buf8(i32 %0, i8 zeroext %4)
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = tail call i32 @write_frame_buf8(i32 %0, i8 zeroext %7)
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = tail call i32 @write_frame_buf8(i32 %0, i8 zeroext %10)
%12 = trunc i32 %1 to i8
%13 = tail call i32 @write_frame_buf8(i32 %0, i8 zeroext %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void noprocess(void) { error("You can't do that without a process to debug."); }


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"You can't do that without a process to debug.\00"
define void @noprocess() {
%1 = call i32 @error(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"You can't do that without a process to debug.\00"
define void @noprocess() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x = rand();
  return x;
}


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)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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 (...) @rand()
store i32 %7, i32* %6
%8 = load i32, i32* %6
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __merge_sort(int *, int /*<<< orphan*/, int);
void merge_sort(int *arr, int size) { __merge_sort(arr, 0, size - 1); }


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

x86 assembly (clang, -O2):
<merge_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <__merge_sort@plt>

LLVM IR (-O0):
define void @merge_sort(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 = sub nsw i32 %6, 1
%8 = call i32 @__merge_sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @__merge_sort(i32* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int AgcToNative(uint16_t n) {
  int i;
  i = n;
  if (0 != (n & 040000))
    i = -(077777 & ~i);
  return (i);
}


x86 assembly (clang, -O0):
<AgcToNative>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x4000,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1133 <AgcToNative+0x33>
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    $0x7fff,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AgcToNative>:
mov    %edi,%eax
or     $0xffff8000,%eax
add    $0x1,%eax
test   $0x4000,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @AgcToNative(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = and i32 %5, 16384
%7 = icmp ne i32 0, %6
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = xor i32 %9, -1
%11 = and i32 32767, %10
%12 = sub nsw i32 0, %11
store i32 %12, i32* %3
br label %13
13: ; preds = %8, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @AgcToNative(i32 %0) {
%2 = and i32 %0, 16384
%3 = icmp eq i32 %2, 0
%4 = or i32 %0, -32768
%5 = add nsw i32 %4, 1
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
/* Variables and functions */
int strlen(char const *);
char *strcpy(char *dest, const char *src) {
  for (size_t i = 0; i < strlen(src) + 1; i++) {
    dest[i] = src[i];
  }
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jae    1175 <strcpy+0x65>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <strcpy+0x18>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
cmp    $0xffffffff,%eax
je     114f <strcpy+0x3f>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%eax
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
cmp    %rax,%rbx
jb     1130 <strcpy+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %6
5: ; preds = %6, %2
ret i8* %0
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%11 = add nuw i64 %7, 1
%12 = tail call i32 @strlen(i8* %1)
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = icmp ult i64 %11, %14
br i1 %15, label %6, label %5
}
/* Variables and functions */
int /*<<< orphan*/ create_letter_distribution_diagram();
int main(void) { create_letter_distribution_diagram(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @create_letter_distribution_diagram()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @create_letter_distribution_diagram()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ unsetenv(char const *);
void globus_libc_unsetenv(const char *name) { unsetenv(name); }


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

x86 assembly (clang, -O2):
<globus_libc_unsetenv>:
jmp    1030 <unsetenv@plt>

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

LLVM IR (-O2):
define void @globus_libc_unsetenv(i8* nocapture %0) {
%2 = tail call i32 @unsetenv(i8* %0)
ret void
}
/* Variables and functions */
int call(int, int);
int call3(int fun, int arg1, int arg2, int arg3) {
  return call(call(call(fun, arg3), arg2), arg1);
}


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

x86 assembly (clang, -O2):
<call3>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %ecx,%esi
call   1030 <call@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <call@plt>
mov    %eax,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <call@plt>

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

LLVM IR (-O2):
define i32 @call3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @call(i32 %0, i32 %3)
%6 = tail call i32 @call(i32 %5, i32 %2)
%7 = tail call i32 @call(i32 %6, i32 %1)
ret i32 %7
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t signum_fun_int32_t(int32_t a) { return (a != 0) | (a >> 31); }


x86 assembly (clang, -O0):
<signum_fun_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_int32_t>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
sar    $0x1f,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @signum_fun_int32_t(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 31
%5 = or i32 %4, %3
ret i32 %5
}
void foo(void) {
  int a, b[100];
  int n;
#pragma acc enter data copyin(a, b) async wait
#pragma acc enter data create(b [20:30]) async wait
#pragma acc enter data(a)
#pragma acc enter data create(b(1 : 10))
#pragma acc exit data delete (a) if (0)
#pragma acc exit data copyout(b) if (a)
#pragma acc exit data delete (b)
#pragma acc enter
#pragma acc exit
#pragma acc enter data
#pragma acc exit data
#pragma acc enter Data
#pragma acc exit copyout(b)
}


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

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rb_raise(int /*<<< orphan*/, char *);
int /*<<< orphan*/ subtend_get_exception(int);
void no_window() {
  rb_raise(subtend_get_exception(6), "already closed window");
}


x86 assembly (clang, -O0):
<no_window>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <subtend_get_exception@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
call   1040 <rb_raise@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_window>:
push   %rax
mov    $0x6,%edi
call   1030 <subtend_get_exception@plt>
lea    0xece(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <rb_raise@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"already closed window\00"
define void @no_window() {
%1 = call i32 @subtend_get_exception(i32 6)
%2 = call i32 @rb_raise(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"already closed window\00"
define void @no_window() {
%1 = tail call i32 @subtend_get_exception(i32 6)
%2 = tail call i32 @rb_raise(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(int, int);
unsigned char CheckId_S5K83A(void) {
  unsigned char temp1;
  unsigned char temp2;
  VIM_SIF_I2cWriteByte(0xec, 00);
  VIM_SIF_I2cReadByte(0xb2, &temp1);
  VIM_SIF_I2cReadByte(0xb3, &temp2);
  if ((temp1 == 0xc4) && (temp2 == 0x01))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CheckId_S5K83A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xec,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0xb2,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    $0xb3,%edi
lea    -0x3(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0xc4,%eax
jne    1175 <CheckId_S5K83A+0x55>
movzbl -0x3(%rbp),%eax
cmp    $0x1,%eax
jne    1175 <CheckId_S5K83A+0x55>
movb   $0x1,-0x1(%rbp)
jmp    1179 <CheckId_S5K83A+0x59>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckId_S5K83A>:
push   %rax
mov    $0xec,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
lea    0x7(%rsp),%rsi
mov    $0xb2,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
lea    0x6(%rsp),%rsi
mov    $0xb3,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0x7(%rsp),%al
xor    $0xc4,%al
mov    0x6(%rsp),%cl
xor    $0x1,%cl
or     %al,%cl
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @CheckId_S5K83A() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @VIM_SIF_I2cWriteByte(i32 236, i32 0)
%5 = call i32 @VIM_SIF_I2cReadByte(i32 178, i8* %2)
%6 = call i32 @VIM_SIF_I2cReadByte(i32 179, i8* %3)
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 196
br i1 %9, label %10, label %15
10: ; preds = %0
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %10
store i8 1, i8* %1
br label %16
15: ; preds = %10, %0
store i8 0, i8* %1
br label %16
16: ; preds = %15, %14
%17 = load i8, i8* %1
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @CheckId_S5K83A() {
%1 = alloca i8
%2 = alloca i8
%3 = tail call i32 @VIM_SIF_I2cWriteByte(i32 236, i32 0)
%4 = call i32 @VIM_SIF_I2cReadByte(i32 178, i8* %1)
%5 = call i32 @VIM_SIF_I2cReadByte(i32 179, i8* %2)
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, -60
%8 = load i8, i8* %2
%9 = icmp eq i8 %8, 1
%10 = select i1 %7, i1 %9, i1 false
%11 = zext i1 %10 to i8
ret i8 %11
}
/* Variables and functions */
double M_PI;
int /*<<< orphan*/ printf(char *, double, int);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double r;
  scanf("%lf", &r);
  printf("%lf %lf\n", M_PI * r * r, 2 * M_PI * r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
mov    0x2e85(%rip),%rax
mulsd  (%rax),%xmm1
mulsd  -0x10(%rbp),%xmm1
cvttsd2si %xmm1,%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2eb1(%rip),%rax
movsd  (%rax),%xmm1
movsd  (%rsp),%xmm2
movapd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm1
cvttsd2si %xmm1,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"%lf %lf\0A\00"
@M_PI = global double 0.000000e+00
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* @M_PI
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = load double, double* @M_PI
%10 = fmul double 2.000000e+00, %9
%11 = load double, double* %2
%12 = fmul double %10, %11
%13 = fptosi double %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %8, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"%lf %lf\0A\00"
@M_PI = global double 0.000000e+00
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* @M_PI
%5 = load double, double* %1
%6 = fmul double %4, %5
%7 = fmul double %5, %6
%8 = fmul double %4, 2.000000e+00
%9 = fmul double %8, %5
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %7, i32 %10)
ret i32 0
}
int linearSearch(int arr[], int arrSize, int search) {
  int c;
  for (c = 0; c < arrSize; c++) {
    if (arr[c] == search) {
      return c;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<linearSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <linearSearch+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <linearSearch+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <linearSearch+0x5a>
jmp    1145 <linearSearch+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <linearSearch+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearSearch>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <linearSearch+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <linearSearch+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <linearSearch+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @linearSearch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Hello from cbar"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello from cbar\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello from cbar\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char s1[] = "catrugb";
  char s2[] = "h";
  printf("%d\n\n", any(s1, s2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0xe(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x62677572746163,%rax
mov    %rax,0x10(%rsp)
movw   $0x68,0xe(%rsp)
lea    0x10(%rsp),%rdi
lea    0xe(%rsp),%rsi
call   1040 <any@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d\0A\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i16
%3 = bitcast i64* %1 to i8*
store i64 27698301846708579, i64* %1
%4 = bitcast i16* %2 to i8*
store i16 104, i16* %2
%5 = call i32 @any(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int rbtree_string_cmp(const void *a, const void *b) {
  return strcmp((const char *)a, (const char *)b);
}


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

x86 assembly (clang, -O2):
<rbtree_string_cmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @rbtree_string_cmp(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @rbtree_string_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ system(char *);
void sighup() {
  system("open -s -l -- login -h spawn");
  signal(SIGHUP, sighup);
}


x86 assembly (clang, -O0):
<sighup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rsi
call   1040 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
mov    0x2ea3(%rip),%rsi
pop    %rax
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"open -s -l -- login -h spawn\00"
@SIGHUP = global i32 0
define void @sighup() {
%1 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @SIGHUP
%3 = call i32 @signal(i32 %2, void (...)* bitcast (void ()* @sighup to void (...)*))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"open -s -l -- login -h spawn\00"
@SIGHUP = global i32 0
define void @sighup() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @SIGHUP
%3 = tail call i32 @signal(i32 %2, void (...)* bitcast (void ()* @sighup to void (...)*))
ret void
}
char *mystrcpy(char *strdst, char *strsrc) {
  char *dp = &strdst[0], *sp = &strsrc[0];
  while (*sp != '\0')
    *dp++ = *sp++;
  *dp = '\0';
  return strdst;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <mystrcpy+0x53>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    111c <mystrcpy+0x1c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <mystrcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <mystrcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @mystrcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int strcmp(char *, char *);
int strstrcmp(const void *this, const void *that) {
  char **thisstr = (char **)this;
  char **thatstr = (char **)that;
  return strcmp(*thisstr, *thatstr);
}


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

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

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

LLVM IR (-O2):
define i32 @strstrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
float __rmod(float, float);
float cosf(float);
float __rcosd(float x) {
  float circle = 360.0F;
  return cosf(.017453292519943295F * __rmod(x, circle));
}


x86 assembly (clang, -O0):
<__rcosd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecf(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <__rmod@plt>
movaps %xmm0,%xmm1
movss  0xeac(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <cosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rcosd>:
push   %rax
movss  0xed7(%rip),%xmm1
call   1040 <__rmod@plt>
mulss  0xece(%rip),%xmm0
pop    %rax
jmp    1030 <cosf@plt>

LLVM IR (-O0):
define float @__rcosd(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 3.600000e+02, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = call float @__rmod(float %4, float %5)
%7 = fmul float 0x3F91DF46A0000000, %6
%8 = call float @cosf(float %7)
ret float %8
}

LLVM IR (-O2):
define float @__rcosd(float %0) {
%2 = tail call float @__rmod(float %0, float 3.600000e+02)
%3 = fmul float %2, 0x3F91DF46A0000000
%4 = tail call float @cosf(float %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ MQTTDestroy();
void tpSDKDestory() { MQTTDestroy(); }


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

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

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

LLVM IR (-O2):
define void @tpSDKDestory() {
%1 = tail call i32 (...) @MQTTDestroy()
ret void
}
/* Variables and functions */
int find();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int temp = find();
  printf("%d\n", temp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <find@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%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 <find@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%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
store i32 0, i32* %1
%3 = call i32 (...) @find()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @find()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int op_not(int a) { return !a; }


x86 assembly (clang, -O0):
<op_not>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_not>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @op_not(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @op_not(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *__asctime_r(int /*<<< orphan*/, char *);
int /*<<< orphan*/ __localtime_r(int /*<<< orphan*/ const *, struct tm *);
char *ctime_r(const time_t *t, char *buf) {
  struct tm tm;
  return __asctime_r(__localtime_r(t, &tm), buf);
}


x86 assembly (clang, -O0):
<ctime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <__localtime_r@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <__asctime_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime_r>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <__localtime_r@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <__asctime_r@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @ctime_r(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca %struct.tm
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @__localtime_r(i32* %6, %struct.tm* %5)
%8 = load i8*, i8** %4
%9 = call i8* @__asctime_r(i32 %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @ctime_r(i32* %0, i8* %1) {
%3 = alloca %struct.tm
%4 = bitcast %struct.tm* %3 to i8*
%5 = call i32 @__localtime_r(i32* %0, %struct.tm* %3)
%6 = call i8* @__asctime_r(i32 %5, i8* %1)
ret i8* %6
}
int fun980() { return 980; }


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

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

LLVM IR (-O0):
define i32 @fun980() {
ret i32 980
}

LLVM IR (-O2):
define i32 @fun980() {
ret i32 980
}
/* Variables and functions */
int smallest_diff_sorted(int *, int, int /*<<< orphan*/, int /*<<< orphan*/);
int test_sorted_empty_array() {
  int a[] = {1, 5, 19, 22, 35};
  return -1 == smallest_diff_sorted(a, 5, 0, 0);
}


x86 assembly (clang, -O0):
<test_sorted_empty_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <smallest_diff_sorted@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sorted_empty_array>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <smallest_diff_sorted@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_sorted_empty_array.a = [5 x i32] [i32 1, i32 5, i32 19, i32 22, i32 35]
define i32 @test_sorted_empty_array() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @smallest_diff_sorted(i32* %3, i32 5, i32 0, i32 0)
%5 = icmp eq i32 -1, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_sorted_empty_array.a = [5 x i32] [i32 1, i32 5, i32 19, i32 22, i32 35]
define i32 @test_sorted_empty_array() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @smallest_diff_sorted(i32* %3, i32 5, i32 0, i32 0)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}