xunge/DecIR huggingface dataset:
void matrix_uninit(double **A) {
  if (A[0])
    free(A[0]);
  if (A)
    free(A);
}


x86 assembly (clang, -O0):
<matrix_uninit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <matrix_uninit+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x8(%rbp)
je     114a <matrix_uninit+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_uninit>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1121 <matrix_uninit+0x11>
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @matrix_uninit(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = icmp ne double* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load double**, double*** %2
%9 = getelementptr inbounds double*, double** %8, i64 0
%10 = load double*, double** %9
%11 = bitcast double* %10 to i8*
br label %12
12: ; preds = %7, %1
%13 = load double**, double*** %2
%14 = icmp ne double** %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load double**, double*** %2
%17 = bitcast double** %16 to i8*
br label %18
18: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
define void @matrix_uninit(double** nocapture %0) {
%2 = load double*, double** %0
%3 = icmp eq double* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = bitcast double* %2 to i8*
tail call void @free(i8* %5)
br label %6
6: ; preds = %1, %4
%7 = bitcast double** %0 to i8*
tail call void @free(i8* %7)
ret void
}
char remove_box(char ch) {
  switch (ch) {
  case '*':
    return '.';
  case '$':
    return ' ';
  default:
    return ch;
  }
}


x86 assembly (clang, -O0):
<remove_box>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x24,%eax
je     1139 <remove_box+0x39>
jmp    111f <remove_box+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2a,%eax
jne    1142 <remove_box+0x42>
jmp    1130 <remove_box+0x30>
movb   $0x2e,-0x1(%rbp)
jmp    1148 <remove_box+0x48>
movb   $0x20,-0x1(%rbp)
jmp    1148 <remove_box+0x48>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_box>:
cmp    $0x2a,%edi
je     110f <remove_box+0xf>
mov    %edi,%eax
cmp    $0x24,%edi
jne    110e <remove_box+0xe>
mov    $0x20,%al
ret
mov    $0x2e,%al
ret

LLVM IR (-O0):
define signext i8 @remove_box(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 42, label %6
i32 36, label %7
]
6: ; preds = %1
store i8 46, i8* %2
br label %10
7: ; preds = %1
store i8 32, i8* %2
br label %10
8: ; preds = %1
%9 = load i8, i8* %3
store i8 %9, i8* %2
br label %10
10: ; preds = %8, %7, %6
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @remove_box(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %4 [
i32 42, label %5
i32 36, label %3
]
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3
%6 = phi i8 [ %0, %4 ], [ 32, %3 ], [ 46, %1 ]
ret i8 %6
}
int main() {
  int a = 0;
  int b = 10;
  int c = 0;
  c = b / a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 10, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = sdiv i32 %5, %6
store i32 %7, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
const char *pathcon_nm10_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathcon_nm10_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathcon_nm10_name_in+0x2b>
jmp    111a <pathcon_nm10_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathcon_nm10_name_in+0x3b>
jmp    114b <pathcon_nm10_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm10_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm10_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm10_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @pathcon_nm10_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @pathcon_nm10_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
char *getcwd(char *, int);
char *get_cwd(char *path, int maxlen) {
  char *ret = getcwd(path, maxlen);
  ret = ret;
  ;
  return path;
}


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

x86 assembly (clang, -O2):
<get_cwd>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getcwd@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_cwd(i8* returned %0, i32 %1) {
%3 = tail call i8* @getcwd(i8* %0, i32 %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ change_some_references();
int /*<<< orphan*/ create_data();
int /*<<< orphan*/ print_data();
int /*<<< orphan*/ test_filters();
void do_tests() {
  create_data();
  change_some_references();
  test_filters();
  print_data();
}


x86 assembly (clang, -O0):
<do_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <create_data@plt>
mov    $0x0,%al
call   1030 <change_some_references@plt>
mov    $0x0,%al
call   1060 <test_filters@plt>
mov    $0x0,%al
call   1040 <print_data@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_tests>:
push   %rax
xor    %eax,%eax
call   1050 <create_data@plt>
xor    %eax,%eax
call   1030 <change_some_references@plt>
xor    %eax,%eax
call   1060 <test_filters@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <print_data@plt>

LLVM IR (-O0):
define void @do_tests() {
%1 = call i32 (...) @create_data()
%2 = call i32 (...) @change_some_references()
%3 = call i32 (...) @test_filters()
%4 = call i32 (...) @print_data()
ret void
}

LLVM IR (-O2):
define void @do_tests() {
%1 = tail call i32 (...) @create_data()
%2 = tail call i32 (...) @change_some_references()
%3 = tail call i32 (...) @test_filters()
%4 = tail call i32 (...) @print_data()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void file_fail(const char *filename) {
  printf("Error parsing %s\n", filename);
  exit(1);
}


x86 assembly (clang, -O0):
<file_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [18 x i8] c"Error parsing %s\0A\00"
define void @file_fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"Error parsing %s\0A\00"
define void @file_fail(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ CONS_Printf(char *, ...);
int I_GetKey();
int /*<<< orphan*/ I_OsPolling();
void CONS_Error(const char *msg) {
  CONS_Printf("\x82%s", msg);
  CONS_Printf(("Press ENTER to continue\n"));
  while (I_GetKey() != 13)
    I_OsPolling();
}


x86 assembly (clang, -O0):
<CONS_Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <CONS_Printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <CONS_Printf@plt>
mov    $0x0,%al
call   1050 <I_GetKey@plt>
cmp    $0xd,%eax
je     1178 <CONS_Error+0x48>
mov    $0x0,%al
call   1040 <I_OsPolling@plt>
jmp    115c <CONS_Error+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CONS_Error>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <CONS_Printf@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1030 <CONS_Printf@plt>
xor    %eax,%eax
call   1050 <I_GetKey@plt>
cmp    $0xd,%eax
je     1165 <CONS_Error+0x35>
xor    %eax,%eax
call   1040 <I_OsPolling@plt>
jmp    1150 <CONS_Error+0x20>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\82%s\00"
@.str.1 = [25 x i8] c"Press ENTER to continue\0A\00"
define void @CONS_Error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @CONS_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @CONS_Printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %9, %1
%7 = call i32 (...) @I_GetKey()
%8 = icmp ne i32 %7, 13
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @I_OsPolling()
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\82%s\00"
@.str.1 = [25 x i8] c"Press ENTER to continue\0A\00"
define void @CONS_Error(i8* %0) {
%2 = tail call i32 (i8*, ...) @CONS_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @CONS_Printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @I_GetKey()
%5 = icmp eq i32 %4, 13
br i1 %5, label %10, label %6
6: ; preds = %1, %6
%7 = tail call i32 (...) @I_OsPolling()
%8 = tail call i32 (...) @I_GetKey()
%9 = icmp eq i32 %8, 13
br i1 %9, label %10, label %6
10: ; preds = %6, %1
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *s_calloc(size_t nmemb, size_t lsize) { return calloc(nmemb, lsize); }


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

x86 assembly (clang, -O2):
<s_calloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @s_calloc(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 = call i8* @calloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @s_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ write_port_byte(int, unsigned char);
void set_cursor(int offset) {
  offset /= 2;
  write_port_byte(0x03d4, 0x0f);
  write_port_byte(0x03d5, (unsigned char)offset);
  write_port_byte(0x03d4, 0x0e);
  write_port_byte(0x03d5, (unsigned char)(offset >> 8));
}


x86 assembly (clang, -O0):
<set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <write_port_byte@plt>
mov    -0x4(%rbp),%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <write_port_byte@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <write_port_byte@plt>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <write_port_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cursor>:
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%ebx
add    %edi,%ebx
sar    %ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <write_port_byte@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1030 <write_port_byte@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <write_port_byte@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <write_port_byte@plt>

LLVM IR (-O0):
define void @set_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
store i32 %4, i32* %2
%5 = call i32 @write_port_byte(i32 980, i8 zeroext 15)
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
%8 = call i32 @write_port_byte(i32 981, i8 zeroext %7)
%9 = call i32 @write_port_byte(i32 980, i8 zeroext 14)
%10 = load i32, i32* %2
%11 = ashr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = call i32 @write_port_byte(i32 981, i8 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @set_cursor(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = tail call i32 @write_port_byte(i32 980, i8 zeroext 15)
%4 = trunc i32 %2 to i8
%5 = tail call i32 @write_port_byte(i32 981, i8 zeroext %4)
%6 = tail call i32 @write_port_byte(i32 980, i8 zeroext 14)
%7 = lshr i32 %2, 8
%8 = trunc i32 %7 to i8
%9 = tail call i32 @write_port_byte(i32 981, i8 zeroext %8)
ret void
}
int findPosition(int arr[], int N, int key) {
  int pos;
  for (pos = 0; pos < N; pos++)
    if (arr[pos] == key)
      return pos;
  return -1;
}


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

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

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

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


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

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

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

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

/* Variables and functions */
void io_reg_atomic_clear(volatile uint32_t *reg, uint32_t mask) {
  *((volatile uint32_t *)(((uintptr_t)(reg)) | (0x3000U))) = mask;
}


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

x86 assembly (clang, -O2):
<io_reg_atomic_clear>:
or     $0x3000,%rdi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @io_reg_atomic_clear(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = ptrtoint i32* %6 to i64
%8 = or i64 %7, 12288
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @io_reg_atomic_clear(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = or i64 %3, 12288
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Variables and functions */
int set_user_upload(char const *, int, char const *, int, int, char **);
int rpc_disable_user(const char *ip, int port, const char *user, int timeout,
                     char **err) {
  return set_user_upload(ip, port, user, 1, timeout, err);
}


x86 assembly (clang, -O0):
<rpc_disable_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    $0x1,%ecx
call   1030 <set_user_upload@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpc_disable_user>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    $0x1,%ecx
jmp    1030 <set_user_upload@plt>

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

LLVM IR (-O2):
define i32 @rpc_disable_user(i8* %0, i32 %1, i8* %2, i32 %3, i8** %4) {
%6 = tail call i32 @set_user_upload(i8* %0, i32 %1, i8* %2, i32 1, i32 %3, i8** %4)
ret i32 %6
}
int test_imm_78int16_mem(short *val) {
  return ((*val) & (-0x78 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_78int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff88,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_78int16_mem>:
movzwl (%rdi),%eax
test   $0xff88,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_78int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -120
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _Exit(int /*<<< orphan*/);
int /*<<< orphan*/ cleanup();
void cleanup_signal(int unused) {
  (void)unused;
  cleanup();
  _Exit(0);
}


x86 assembly (clang, -O0):
<cleanup_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <cleanup@plt>
xor    %edi,%edi
call   1040 <_Exit@plt>

x86 assembly (clang, -O2):
<cleanup_signal>:
push   %rax
xor    %eax,%eax
call   1030 <cleanup@plt>
xor    %edi,%edi
call   1040 <_Exit@plt>

LLVM IR (-O0):
define void @cleanup_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @cleanup()
%5 = call i32 @_Exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @cleanup_signal(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = tail call i32 @_Exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *LefNextToken(int /*<<< orphan*/ *, int);
void LefEndStatement(FILE *f) {
  char *token;
  while ((token = LefNextToken(f, 1)) != NULL)
    if (*token == ';')
      break;
}


x86 assembly (clang, -O0):
<LefEndStatement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <LefNextToken@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1152 <LefEndStatement+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    114d <LefEndStatement+0x3d>
jmp    1152 <LefEndStatement+0x42>
jmp    111c <LefEndStatement+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LefEndStatement>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <LefNextToken@plt>
test   %rax,%rax
je     1137 <LefEndStatement+0x27>
cmpb   $0x3b,(%rax)
jne    1120 <LefEndStatement+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @LefEndStatement(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i8* @LefNextToken(i32* %5, i32 1)
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 59
br i1 %12, label %13, label %14
13: ; preds = %8
br label %15
14: ; preds = %8
br label %4
15: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
define void @LefEndStatement(i32* %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i8* @LefNextToken(i32* %0, i32 1)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 59
br i1 %7, label %8, label %2
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ allocator_counted_init(int /*<<< orphan*/,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ allocator_default();
void _ensure_allocator_counted_init_copes_with_null_allocator(void) {
  allocator_counted_init(0, allocator_default());
}


x86 assembly (clang, -O0):
<_ensure_allocator_counted_init_copes_with_null_allocator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <allocator_default@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <allocator_counted_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_allocator_counted_init_copes_with_null_allocator>:
push   %rax
xor    %eax,%eax
call   1030 <allocator_default@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <allocator_counted_init@plt>

LLVM IR (-O0):
define void @_ensure_allocator_counted_init_copes_with_null_allocator() {
%1 = call i32 (...) @allocator_default()
%2 = call i32 @allocator_counted_init(i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
define void @_ensure_allocator_counted_init_copes_with_null_allocator() {
%1 = tail call i32 (...) @allocator_default()
%2 = tail call i32 @allocator_counted_init(i32 0, i32 %1)
ret void
}
char TestZ() {
  char r;
  __asm__("cmp $1, %1" : "=@ccz"(r) : "r"(1));
  if (r) {
    __asm__("cmp $2, %1" : "=@ccnz"(r) : "r"(1));
    if (r)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<TestZ>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
cmp    $0x1,%eax
sete   %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1142 <TestZ+0x42>
mov    $0x1,%eax
cmp    $0x2,%eax
setne  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     113d <TestZ+0x3d>
movb   $0x1,-0x1(%rbp)
jmp    1146 <TestZ+0x46>
jmp    1142 <TestZ+0x42>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestZ>:
mov    $0x1,%eax
cmp    $0x1,%eax
jne    1112 <TestZ+0x12>
cmp    $0x2,%eax
mov    $0x1,%al
je     1112 <TestZ+0x12>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @TestZ() {
%1 = alloca i8
%2 = alloca i8
%3 = call i8 asm "cmp $$1, $1", "={@ccz},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = call i8 asm "cmp $$2, $1", "={@ccnz},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 1, i8* %1
br label %13
11: ; preds = %6
br label %12
12: ; preds = %11, %0
store i8 0, i8* %1
br label %13
13: ; preds = %12, %10
%14 = load i8, i8* %1
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @TestZ() {
%1 = tail call i8 asm "cmp $$1, $1", "={@ccz},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%2 = icmp eq i8 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i8 asm "cmp $$2, $1", "={@ccnz},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i8 [ 0, %6 ], [ 1, %3 ]
ret i8 %8
}
int comp(const void *a, const void *b) {
  const int *p1 = (const int *)a;
  const int *p2 = (const int *)b;
  if (*p1 < *p2)
    return -1;
  else if (*p1 == *p2)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <comp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <comp+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    1158 <comp+0x58>
movl   $0x0,-0x4(%rbp)
jmp    115f <comp+0x5f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp ne i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_client(struct client *);
int /*<<< orphan*/ free(struct client *);
void free_client(struct client *cl) {
  clear_client(cl);
  free(cl);
}


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

x86 assembly (clang, -O2):
<free_client>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_client@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.client = type { i32 }
define void @free_client(%struct.client* %0) {
%2 = alloca %struct.client*
store %struct.client* %0, %struct.client** %2
%3 = load %struct.client*, %struct.client** %2
%4 = call i32 @clear_client(%struct.client* %3)
%5 = load %struct.client*, %struct.client** %2
%6 = call i32 @free(%struct.client* %5)
ret void
}

LLVM IR (-O2):
%struct.client = type { i32 }
define void @free_client(%struct.client* %0) {
%2 = tail call i32 @clear_client(%struct.client* %0)
%3 = tail call i32 @free(%struct.client* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
struct TYPE_2__ {
  int /*<<< orphan*/ window;
  int /*<<< orphan*/ event;
};
typedef TYPE_1__ XDestroyWindowEvent;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void do_DestroyNotify(FILE *out_f, XEvent *eventp) {
  XDestroyWindowEvent *e = (XDestroyWindowEvent *)eventp;
  fprintf(out_f, "    event 0x%lx, window 0x%lx\n", e->event, e->window);
}


x86 assembly (clang, -O0):
<do_DestroyNotify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_DestroyNotify>:
mov    (%rsi),%ecx
mov    0x4(%rsi),%edx
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32, i32 }
@.str = [31 x i8] c" event 0x%lx, window 0x%lx\0A\00"
define void @do_DestroyNotify(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.TYPE_2__*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = bitcast i32* %6 to %struct.TYPE_2__*
store %struct.TYPE_2__* %7, %struct.TYPE_2__** %5
%8 = load i32*, i32** %3
%9 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%10 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%13 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c" event 0x%lx, window 0x%lx\0A\00"
define void @do_DestroyNotify(i32* nocapture %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = load i32, i32* %3
%5 = load i32, i32* %1
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cnfImprt(char *const, int, char *);
int /*<<< orphan*/ msgSetd(char *, double);
int /*<<< orphan*/ starFree(char *);
char *starMallocAtomic(int);
void msg_setd_(char *const TOKEN, double *const DVALUE, int TOKEN_length) {
  double dvalue;
  char *token;
  ;
  dvalue = *DVALUE;
  token = starMallocAtomic(TOKEN_length + 1);
  cnfImprt(TOKEN, TOKEN_length, token);
  msgSetd(token, dvalue);
  starFree(token);
}


x86 assembly (clang, -O0):
<msg_setd_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <starMallocAtomic@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1060 <cnfImprt@plt>
mov    -0x28(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <msgSetd@plt>
mov    -0x28(%rbp),%rdi
call   1030 <starFree@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_setd_>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r15d
mov    %rdi,%r14
movsd  (%rsi),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x1(%r15),%edi
call   1050 <starMallocAtomic@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rax,%rdx
call   1060 <cnfImprt@plt>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <msgSetd@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <starFree@plt>

LLVM IR (-O0):
define void @msg_setd_(i8* %0, double* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca double*
%6 = alloca i32
%7 = alloca double
%8 = alloca i8*
store i8* %0, i8** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %5
%10 = load double, double* %9
store double %10, double* %7
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
%13 = call i8* @starMallocAtomic(i32 %12)
store i8* %13, i8** %8
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = load i8*, i8** %8
%17 = call i32 @cnfImprt(i8* %14, i32 %15, i8* %16)
%18 = load i8*, i8** %8
%19 = load double, double* %7
%20 = call i32 @msgSetd(i8* %18, double %19)
%21 = load i8*, i8** %8
%22 = call i32 @starFree(i8* %21)
ret void
}

LLVM IR (-O2):
define void @msg_setd_(i8* %0, double* nocapture %1, i32 %2) {
%4 = load double, double* %1
%5 = add nsw i32 %2, 1
%6 = tail call i8* @starMallocAtomic(i32 %5)
%7 = tail call i32 @cnfImprt(i8* %0, i32 %2, i8* %6)
%8 = tail call i32 @msgSetd(i8* %6, double %4)
%9 = tail call i32 @starFree(i8* %6)
ret void
}
void test_safelen_simdlen() {
  int i;
#pragma omp parallel for simd simdlen(6) safelen(5)
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel for simd safelen(5) simdlen(6)
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_safelen_simdlen>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_safelen_simdlen+0x28>
jmp    111a <test_safelen_simdlen+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_safelen_simdlen+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_safelen_simdlen+0x4c>
jmp    113e <test_safelen_simdlen+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_safelen_simdlen+0x2f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_safelen_simdlen() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct xc_die {
  int dummy;
};

/* Variables and functions */
uint32_t xc6_get_frame_start(const struct xc_die *die) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.xc_die = type { i32 }
define i32 @xc6_get_frame_start(%struct.xc_die* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RamReadA(int, unsigned short *);
int /*<<< orphan*/ RamWriteA(int, unsigned short);
void AfSrvCurPos(void) {
  unsigned short UsRamDat;
  RamReadA(0x1502, &UsRamDat);
  UsRamDat = (unsigned)((signed)UsRamDat * (signed)(-1));
  RamWriteA(0x151F, UsRamDat);
  RamWriteA(0x1513, UsRamDat);
}


x86 assembly (clang, -O0):
<AfSrvCurPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1502,%edi
lea    -0x2(%rbp),%rsi
call   1040 <RamReadA@plt>
movzwl -0x2(%rbp),%eax
imul   $0xffffffff,%eax,%eax
mov    %ax,-0x2(%rbp)
mov    $0x151f,%edi
movzwl -0x2(%rbp),%esi
call   1030 <RamWriteA@plt>
mov    $0x1513,%edi
movzwl -0x2(%rbp),%esi
call   1030 <RamWriteA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AfSrvCurPos>:
push   %rax
lea    0x6(%rsp),%rsi
mov    $0x1502,%edi
call   1040 <RamReadA@plt>
xor    %eax,%eax
sub    0x6(%rsp),%ax
mov    %ax,0x6(%rsp)
movzwl %ax,%esi
mov    $0x151f,%edi
call   1030 <RamWriteA@plt>
movzwl 0x6(%rsp),%esi
mov    $0x1513,%edi
call   1030 <RamWriteA@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @AfSrvCurPos() {
%1 = alloca i16
%2 = call i32 @RamReadA(i32 5378, i16* %1)
%3 = load i16, i16* %1
%4 = zext i16 %3 to i32
%5 = mul nsw i32 %4, -1
%6 = trunc i32 %5 to i16
store i16 %6, i16* %1
%7 = load i16, i16* %1
%8 = call i32 @RamWriteA(i32 5407, i16 zeroext %7)
%9 = load i16, i16* %1
%10 = call i32 @RamWriteA(i32 5395, i16 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @AfSrvCurPos() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = call i32 @RamReadA(i32 5378, i16* %1)
%4 = load i16, i16* %1
%5 = sub i16 0, %4
store i16 %5, i16* %1
%6 = call i32 @RamWriteA(i32 5407, i16 zeroext %5)
%7 = load i16, i16* %1
%8 = call i32 @RamWriteA(i32 5395, i16 zeroext %7)
ret void
}
void foo7d() {}


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

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

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

LLVM IR (-O2):
define void @foo7d() {
ret void
}
short prog_q168sub(short A, short B) {
  int C = ((int)A) - ((int)B);
  if (C > 32767) {
    C = 32767;
  } else if (C < -32768) {
    C = -32768;
  }
  return (short)C;
}


x86 assembly (clang, -O0):
<prog_q168sub>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x7fff,-0x8(%rbp)
jle    1138 <prog_q168sub+0x38>
movl   $0x7fff,-0x8(%rbp)
jmp    1151 <prog_q168sub+0x51>
cmpl   $0xffff8000,-0x8(%rbp)
jge    114c <prog_q168sub+0x4c>
movl   $0xffff8000,-0x8(%rbp)
jmp    1151 <prog_q168sub+0x51>
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_q168sub>:
xor    %eax,%eax
cmp    %si,%di
setns  %al
add    $0x7fff,%eax
sub    %si,%di
cmovno %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @prog_q168sub(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = load i16, i16* %4
%9 = sext i16 %8 to i32
%10 = sub nsw i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 32767
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 32767, i32* %5
br label %19
14: ; preds = %2
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, -32768
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 -32768, i32* %5
br label %18
18: ; preds = %17, %14
br label %19
19: ; preds = %18, %13
%20 = load i32, i32* %5
%21 = trunc i32 %20 to i16
ret i16 %21
}

LLVM IR (-O2):
define signext i16 @prog_q168sub(i16 signext %0, i16 signext %1) {
%3 = tail call i16 @llvm.ssub.sat.i16(i16 %0, i16 %1)
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char **, char **, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char src[1] = {'a'};
  char dest[1] = {'b'};
  memcpy(&dest, &src, 0);
  printf("%c %c\n", src[0], dest[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x1(%rbp),%rsi
xor    %edx,%edx
call   1040 <memcpy@plt>
mov    -0x1(%rbp),%al
lea    0xeaf(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x61,0x7(%rsp)
movb   $0x62,0x6(%rsp)
lea    0x6(%rsp),%rdi
lea    0x7(%rsp),%rsi
xor    %edx,%edx
call   1040 <memcpy@plt>
movsbl 0x7(%rsp),%esi
movsbl 0x6(%rsp),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.src = [1 x i8] c"a"
@__const.main.dest = [1 x i8] c"b"
@.str = [7 x i8] c"%c %c\0A\00"
define i32 @main() {
%1 = alloca [1 x i8]
%2 = alloca [1 x i8]
%3 = bitcast [1 x i8]* %1 to i8*
%4 = bitcast [1 x i8]* %2 to i8*
%5 = bitcast [1 x i8]* %2 to i8**
%6 = bitcast [1 x i8]* %1 to i8**
%7 = call i32 @memcpy(i8** %5, i8** %6, i32 0)
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%9 = load i8, i8* %8
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %9, i8 signext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c %c\0A\00"
define i32 @main() {
%1 = alloca [1 x i8]
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 97, i8* %3
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 98, i8* %4
%5 = bitcast [1 x i8]* %2 to i8**
%6 = bitcast [1 x i8]* %1 to i8**
%7 = call i32 @memcpy(i8** %5, i8** %6, i32 0)
%8 = load i8, i8* %3
%9 = load i8, i8* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 signext %9)
ret i32 0
}
/* Variables and functions */
int length_str(char *);
int main() {
  if (length_str("foo") == 3)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <length_str@plt>
cmp    $0x3,%eax
jne    1140 <main+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1147 <main+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <length_str@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @length_str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 3
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = tail call i32 @length_str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%.11f\n", 8.0 / 5.0);
  printf("test1 %.22f\n", 8.0 / 5.0);
  printf("test2 %.11f\n", 8 / 5);
  printf("test3 %d\n", 8 / 5);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefb(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%.11f\0A\00"
@.str.1 = [13 x i8] c"test1 %.22f\0A\00"
@.str.2 = [13 x i8] c"test2 %.11f\0A\00"
@.str.3 = [10 x i8] c"test3 %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.11f\0A\00"
@.str.1 = [13 x i8] c"test1 %.22f\0A\00"
@.str.2 = [13 x i8] c"test2 %.11f\0A\00"
@.str.3 = [10 x i8] c"test3 %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}
int XBitmapUnit() {}


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

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

LLVM IR (-O0):
define i32 @XBitmapUnit() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XBitmapUnit() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ size(int **);
int main() {
  int arr[10][10];
  size(arr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
call   1030 <size@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
mov    %rsp,%rdi
call   1030 <size@plt>
xor    %eax,%eax
add    $0x198,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i32]]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 0
%4 = bitcast [10 x i32]* %3 to i32**
%5 = call i32 @size(i32** %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x [10 x i32]]
%2 = bitcast [10 x [10 x i32]]* %1 to i8*
%3 = bitcast [10 x [10 x i32]]* %1 to i32**
%4 = call i32 @size(i32** %3)
ret i32 0
}