xunge/DecIR huggingface dataset:
/* Variables and functions */
int html_string(char *, char *);
scalar_t__ html_tablealign(int);
int html_tablecaption(int align, char *text) {
  int l = html_string("<%s", "CAPTION");
  l += html_tablealign(align);
  l += html_string(">%s</CAPTION>\n", text);
  return l;
}


x86 assembly (clang, -O0):
<html_tablecaption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <html_tablealign@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <html_string@plt>
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_tablecaption>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xed0(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <html_string@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <html_tablealign@plt>
mov    %rax,%rbp
add    %ebx,%ebp
lea    0xebb(%rip),%rdi
mov    %r14,%rsi
call   1030 <html_string@plt>
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"<%s\00"
@.str.1 = [8 x i8] c"CAPTION\00"
@.str.2 = [15 x i8] c">%s</CAPTION>\0A\00"
define i32 @html_tablecaption(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 %6, i32* %5
%7 = load i32, i32* %3
%8 = call i64 @html_tablealign(i32 %7)
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %5
%13 = load i8*, i8** %4
%14 = call i32 @html_string(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %5
%16 = add nsw i32 %15, %14
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"<%s\00"
@.str.1 = [8 x i8] c"CAPTION\00"
@.str.2 = [15 x i8] c">%s</CAPTION>\0A\00"
define i32 @html_tablecaption(i32 %0, i8* %1) {
%3 = tail call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i64 @html_tablealign(i32 %0)
%5 = trunc i64 %4 to i32
%6 = add i32 %3, %5
%7 = tail call i32 @html_string(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%8 = add nsw i32 %6, %7
ret i32 %8
}
/* Type definitions */
struct i8x_readbuf {
  int dummy;
};
struct i8x_object {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_ob_unref(struct i8x_object *);
struct i8x_readbuf *__attribute__((always_))
i8x_rb_unref(struct i8x_readbuf *x) {
  return (struct i8x_readbuf *)i8x_ob_unref((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_rb_unref>:
jmp    1030 <i8x_ob_unref@plt>

LLVM IR (-O0):
%struct.i8x_readbuf = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_readbuf* @i8x_rb_unref(%struct.i8x_readbuf* %0) {
%2 = alloca %struct.i8x_readbuf*
store %struct.i8x_readbuf* %0, %struct.i8x_readbuf** %2
%3 = load %struct.i8x_readbuf*, %struct.i8x_readbuf** %2
%4 = bitcast %struct.i8x_readbuf* %3 to %struct.i8x_object*
%5 = call i64 @i8x_ob_unref(%struct.i8x_object* %4)
%6 = inttoptr i64 %5 to %struct.i8x_readbuf*
ret %struct.i8x_readbuf* %6
}

LLVM IR (-O2):
%struct.i8x_readbuf = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_readbuf* @i8x_rb_unref(%struct.i8x_readbuf* %0) {
%2 = bitcast %struct.i8x_readbuf* %0 to %struct.i8x_object*
%3 = tail call i64 @i8x_ob_unref(%struct.i8x_object* %2)
%4 = inttoptr i64 %3 to %struct.i8x_readbuf*
ret %struct.i8x_readbuf* %4
}
/* Variables and functions */
int /*<<< orphan*/ genStd4(unsigned char);
void FOO_FOO() { genStd4('U'); }


x86 assembly (clang, -O0):
<FOO_FOO>:
push   %rbp
mov    %rsp,%rbp
mov    $0x55,%edi
call   1030 <genStd4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FOO_FOO>:
mov    $0x55,%edi
jmp    1030 <genStd4@plt>

LLVM IR (-O0):
define void @FOO_FOO() {
%1 = call i32 @genStd4(i8 zeroext 85)
ret void
}

LLVM IR (-O2):
define void @FOO_FOO() {
%1 = tail call i32 @genStd4(i8 zeroext 85)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorExit(char *, char *);
void Check_Unload(int argc, char **argv) {
  if (argc > 3) {
    if (argc == 4)
      return;
    PrintErrorExit(argv[0], "unload");
  }
  PrintErrorExit(argv[0], "unload");
}


x86 assembly (clang, -O0):
<Check_Unload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jle    114b <Check_Unload+0x3b>
cmpl   $0x4,-0x4(%rbp)
jne    1138 <Check_Unload+0x28>
jmp    115e <Check_Unload+0x4e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeba(%rip),%rsi
call   1030 <PrintErrorExit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xea7(%rip),%rsi
call   1030 <PrintErrorExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Check_Unload>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x4,%edi
jl     112c <Check_Unload+0x1c>
jne    111d <Check_Unload+0xd>
pop    %rbx
ret
mov    (%rbx),%rdi
lea    0xed9(%rip),%rsi
call   1030 <PrintErrorExit@plt>
mov    (%rbx),%rdi
lea    0xeca(%rip),%rsi
pop    %rbx
jmp    1030 <PrintErrorExit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"unload\00"
define void @Check_Unload(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 = icmp sgt i32 %5, 3
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %7
br label %21
11: ; preds = %7
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @PrintErrorExit(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %11, %2
%17 = load i8**, i8*** %4
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @PrintErrorExit(i8* %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %16, %10
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"unload\00"
define void @Check_Unload(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 3
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = icmp eq i32 %0, 4
br i1 %5, label %12, label %6
6: ; preds = %4
%7 = load i8*, i8** %1
%8 = tail call i32 @PrintErrorExit(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %2
%10 = load i8*, i8** %1
%11 = tail call i32 @PrintErrorExit(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %4, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int strings_and_pointers() {
  char arr[] = "hello";
  char *char_ptr;
  char_ptr = &arr[2];
  printf("arr[2] = %c\n", *char_ptr);
}


x86 assembly (clang, -O0):
<strings_and_pointers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xedc(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lea    0xec3(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strings_and_pointers>:
lea    0xee9(%rip),%rdi
mov    $0x6c,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"arr[2] = %c\0A\00"
define i32 @strings_and_pointers() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext 108)
ret i32 undef
}
void metric_der_shift(const double x[3], double db[12]) {
  int i;
  for (i = 0; i < 12; i++)
    db[i] = 0.0;
}


x86 assembly (clang, -O0):
<metric_der_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xc,-0x14(%rbp)
jge    113b <metric_der_shift+0x3b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <metric_der_shift+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<metric_der_shift>:
xorps  %xmm0,%xmm0
movups %xmm0,0x50(%rsi)
movups %xmm0,0x40(%rsi)
movups %xmm0,0x30(%rsi)
movups %xmm0,0x20(%rsi)
movups %xmm0,0x10(%rsi)
movups %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @metric_der_shift(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 12
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load double*, double** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
store double 0.000000e+00, double* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @metric_der_shift(double* nocapture readnone %0, double* nocapture writeonly %1) {
%3 = bitcast double* %1 to i8*
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ opt;

/* Variables and functions */
int setsockopt(int, int, int, int *, int);
int __sapi_sock_set_optint(int sock, int so_lvl, int opt_name) {
  int opt = 1;
  return setsockopt(sock, so_lvl, opt_name, &opt, sizeof(opt));
}


x86 assembly (clang, -O0):
<__sapi_sock_set_optint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sapi_sock_set_optint>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @__sapi_sock_set_optint(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 1, i32* %4
%6 = call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i32* %4, i32 4)
ret i32 %6
}
int copysingl(singl, num)
int singl, num;
{
  int copy, i;
  copy = mkstate((256 + 1));
  for (i = 1; i <= num; ++i)
    copy = link_machines(copy, dupmachine(singl));
  return (copy);
}


x86 assembly (clang, -O0):
<copysingl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x101,%edi
mov    $0x0,%al
call   1030 <mkstate@plt>
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     118d <copysingl+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <dupmachine@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    $0x0,%al
call   1050 <link_machines@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <copysingl+0x24>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysingl>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
mov    $0x101,%edi
xor    %eax,%eax
call   1030 <mkstate@plt>
mov    %eax,%ebp
test   %ebx,%ebx
jle    116c <copysingl+0x3c>
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
xor    %eax,%eax
call   1040 <dupmachine@plt>
mov    %ebp,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <link_machines@plt>
mov    %eax,%ebp
add    $0xffffffff,%ebx
jne    1150 <copysingl+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @copysingl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 (i32, ...) bitcast (i32 (...)* @mkstate to i32 (i32, ...)*)(i32 257)
store i32 %7, i32* %5
store i32 1, i32* %6
br label %8
8: ; preds = %17, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %3
%15 = call i32 (i32, ...) bitcast (i32 (...)* @dupmachine to i32 (i32, ...)*)(i32 %14)
%16 = call i32 (i32, i32, ...) bitcast (i32 (...)* @link_machines to i32 (i32, i32, ...)*)(i32 %13, i32 %15)
store i32 %16, i32* %5
br label %17
17: ; preds = %12
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %8
20: ; preds = %8
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @copysingl(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @mkstate to i32 (i32, ...)*)(i32 257)
%4 = icmp slt i32 %1, 1
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ 1, %2 ]
%7 = phi i32 [ %9, %5 ], [ %3, %2 ]
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @dupmachine to i32 (i32, ...)*)(i32 %0)
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @link_machines to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
%10 = add nuw i32 %6, 1
%11 = icmp eq i32 %6, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ %3, %2 ], [ %9, %5 ]
ret i32 %13
}
int cairo_code_draw_envCurrentLabel_get_width() { return 73; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envCurrentLabel_get_width() {
ret i32 73
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envCurrentLabel_get_width() {
ret i32 73
}
/* Variables and functions */
int /*<<< orphan*/ change_srv_plist_serial();
int /*<<< orphan*/ clear_playlist();
scalar_t__ options_get_bool(char *);
int /*<<< orphan*/ send_int_to_srv(int);
void cmd_clear_playlist() {
  if (options_get_bool("SyncPlaylist")) {
    send_int_to_srv(0x29);
    send_int_to_srv(0x26);
    change_srv_plist_serial();
    send_int_to_srv(0x2a);
  } else
    clear_playlist();
}


x86 assembly (clang, -O0):
<cmd_clear_playlist>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <options_get_bool@plt>
cmp    $0x0,%rax
je     1184 <cmd_clear_playlist+0x44>
mov    $0x29,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x26,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x0,%al
call   1050 <change_srv_plist_serial@plt>
mov    $0x2a,%edi
call   1030 <send_int_to_srv@plt>
jmp    118b <cmd_clear_playlist+0x4b>
mov    $0x0,%al
call   1060 <clear_playlist@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_clear_playlist>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <options_get_bool@plt>
test   %rax,%rax
je     1178 <cmd_clear_playlist+0x38>
mov    $0x29,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x26,%edi
call   1030 <send_int_to_srv@plt>
xor    %eax,%eax
call   1050 <change_srv_plist_serial@plt>
mov    $0x2a,%edi
pop    %rax
jmp    1030 <send_int_to_srv@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <clear_playlist@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"SyncPlaylist\00"
define void @cmd_clear_playlist() {
%1 = call i64 @options_get_bool(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = call i32 @send_int_to_srv(i32 41)
%5 = call i32 @send_int_to_srv(i32 38)
%6 = call i32 (...) @change_srv_plist_serial()
%7 = call i32 @send_int_to_srv(i32 42)
br label %10
8: ; preds = %0
%9 = call i32 (...) @clear_playlist()
br label %10
10: ; preds = %8, %3
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"SyncPlaylist\00"
define void @cmd_clear_playlist() {
%1 = tail call i64 @options_get_bool(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @send_int_to_srv(i32 41)
%5 = tail call i32 @send_int_to_srv(i32 38)
%6 = tail call i32 (...) @change_srv_plist_serial()
%7 = tail call i32 @send_int_to_srv(i32 42)
br label %10
8: ; preds = %0
%9 = tail call i32 (...) @clear_playlist()
br label %10
10: ; preds = %8, %3
ret void
}
int getIndexPixel(int x, int y, int width) { return (y * width) + x; }


x86 assembly (clang, -O0):
<getIndexPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndexPixel>:
imul   %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @getIndexPixel(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
int test_imm_C2uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xC2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C2uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xc2,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C2uint64_highword_reg>:
movabs $0xc200000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C2uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 833223655424
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGSTOP;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void handler(int signo __attribute__((unused))) {
  printf("About to stop child\n");
  raise(SIGSTOP);
  printf("Child has continued\n");
  exit(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"About to stop child\0A\00"
@SIGSTOP = global i32 0
@.str.1 = [21 x i8] c"Child has continued\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @SIGSTOP
%5 = call i32 @raise(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGSTOP = global i32 0
@str = [20 x i8] c"About to stop child\00"
@str.2 = [20 x i8] c"Child has continued\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @SIGSTOP
%4 = tail call i32 @raise(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
scalar_t__ nd_int();
int *foo() {
  int *p = (int *)malloc(sizeof(int));
  if (nd_int()) {
    *p = 5;
  } else {
    *p = 10;
  }
  return p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <nd_int@plt>
cmp    $0x0,%rax
je     1156 <foo+0x36>
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
jmp    1160 <foo+0x40>
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <nd_int@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,4),%eax
add    $0x5,%eax
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @foo() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = call i64 (...) @nd_int()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32*, i32** %1
store i32 5, i32* %7
br label %10
8: ; preds = %0
%9 = load i32*, i32** %1
store i32 10, i32* %9
br label %10
10: ; preds = %8, %6
%11 = load i32*, i32** %1
ret i32* %11
}

LLVM IR (-O2):
define i32* @foo() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i64 (...) @nd_int()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 10, i32 5
store i32 %5, i32* %2
ret i32* %2
}
/* Variables and functions */
unsigned char BSP_UART_ReceiveByte(unsigned int);
void BSP_UART_ReceiveCongestionBuffer(unsigned int port, unsigned char *pBuffer,
                                      unsigned int length) {
  unsigned int n;
  for (n = 0; n < length; n++) {
    pBuffer[n] = BSP_UART_ReceiveByte(port);
  }
}


x86 assembly (clang, -O0):
<BSP_UART_ReceiveCongestionBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1157 <BSP_UART_ReceiveCongestionBuffer+0x47>
mov    -0x4(%rbp),%edi
call   1030 <BSP_UART_ReceiveByte@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <BSP_UART_ReceiveCongestionBuffer+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_UART_ReceiveCongestionBuffer>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
je     1145 <BSP_UART_ReceiveCongestionBuffer+0x35>
mov    %rsi,%r14
mov    %edi,%r15d
mov    %edx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15d,%edi
call   1030 <BSP_UART_ReceiveByte@plt>
mov    %al,(%r14,%rbp,1)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <BSP_UART_ReceiveCongestionBuffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @BSP_UART_ReceiveCongestionBuffer(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = tail call zeroext i8 @BSP_UART_ReceiveByte(i32 %0)
%10 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 %9, i8* %10
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %3
ret void
}
int eqin(s1, s2, start_param)
register char *s1;
register char *s2;
char **start_param;
{
  while (*s1) {
    if (*s1++ != *s2++)
      return (0);
  }
  *start_param = s2;
  return (1);
}


x86 assembly (clang, -O0):
<eqin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <eqin+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1155 <eqin+0x55>
movl   $0x0,-0x4(%rbp)
jmp    116c <eqin+0x6c>
jmp    1110 <eqin+0x10>
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eqin>:
movzbl (%rdi),%eax
test   %al,%al
je     1119 <eqin+0x19>
add    $0x1,%rdi
lea    0x1(%rsi),%rcx
cmp    (%rsi),%al
mov    %rcx,%rsi
je     1100 <eqin>
xor    %eax,%eax
ret
mov    %rsi,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @eqin(i8* nocapture %0, i8* %1, i8** nocapture writeonly %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %10, %9 ]
%6 = phi i8* [ %1, %3 ], [ %11, %9 ]
%7 = load i8, i8* %5
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %6
%13 = icmp eq i8 %7, %12
br i1 %13, label %4, label %15
14: ; preds = %4
store i8* %6, i8** %2
br label %15
15: ; preds = %9, %14
%16 = phi i32 [ 1, %14 ], [ 0, %9 ]
ret i32 %16
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void rescale(uint16_t *rgbwVal) {
  for (int i = 0; i < 4; i++) {
    rgbwVal[i] /= 4;
  }
}


x86 assembly (clang, -O0):
<rescale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1147 <rescale+0x47>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x4,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <rescale+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rescale>:
movdqu (%rdi),%xmm0
movdqa %xmm0,%xmm1
psrad  $0x1f,%xmm1
psrld  $0x1e,%xmm1
paddd  %xmm0,%xmm1
psrad  $0x2,%xmm1
movdqu %xmm1,(%rdi)
ret

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

LLVM IR (-O2):
define void @rescale(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = sdiv <4 x i32> %3, <i32 4, i32 4, i32 4, i32 4>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
ret void
}
int dollar_line(int door_height, int line) {
  int dollar_location_y;
  dollar_location_y = (door_height / 2) + 1;
  if (dollar_location_y == line)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<dollar_line>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1133 <dollar_line+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <dollar_line+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dollar_line>:
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
add    $0x1,%ecx
xor    %eax,%eax
cmp    %esi,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @dollar_line(i32 %0, i32 %1) {
%3 = sdiv i32 %0, 2
%4 = add nsw i32 %3, 1
%5 = icmp eq i32 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void show_fibonacci_sequence() {
  uint64_t a = 0, b = 1, n, i;
  for (i = 0; i < 90; i++) {
    n = a + b;
    printf("%lld\n", n);
    a = b;
    b = n;
  }
}


x86 assembly (clang, -O0):
<show_fibonacci_sequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5a,-0x10(%rbp)
jge    1169 <show_fibonacci_sequence+0x59>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <show_fibonacci_sequence+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_fibonacci_sequence>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r15d
xor    %eax,%eax
mov    $0x5a,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %eax,%ebp
add    %r15d,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %r15d,%eax
mov    %ebp,%r15d
add    $0xffffffff,%ebx
jne    1130 <show_fibonacci_sequence+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define void @show_fibonacci_sequence() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi i32 [ 0, %0 ], [ %4, %1 ]
%4 = phi i32 [ 1, %0 ], [ %5, %1 ]
%5 = add nsw i32 %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 90
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CarList_Change();
int /*<<< orphan*/ Car_QueuePop();
void RemoveFirstCarWeightInfo(void) {
  Car_QueuePop();
  CarList_Change();
}


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

x86 assembly (clang, -O2):
<RemoveFirstCarWeightInfo>:
push   %rax
xor    %eax,%eax
call   1030 <Car_QueuePop@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <CarList_Change@plt>

LLVM IR (-O0):
define void @RemoveFirstCarWeightInfo() {
%1 = call i32 (...) @Car_QueuePop()
%2 = call i32 (...) @CarList_Change()
ret void
}

LLVM IR (-O2):
define void @RemoveFirstCarWeightInfo() {
%1 = tail call i32 (...) @Car_QueuePop()
%2 = tail call i32 (...) @CarList_Change()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprint_version(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void simple_help() {
  fprint_version(stderr);
  fprintf(stderr, "Type 'm2p -h' for help.\n");
  exit(2);
}


x86 assembly (clang, -O0):
<simple_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <fprint_version@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<simple_help>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
call   1050 <fprint_version@plt>
mov    (%rbx),%edi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Type 'm2p -h' for help.\0A\00"
define void @simple_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprint_version(i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Type 'm2p -h' for help.\0A\00"
define void @simple_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprint_version(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 2)
unreachable
}
unsigned int my_pow(unsigned int n, unsigned int p) {
  unsigned int end;
  end = 1;
  while (p > 0) {
    if (p % 2) {
      p--;
      end = end * n;
    }
    p >>= 1;
    n *= n;
  }
  return end;
}


x86 assembly (clang, -O0):
<my_pow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1155 <my_pow+0x55>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113d <my_pow+0x3d>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <my_pow+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pow>:
test   %esi,%esi
je     112e <my_pow+0x2e>
mov    $0x1,%ecx
mov    $0x1,%eax
xchg   %ax,%ax
mov    %esi,%edx
and    $0xfffffffe,%edx
test   $0x1,%sil
mov    %edi,%esi
cmove  %ecx,%esi
imul   %esi,%eax
mov    %edx,%esi
shr    %esi
imul   %edi,%edi
cmp    $0x1,%edx
ja     1110 <my_pow+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @my_pow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %18, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %14, %4 ], [ 1, %2 ]
%6 = phi i32 [ %15, %4 ], [ %1, %2 ]
%7 = phi i32 [ %16, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = xor i1 %9, true
%11 = sext i1 %10 to i32
%12 = add i32 %6, %11
%13 = select i1 %9, i32 1, i32 %7
%14 = mul i32 %13, %5
%15 = lshr i32 %12, 1
%16 = mul i32 %7, %7
%17 = icmp ult i32 %12, 2
br i1 %17, label %18, label %4
18: ; preds = %4, %2
%19 = phi i32 [ 1, %2 ], [ %14, %4 ]
ret i32 %19
}
int graph_log_10(int i) {
  int l;
  for (l = -1; i > 0; l++) {
    i /= 10;
  }
  return l;
}


x86 assembly (clang, -O0):
<graph_log_10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <graph_log_10+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <graph_log_10+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<graph_log_10>:
mov    $0xffffffff,%eax
test   %edi,%edi
jle    1124 <graph_log_10+0x24>
mov    $0xcccccccd,%ecx
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <graph_log_10+0x10>
ret

LLVM IR (-O0):
define i32 @graph_log_10(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 10
store i32 %9, i32* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @graph_log_10(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ -1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add nsw i32 %4, 1
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %10
}
unsigned xrop3_57_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_57_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_57_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
lea    -0x100(%rsi),%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_57_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_57_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %5, -256
%7 = xor i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int parse_service_path(char const *, size_t, char const *, char *, char *,
                       char const **, char const **);
int altera_parse_q13_service_path(const char *buf, size_t buflen,
                                  const char *cable, const char **begin,
                                  const char **end) {
  return parse_service_path(buf, buflen, cable, "\\{", "\\}", begin, end);
}


x86 assembly (clang, -O0):
<altera_parse_q13_service_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r9
mov    -0x28(%rbp),%rax
lea    0xeb9(%rip),%rcx
lea    0xeb5(%rip),%r8
mov    %rax,(%rsp)
call   1030 <parse_service_path@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<altera_parse_q13_service_path>:
push   %rax
mov    %rcx,%r9
mov    %r8,(%rsp)
lea    0xee1(%rip),%rcx
lea    0xedd(%rip),%r8
call   1030 <parse_service_path@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\\{\00"
@.str.1 = [3 x i8] c"\\}\00"
define i32 @altera_parse_q13_service_path(i8* %0, i64 %1, i8* %2, i8** %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i8**
%10 = alloca i8**
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i8** %3, i8*** %9
store i8** %4, i8*** %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = load i8**, i8*** %9
%15 = load i8**, i8*** %10
%16 = call i32 @parse_service_path(i8* %11, i64 %12, i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %14, i8** %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"\\{\00"
@.str.1 = [3 x i8] c"\\}\00"
define i32 @altera_parse_q13_service_path(i8* %0, i64 %1, i8* %2, i8** %3, i8** %4) {
%6 = tail call i32 @parse_service_path(i8* %0, i64 %1, i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3, i8** %4)
ret i32 %6
}
/* Variables and functions */
int pidfd_getfd(int, int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) { return pidfd_getfd(-1, 0, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <pidfd_getfd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <pidfd_getfd@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @pidfd_getfd(i32 -1, i32 0, i32 0)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @pidfd_getfd(i32 -1, i32 0, i32 0)
ret i32 %1
}
/* Type definitions */
struct pci_bus {
  int dummy;
};

/* Variables and functions */
int pci_domain_nr(struct pci_bus *);
__attribute__((always_)) int pci_proc_domain(struct pci_bus *bus) {
  return pci_domain_nr(bus);
}


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

x86 assembly (clang, -O2):
<pci_proc_domain>:
jmp    1030 <pci_domain_nr@plt>

LLVM IR (-O0):
%struct.pci_bus = type { i32 }
define i32 @pci_proc_domain(%struct.pci_bus* %0) {
%2 = alloca %struct.pci_bus*
store %struct.pci_bus* %0, %struct.pci_bus** %2
%3 = load %struct.pci_bus*, %struct.pci_bus** %2
%4 = call i32 @pci_domain_nr(%struct.pci_bus* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.pci_bus = type { i32 }
define i32 @pci_proc_domain(%struct.pci_bus* %0) {
%2 = tail call i32 @pci_domain_nr(%struct.pci_bus* %0)
ret i32 %2
}
void handleError(char theSSR) {
  (*((volatile unsigned char *)0x05FFFECC)) &= ~(0x20 | 0x08 | 0x10);
}


x86 assembly (clang, -O0):
<handleError>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x5fffecc,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0xffffffc7,%eax
mov    %al,%cl
mov    $0x5fffecc,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleError>:
andb   $0xc7,0x5fffecc
c7
ret

LLVM IR (-O0):
define void @handleError(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%4 = zext i8 %3 to i32
%5 = and i32 %4, -57
%6 = trunc i32 %5 to i8
store volatile i8 %6, i8* inttoptr (i64 100662988 to i8*)
ret void
}

LLVM IR (-O2):
define void @handleError(i8 signext %0) {
%2 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%3 = and i8 %2, -57
store volatile i8 %3, i8* inttoptr (i64 100662988 to i8*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void writeScenario(FILE *f, char *password) { fprintf(f, "%s", password); }


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

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

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

LLVM IR (-O2):
define void @writeScenario(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @fputs(i8* %1, i32* %0)
ret void
}