xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ md5_constructor();
int /*<<< orphan*/ rmd160_constructor();
int /*<<< orphan*/ sha1_constructor();
void cipher_modules_constructor(void) {
  static int done = 0;
  if (done)
    return;
  done = 1;
  sha1_constructor();
  rmd160_constructor();
  md5_constructor();
}


x86 assembly (clang, -O0):
<cipher_modules_constructor>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f01(%rip)
je     1146 <cipher_modules_constructor+0x16>
jmp    1165 <cipher_modules_constructor+0x35>
movl   $0x1,0x2eec(%rip)
mov    $0x0,%al
call   1030 <sha1_constructor@plt>
mov    $0x0,%al
call   1050 <rmd160_constructor@plt>
mov    $0x0,%al
call   1040 <md5_constructor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cipher_modules_constructor>:
push   %rax
cmpb   $0x0,0x2f04(%rip)
je     113c <cipher_modules_constructor+0xc>
pop    %rax
ret
movb   $0x1,0x2ef9(%rip)
xor    %eax,%eax
call   1030 <sha1_constructor@plt>
xor    %eax,%eax
call   1050 <rmd160_constructor@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <md5_constructor@plt>

LLVM IR (-O0):
@cipher_modules_constructor.done = internal global i32 0
define void @cipher_modules_constructor() {
%1 = load i32, i32* @cipher_modules_constructor.done
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %8
4: ; preds = %0
store i32 1, i32* @cipher_modules_constructor.done
%5 = call i32 (...) @sha1_constructor()
%6 = call i32 (...) @rmd160_constructor()
%7 = call i32 (...) @md5_constructor()
br label %8
8: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@cipher_modules_constructor.done = internal unnamed_addr global i1 false
define void @cipher_modules_constructor() {
%1 = load i1, i1* @cipher_modules_constructor.done
br i1 %1, label %6, label %2
2: ; preds = %0
store i1 true, i1* @cipher_modules_constructor.done
%3 = tail call i32 (...) @sha1_constructor()
%4 = tail call i32 (...) @rmd160_constructor()
%5 = tail call i32 (...) @md5_constructor()
br label %6
6: ; preds = %0, %2
ret void
}
/* Variables and functions */
short VendorCmd(int, int, unsigned short, int /*<<< orphan*/, unsigned short,
                void *);
short GetDesc(unsigned short wValue, unsigned int cDesc, void *desc) {
  return VendorCmd(0x80, 6, wValue, 0, (unsigned short)cDesc, desc);
}


x86 assembly (clang, -O0):
<GetDesc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%r9
mov    $0x80,%edi
mov    $0x6,%esi
xor    %ecx,%ecx
movzwl %dx,%edx
movzwl %ax,%r8d
call   1030 <VendorCmd@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDesc>:
mov    %rdx,%r9
mov    %edi,%edx
movzwl %si,%r8d
mov    $0x80,%edi
mov    $0x6,%esi
xor    %ecx,%ecx
jmp    1030 <VendorCmd@plt>

LLVM IR (-O0):
define signext i16 @GetDesc(i16 zeroext %0, i32 %1, i8* %2) {
%4 = alloca i16
%5 = alloca i32
%6 = alloca i8*
store i16 %0, i16* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i16, i16* %4
%8 = load i32, i32* %5
%9 = trunc i32 %8 to i16
%10 = load i8*, i8** %6
%11 = call signext i16 @VendorCmd(i32 128, i32 6, i16 zeroext %7, i32 0, i16 zeroext %9, i8* %10)
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @GetDesc(i16 zeroext %0, i32 %1, i8* %2) {
%4 = trunc i32 %1 to i16
%5 = tail call signext i16 @VendorCmd(i32 128, i32 6, i16 zeroext %0, i32 0, i16 zeroext %4, i8* %2)
ret i16 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int *newIntArray(int n) {
  int *v;
  if (n <= 0)
    return (NULL);
  v = NULL;
  v = (int *)malloc(n * sizeof(int));
  return (v);
}


x86 assembly (clang, -O0):
<newIntArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1132 <newIntArray+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1155 <newIntArray+0x45>
movq   $0x0,-0x18(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newIntArray>:
test   %edi,%edi
jle    1122 <newIntArray+0x12>
push   %rax
shl    $0x2,%edi
call   1030 <malloc@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @newIntArray(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32* null, i32** %2
br label %16
8: ; preds = %1
store i32* null, i32** %4
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %4
%15 = load i32*, i32** %4
store i32* %15, i32** %2
br label %16
16: ; preds = %8, %7
%17 = load i32*, i32** %2
ret i32* %17
}

LLVM IR (-O2):
define i32* @newIntArray(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = shl i32 %0, 2
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i32*
br label %7
7: ; preds = %1, %3
%8 = phi i32* [ %6, %3 ], [ null, %1 ]
ret i32* %8
}
void exec() {}


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

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

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

LLVM IR (-O2):
define void @exec() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_print(char *);
void game_process_cookie_echoed() { console_print("<\xbb"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"<\BB\00"
define void @game_process_cookie_echoed() {
%1 = call i32 @console_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"<\BB\00"
define void @game_process_cookie_echoed() {
%1 = tail call i32 @console_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
int do_522() { return 522; }


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

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

LLVM IR (-O0):
define i32 @do_522() {
ret i32 522
}

LLVM IR (-O2):
define i32 @do_522() {
ret i32 522
}
void gtk_im_context_set_use_preedit() {}


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

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

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

LLVM IR (-O2):
define void @gtk_im_context_set_use_preedit() {
ret void
}
/* Type definitions */
struct party {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clif_party_message(struct party *, int, char const *,
                                      size_t);
struct party *party_search(int);
void party_recv_message(int party_id, int account_id, const char *mes,
                        size_t len) {
  struct party *p;
  if ((p = party_search(party_id)) == NULL)
    return;
  clif_party_message(p, account_id, mes, len);
  return;
}


x86 assembly (clang, -O0):
<party_recv_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <party_search@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1151 <party_recv_message+0x31>
jmp    1165 <party_recv_message+0x45>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <clif_party_message@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<party_recv_message>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <party_search@plt>
test   %rax,%rax
je     114a <party_recv_message+0x2a>
mov    %rax,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <clif_party_message@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.party = type { i32 }
define void @party_recv_message(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca %struct.party*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i32, i32* %5
%11 = call %struct.party* @party_search(i32 %10)
store %struct.party* %11, %struct.party** %9
%12 = icmp eq %struct.party* %11, null
br i1 %12, label %13, label %14
13: ; preds = %4
br label %20
14: ; preds = %4
%15 = load %struct.party*, %struct.party** %9
%16 = load i32, i32* %6
%17 = load i8*, i8** %7
%18 = load i64, i64* %8
%19 = call i32 @clif_party_message(%struct.party* %15, i32 %16, i8* %17, i64 %18)
br label %20
20: ; preds = %14, %13
ret void
}

LLVM IR (-O2):
%struct.party = type { i32 }
define void @party_recv_message(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call %struct.party* @party_search(i32 %0)
%6 = icmp eq %struct.party* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @clif_party_message(%struct.party* %5, i32 %1, i8* %2, i64 %3)
br label %9
9: ; preds = %4, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvDisableROI(char byBoardNum) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvDisableROI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvDisableROI(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvDisableROI(i8 signext %0) {
%2 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void test85_Test_11_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test85_Test_11_targetInit__I() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *AI_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<AI_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @AI_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @AI_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
long min_long(long a, long b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min_long+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_long+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_long>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min_long(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min_long(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
foo(int k, int j, int z) {
  if (k > z) {
    if (j > k) {
      if (j > z)
        return j;
    }
  }
  return j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1146 <foo+0x46>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1141 <foo+0x41>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113c <foo+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <foo+0x4c>
jmp    1141 <foo+0x41>
jmp    1146 <foo+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 returned %1, i32 %2) {
ret i32 %1
}
int ft_untilc(const char *s, char c) {
  int len;
  len = 0;
  while (*s != c && *s != '\0') {
    len++;
    s++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_untilc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     113d <ft_untilc+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114d <ft_untilc+0x4d>
jmp    1167 <ft_untilc+0x67>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <ft_untilc+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_untilc>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    %sil,%cl
je     1122 <ft_untilc+0x22>
test   %cl,%cl
je     1122 <ft_untilc+0x22>
xor    %eax,%eax
nop
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
cmp    %sil,%cl
je     1122 <ft_untilc+0x22>
test   %cl,%cl
jne    1110 <ft_untilc+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_untilc(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
%5 = icmp eq i8 %3, 0
%6 = or i1 %4, %5
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ 0, %2 ]
%9 = phi i8* [ %11, %7 ], [ %0, %2 ]
%10 = add nuw nsw i32 %8, 1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, %1
%14 = icmp eq i8 %12, 0
%15 = or i1 %13, %14
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i32 [ 0, %2 ], [ %10, %7 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void err_exit(const char *prg, const char *msg) {
  fprintf(stderr, "%s: %s\n", prg, msg);
  exit(1);
}


x86 assembly (clang, -O0):
<err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_exit>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @err_exit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @err_exit(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float sin(double);
float cos(float rad) { return (sin(3.14159265358979323846 / 2.0 - rad)); }


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

x86 assembly (clang, -O2):
<cos>:
cvtss2sd %xmm0,%xmm1
movsd  0xee4(%rip),%xmm0
subsd  %xmm1,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define float @cos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double 0x3FF921FB54442D18, %4
%6 = call float @sin(double %5)
ret float %6
}

LLVM IR (-O2):
define float @cos(float %0) {
%2 = fpext float %0 to double
%3 = fsub double 0x3FF921FB54442D18, %2
%4 = tail call float @sin(double %3)
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
scalar_t__ strlen(char const *);
int system(char *);
int mkdirs(const char *path, mode_t perm) {
  char *cmd = malloc(10 + strlen(path));
  int ret = 0;
  sprintf(cmd, "mkdir -p %s", path);
  ret = system(cmd);
  free(cmd);
  return ret;
}


x86 assembly (clang, -O0):
<mkdirs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0xa,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe72(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <system@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdirs>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0xa(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe91(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"mkdir -p %s\00"
define i32 @mkdirs(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 10, %8
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %5
store i32 0, i32* %6
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %5
%15 = call i32 @system(i8* %14)
store i32 %15, i32* %6
%16 = load i8*, i8** %5
%17 = call i32 @free(i8* %16)
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
@.str = [12 x i8] c"mkdir -p %s\00"
define i32 @mkdirs(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 10
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @system(i8* %5)
%8 = tail call i32 @free(i8* %5)
ret i32 %7
}
int getDataLen(unsigned char *data) {
  int result = 1;
  switch (*data) {
  case 0x01:
    result += 4 + 2;
  case 0x04:
  case 0x10:
  case 0x30:
  case 0xff:
    result += 4 + *(int *)(data + 1);
    break;
  case 0x02:
  case 0x03:
  case 0x20:
    break;
  }
  return result;
}


x86 assembly (clang, -O0):
<getDataLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1192 <getDataLen+0x92>
jmp    1127 <getDataLen+0x27>
mov    -0x10(%rbp),%eax
add    $0xfffffffe,%eax
sub    $0x2,%eax
jb     11b0 <getDataLen+0xb0>
jmp    113b <getDataLen+0x3b>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     119b <getDataLen+0x9b>
jmp    114c <getDataLen+0x4c>
mov    -0x10(%rbp),%eax
sub    $0x10,%eax
je     119b <getDataLen+0x9b>
jmp    115d <getDataLen+0x5d>
mov    -0x10(%rbp),%eax
sub    $0x20,%eax
je     11b0 <getDataLen+0xb0>
jmp    116e <getDataLen+0x6e>
mov    -0x10(%rbp),%eax
sub    $0x30,%eax
je     119b <getDataLen+0x9b>
jmp    117f <getDataLen+0x7f>
mov    -0x10(%rbp),%eax
sub    $0xff,%eax
je     119b <getDataLen+0x9b>
jmp    11b5 <getDataLen+0xb5>
mov    -0xc(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%eax
add    $0x4,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11b5 <getDataLen+0xb5>
jmp    11b5 <getDataLen+0xb5>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDataLen>:
mov    (%rdi),%dl
mov    $0x1,%eax
add    $0x1,%dl
cmp    $0x31,%dl
ja     1137 <getDataLen+0x37>
mov    $0x5,%ecx
movzbl %dl,%edx
movabs $0x2000000020021,%rsi
bt     %rdx,%rsi
jb     1132 <getDataLen+0x32>
cmp    $0x2,%rdx
jne    1137 <getDataLen+0x37>
mov    $0xb,%ecx
add    0x1(%rdi),%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getDataLen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
switch i32 %6, label %19 [
i32 1, label %7
i32 4, label %10
i32 16, label %10
i32 48, label %10
i32 255, label %10
i32 2, label %18
i32 3, label %18
i32 32, label %18
]
7: ; preds = %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 6
store i32 %9, i32* %3
br label %10
10: ; preds = %1, %1, %1, %1, %7
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = add nsw i32 4, %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
br label %19
18: ; preds = %1, %1, %1
br label %19
19: ; preds = %1, %18, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @getDataLen(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %10 [
i8 1, label %3
i8 4, label %4
i8 16, label %4
i8 48, label %4
i8 -1, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %3
%5 = phi i32 [ 5, %1 ], [ 5, %1 ], [ 5, %1 ], [ 5, %1 ], [ 11, %3 ]
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = add i32 %5, %8
br label %10
10: ; preds = %1, %4
%11 = phi i32 [ 1, %1 ], [ %9, %4 ]
ret i32 %11
}
double f2(double x) { return 1 / x; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @f2(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
adr0adrx1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (*((float *)10000000)) = (((float *)11111111)[x1]); }


x86 assembly (clang, -O0):
<adr0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac7,%eax
movss  (%rax,%rcx,4),%xmm0
mov    $0x989680,%eax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrx1_set>:
movslq %esi,%rax
movss  0xa98ac7(,%rax,4),%xmm0
movss  %xmm0,0x989680
ret

LLVM IR (-O0):
define i32 @adr0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* inttoptr (i64 11111111 to float*), i64 %17
%19 = load float, float* %18
store float %19, float* inttoptr (i64 10000000 to float*)
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adr0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* inttoptr (i64 11111111 to float*), i64 %7
%9 = load float, float* %8
store float %9, float* inttoptr (i64 10000000 to float*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ DelayClk3(int);
void delay_eus(int us) { DelayClk3(us * 60 / 8); }


x86 assembly (clang, -O0):
<delay_eus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <DelayClk3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_eus>:
imul   $0x3c,%edi,%eax
lea    0x7(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x3,%edi
jmp    1030 <DelayClk3@plt>

LLVM IR (-O0):
define void @delay_eus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 60
%5 = sdiv i32 %4, 8
%6 = call i32 @DelayClk3(i32 %5)
ret void
}

LLVM IR (-O2):
define void @delay_eus(i32 %0) {
%2 = mul nsw i32 %0, 60
%3 = sdiv i32 %2, 8
%4 = tail call i32 @DelayClk3(i32 %3)
ret void
}
void func_leaf(void) { int a = 0; }


x86 assembly (clang, -O0):
<func_leaf>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @func_leaf() {
ret void
}
/* Variables and functions */
long Cal(scalar_t__);
scalar_t__ Jul(long);
long Add_days(long date, long days) {
  if (date <= 0L)
    return (0L);
  return Cal(days + Jul(date));
}


x86 assembly (clang, -O0):
<Add_days>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1148 <Add_days+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1169 <Add_days+0x49>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Jul@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
call   1040 <Cal@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Add_days>:
test   %rdi,%rdi
jle    113a <Add_days+0x1a>
push   %rbx
mov    %rsi,%rbx
call   1030 <Jul@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <Cal@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @Add_days(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i64 @Jul(i64 %0)
%6 = add nsw i64 %5, %1
%7 = tail call i64 @Cal(i64 %6)
br label %8
8: ; preds = %2, %4
%9 = phi i64 [ %7, %4 ], [ 0, %2 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ put_le16(unsigned int, unsigned char *);
void put_le32(unsigned int val, unsigned char *p) {
  put_le16(val, p);
  put_le16(val >> 16, p + 2);
}


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

x86 assembly (clang, -O2):
<put_le32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <put_le16@plt>
shr    $0x10,%ebp
add    $0x2,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put_le16@plt>

LLVM IR (-O0):
define void @put_le32(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @put_le16(i32 %5, i8* %6)
%8 = load i32, i32* %3
%9 = lshr i32 %8, 16
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = call i32 @put_le16(i32 %9, i8* %11)
ret void
}

LLVM IR (-O2):
define void @put_le32(i32 %0, i8* %1) {
%3 = tail call i32 @put_le16(i32 %0, i8* %1)
%4 = lshr i32 %0, 16
%5 = getelementptr inbounds i8, i8* %1, i64 2
%6 = tail call i32 @put_le16(i32 %4, i8* %5)
ret void
}
int test_02(int a, int b, int c, int d) {
  if (d > 4)
    return a + b + 1;
  else
    return a + c + 1;
}


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jle    112b <test_02+0x2b>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1137 <test_02+0x37>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
cmp    $0x5,%ecx
cmovl  %edx,%esi
lea    (%rdi,%rsi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @test_02(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 4
%6 = select i1 %5, i32 %1, i32 %2
%7 = add i32 %0, 1
%8 = add i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(
      stderr,
      "tone <frequency_Hz>,[<amplitude>] [<frequency_Hz>,[<amplitude>]...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [69 x i8] c"tone <frequency_Hz>,[<amplitude>] [<frequency_Hz>,[<amplitude>]...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [69 x i8] c"tone <frequency_Hz>,[<amplitude>] [<frequency_Hz>,[<amplitude>]...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int mmcif_get_token(void) {
  extern int yylex(void);
  return yylex();
}


x86 assembly (clang, -O0):
<mmcif_get_token>:
push   %rbp
mov    %rsp,%rbp
call   1030 <yylex@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmcif_get_token>:
jmp    1030 <yylex@plt>

LLVM IR (-O0):
define i32 @mmcif_get_token() {
%1 = call i32 @yylex()
ret i32 %1
}

LLVM IR (-O2):
define i32 @mmcif_get_token() {
%1 = tail call i32 @yylex()
ret i32 %1
}
void genlist_default_free_data_func(void *data) {}


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

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

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

LLVM IR (-O2):
define void @genlist_default_free_data_func(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void concat(char *ab, char *a, char *b) {
  strcpy(ab, a);
  strcat(ab, b);
}


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

x86 assembly (clang, -O2):
<concat>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

LLVM IR (-O0):
define void @concat(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %6
%12 = call i32 @strcat(i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
define void @concat(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* %1)
%5 = tail call i32 @strcat(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void debug(char *message, int log) {
  if (log) {
    printf("\x1b[34m");
    printf("[GCDbg] - %s\n", message);
    printf("\x1b[0m");
  }
}


x86 assembly (clang, -O0):
<debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1157 <debug+0x47>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug>:
test   %esi,%esi
je     1146 <debug+0x36>
push   %rbx
mov    %rdi,%rbx
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[34m\00"
@.str.1 = [14 x i8] c"[GCDbg] - %s\0A\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @debug(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[34m\00"
@.str.1 = [14 x i8] c"[GCDbg] - %s\0A\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @debug(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %4, %2
ret void
}
int __nedf2(double a __attribute__((unused)),
            double b __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<__nedf2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__nedf2(double %0, double %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void badCommand() {
  printf("I'm not sure what you mean :(\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badCommand>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badCommand>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"I'm not sure what you mean :(\0A\00"
define void @badCommand() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [30 x i8] c"I'm not sure what you mean :(\00"
define void @badCommand() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
unsigned char cast_ulong_uchar(unsigned long int x) { return (unsigned char)x; }


x86 assembly (clang, -O0):
<cast_ulong_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @cast_ulong_uchar(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @cast_ulong_uchar(i64 %0) {
%2 = trunc i64 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void or_reg32_reg32(unsigned long reg1, unsigned long reg2) {
  put8(0x09);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<or_reg32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x9,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
or     $0xc0,%rax
or     -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_reg32_reg32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x9,%edi
call   1030 <put8@plt>
shl    $0x3,%r14d
or     %r14d,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @or_reg32_reg32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 @put8(i32 9)
%6 = load i64, i64* %4
%7 = shl i64 %6, 3
%8 = or i64 192, %7
%9 = load i64, i64* %3
%10 = or i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = call i32 @put8(i32 %11)
ret void
}

LLVM IR (-O2):
define void @or_reg32_reg32(i64 %0, i64 %1) {
%3 = tail call i32 @put8(i32 9)
%4 = shl i64 %1, 3
%5 = or i64 %4, %0
%6 = trunc i64 %5 to i32
%7 = or i32 %6, 192
%8 = tail call i32 @put8(i32 %7)
ret void
}
/* Variables and functions */
scalar_t__ networking_initialized(int, int /*<<< orphan*/);
int networking_init() {
  if (networking_initialized(1, 0)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<networking_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <networking_initialized@plt>
cmp    $0x0,%rax
je     113a <networking_init+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <networking_init+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<networking_init>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <networking_initialized@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @networking_init() {
%1 = alloca i32
%2 = call i64 @networking_initialized(i32 1, i32 0)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @networking_init() {
%1 = tail call i64 @networking_initialized(i32 1, i32 0)
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int main() {
  void *ptr;
  void *fixed_array_of_ptr[7];
  char string[] = "static string";
  free(&ptr);
  free(fixed_array_of_ptr);
  free(string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x5e(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x56(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x52(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    -0x50(%rbp),%rdi
call   1030 <free@plt>
lea    -0x5e(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.string = [14 x i8] c"static string\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [7 x i8*]
%4 = alloca [14 x i8]
store i32 0, i32* %1
%5 = bitcast [14 x i8]* %4 to i8*
%6 = bitcast i8** %2 to i8*
%7 = getelementptr inbounds [7 x i8*], [7 x i8*]* %3, i64 0, i64 0
%8 = bitcast i8** %7 to i8*
%9 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int abs(int);
int isreach_gold(int dx, int dy) {
  if (dx == 0 && abs(dy) == 1)
    return 1;
  if (abs(dx) == 1 && (dy == 0 || dy == 1))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isreach_gold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1145 <isreach_gold+0x35>
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x1,%eax
jne    1145 <isreach_gold+0x35>
movl   $0x1,-0x4(%rbp)
jmp    117d <isreach_gold+0x6d>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x1,%eax
jne    1176 <isreach_gold+0x66>
cmpl   $0x0,-0xc(%rbp)
je     116a <isreach_gold+0x5a>
cmpl   $0x1,-0xc(%rbp)
jne    1176 <isreach_gold+0x66>
movl   $0x1,-0x4(%rbp)
jmp    117d <isreach_gold+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreach_gold>:
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
test   %edi,%edi
jne    1116 <isreach_gold+0x16>
mov    $0x1,%eax
cmp    $0x1,%ecx
jne    1116 <isreach_gold+0x16>
ret
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
cmp    $0x1,%eax
sete   %al
cmp    $0x2,%esi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isreach_gold(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%5 = icmp eq i32 %4, 1
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%9 = icmp eq i32 %8, 1
%10 = icmp ult i32 %1, 2
%11 = and i1 %9, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %2
%14 = phi i32 [ 1, %2 ], [ %12, %7 ]
ret i32 %14
}
int clamp(int x) {
  int _x = (x);
  return _x > 999 ? 999 : _x < -999 ? -999 : _x;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3e7,-0x8(%rbp)
jle    1127 <clamp+0x27>
mov    $0x3e7,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <clamp+0x4d>
cmpl   $0xfffffc19,-0x8(%rbp)
jge    1141 <clamp+0x41>
mov    $0xfffffc19,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp+0x47>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
cmp    $0xfffffc1a,%edi
mov    $0xfffffc19,%ecx
cmovge %edi,%ecx
cmp    $0x3e7,%ecx
mov    $0x3e7,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @clamp(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* %3
%6 = icmp sgt i32 %5, 999
br i1 %6, label %7, label %8
7: ; preds = %1
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, -999
br i1 %10, label %11, label %12
11: ; preds = %8
br label %14
12: ; preds = %8
%13 = load i32, i32* %3
br label %14
14: ; preds = %12, %11
%15 = phi i32 [ -999, %11 ], [ %13, %12 ]
br label %16
16: ; preds = %14, %7
%17 = phi i32 [ 999, %7 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @clamp(i32 %0) {
%2 = icmp sgt i32 %0, -999
%3 = select i1 %2, i32 %0, i32 -999
%4 = icmp slt i32 %3, 999
%5 = select i1 %4, i32 %3, i32 999
ret i32 %5
}