xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void sort(int A[], int start, int end) {
  if (start < end) {
    int mid = (start + end) / 2;
    sort(A, start, mid);
    sort(A, mid + 1, end);
    merge(A, start, mid, end);
  }
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <sort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    %edx,%esi
jge    1172 <sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <sort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <sort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

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

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @sort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @sort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int create_socket(struct in_addr *, int);
int /*<<< orphan*/ inet_aton(char *, struct in_addr *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ send_frames(int);
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  struct in_addr remote_ip;
  inet_aton("172.16.50.1", &remote_ip);
  int mySocket = create_socket(&remote_ip, 2000);
  send_frames(mySocket);
  printf("Sender finished\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <inet_aton@plt>
lea    -0x18(%rbp),%rdi
mov    $0x7d0,%esi
call   1060 <create_socket@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <send_frames@plt>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <inet_aton@plt>
mov    %rbx,%rdi
mov    $0x7d0,%esi
call   1060 <create_socket@plt>
mov    %eax,%edi
call   1040 <send_frames@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [12 x i8] c"172.16.50.1\00"
@.str.1 = [17 x i8] c"Sender finished\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.in_addr
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = call i32 @inet_aton(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.in_addr* %5)
%10 = call i32 @create_socket(%struct.in_addr* %5, i32 2000)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @send_frames(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@.str = [12 x i8] c"172.16.50.1\00"
@str = [16 x i8] c"Sender finished\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.in_addr
%4 = bitcast %struct.in_addr* %3 to i8*
%5 = call i32 @inet_aton(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.in_addr* %3)
%6 = call i32 @create_socket(%struct.in_addr* %3, i32 2000)
%7 = call i32 @send_frames(i32 %6)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int mod(int x, int y) { return x % y; }


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

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int mult(int x, int y) {
  int z;
  z = x * y;
  return z;
}


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

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

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

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ strlen(char *);
char tolower(char);
char *strlow(char *ioString) {
  int i;
  int theLength = (int)strlen(ioString);
  for (i = 0; i < theLength; ++i) {
    ioString[i] = tolower(ioString[i]);
  }
  return ioString;
}


x86 assembly (clang, -O0):
<strlow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1177 <strlow+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <strlow+0x1f>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlow>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <strlow+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <strlow+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strlow(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = and i64 %2, 4294967295
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call signext i8 @tolower(i8 signext %10)
store i8 %11, i8* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret i8* %0
}
void lgtd_lifx_wire_encode_waveform(struct lgtd_lifx_packet_waveform *pkt) {
  (void)pkt;
}


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

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

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

LLVM IR (-O2):
%struct.lgtd_lifx_packet_waveform = type opaque
define void @lgtd_lifx_wire_encode_waveform(%struct.lgtd_lifx_packet_waveform* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ evil_exception(char *, int);
int /*<<< orphan*/ finish_exception();
void do_undefined_instruction(void) {
  evil_exception("undefined instruction", 1);
  finish_exception();
}


x86 assembly (clang, -O0):
<do_undefined_instruction>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
call   1030 <evil_exception@plt>
mov    $0x0,%al
call   1040 <finish_exception@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_undefined_instruction>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
call   1030 <evil_exception@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <finish_exception@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"undefined instruction\00"
define void @do_undefined_instruction() {
%1 = call i32 @evil_exception(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 (...) @finish_exception()
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"undefined instruction\00"
define void @do_undefined_instruction() {
%1 = tail call i32 @evil_exception(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (...) @finish_exception()
ret void
}
/* Variables and functions */
int arg_const_int(int const, int const);
int use_arg_const_int(const int i, const int j) { return arg_const_int(i, j); }


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

x86 assembly (clang, -O2):
<use_arg_const_int>:
jmp    1030 <arg_const_int@plt>

LLVM IR (-O0):
define i32 @use_arg_const_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @arg_const_int(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @use_arg_const_int(i32 %0, i32 %1) {
%3 = tail call i32 @arg_const_int(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 3;
  if (a == 3) {
    int b = 4;
    goto fail;
  }
fail:
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    113c <main+0x2c>
movl   $0x4,-0xc(%rbp)
jmp    1141 <main+0x31>
jmp    1141 <main+0x31>
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
char *malloc(int);
char *copyState(int size, const char *srcstate) {
  int length = size * size;
  char *state = malloc(sizeof(char) * length);
  int ind;
  for (ind = 0; ind < length; ind++) {
    state[ind] = srcstate[ind];
  }
  return state;
}


x86 assembly (clang, -O0):
<copyState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1173 <copyState+0x63>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1143 <copyState+0x33>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyState>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
imul   %edi,%ebp
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
je     1147 <copyState+0x27>
mov    %ebp,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @copyState(i32 %0, i8* nocapture %1) {
%3 = mul nsw i32 %0, %0
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ halt(char *, char *);
FILE *open_file(char *file_name, char *mode) {
  FILE *tmp;
  if ((tmp = fopen(file_name, mode)) == NULL)
    halt("Can't open '%s'.", (char *)file_name);
  return (tmp);
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115b <open_file+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <halt@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <open_file+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <halt@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Can't open '%s'.\00"
define i32* @open_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %2
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
@.str = [17 x i8] c"Can't open '%s'.\00"
define noalias i32* @open_file(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int __original_openat64(int, char const *, int, int /*<<< orphan*/);
int openat64(int dirfd, const char *pathname, int flags, mode_t mode) {
  int ret = 0;
  ret = __original_openat64(dirfd, pathname, flags, mode);
  return ret;
}


x86 assembly (clang, -O0):
<openat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <__original_openat64@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openat64>:
jmp    1030 <__original_openat64@plt>

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

LLVM IR (-O2):
define i32 @openat64(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @__original_openat64(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
int ft_toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return ((c - 'a') + 'A');
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <ft_toupper+0x2c>
cmpl   $0x7a,-0x8(%rbp)
jg     112c <ft_toupper+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <ft_toupper+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void lcm_init_power(void) {}


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

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

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

LLVM IR (-O2):
define void @lcm_init_power() {
ret void
}
int test_imm_BFint8_reg(signed char val) {
  return ((val) & (0xBF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BFint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xbf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BFint8_reg>:
test   $0xbf,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BFint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 191
%6 = icmp ne i32 %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_BFint8_reg(i8 signext %0) {
%2 = and i8 %0, -65
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
short readInt16(FILE *f) {
  short v = 0;
  v |= fgetc(f);
  v |= fgetc(f) << 8;
  return v;
}


x86 assembly (clang, -O0):
<readInt16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
movswl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
shl    $0x8,%ecx
movswl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt16>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i16 @readInt16(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
store i32* %0, i32** %2
store i16 0, i16* %3
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = or i32 %7, %5
%9 = trunc i32 %8 to i16
store i16 %9, i16* %3
%10 = load i32*, i32** %2
%11 = call i32 @fgetc(i32* %10)
%12 = shl i32 %11, 8
%13 = load i16, i16* %3
%14 = sext i16 %13 to i32
%15 = or i32 %14, %12
%16 = trunc i32 %15 to i16
store i16 %16, i16* %3
%17 = load i16, i16* %3
ret i16 %17
}

LLVM IR (-O2):
define signext i16 @readInt16(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = trunc i32 %5 to i16
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int fs_mkfile(char *parameter) {
  fprintf(stderr, "mkfile: UNDER DEVELOPMENT\n");
}


x86 assembly (clang, -O0):
<fs_mkfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_mkfile>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"mkfile: UNDER DEVELOPMENT\0A\00"
define i32 @fs_mkfile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"mkfile: UNDER DEVELOPMENT\0A\00"
define i32 @fs_mkfile(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test3u(unsigned int x) { return ~(x - (unsigned int)INT_MIN); }


x86 assembly (clang, -O0):
<test3u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%rcx
sub    %ecx,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
not    %eax
add    (%rcx),%eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test3u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i64, i64* @INT_MIN
%5 = trunc i64 %4 to i32
%6 = sub i32 %3, %5
%7 = xor i32 %6, -1
ret i32 %7
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test3u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = xor i32 %0, -1
%5 = add i32 %3, %4
ret i32 %5
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFMT;
int S_IFREG;
int file_regular(const struct stat *stat) {
  return (stat->st_mode & S_IFMT) != S_IFREG;
}


x86 assembly (clang, -O0):
<file_regular>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ec3(%rip),%rcx
and    (%rcx),%eax
mov    0x2eca(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_regular>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
and    (%rdi),%ecx
mov    0x2ed6(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%ecx
setne  %al
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFMT = global i32 0
@S_IFREG = global i32 0
define i32 @file_regular(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @S_IFMT
%7 = and i32 %5, %6
%8 = load i32, i32* @S_IFREG
%9 = icmp ne i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFMT = global i32 0
@S_IFREG = global i32 0
define i32 @file_regular(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @S_IFMT
%5 = and i32 %4, %3
%6 = load i32, i32* @S_IFREG
%7 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
char *ft_strchr(const char *s, int c) {
  while (*s) {
    if (c == *s)
      return ((char *)s);
    ++s;
  }
  if (c == *s)
    return ((char *)s);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <ft_strchr+0x48>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1137 <ft_strchr+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <ft_strchr+0x6f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <ft_strchr+0xb>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1167 <ft_strchr+0x67>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <ft_strchr+0x6f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strchr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <ft_strchr+0x23>
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     112b <ft_strchr+0x2b>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <ft_strchr+0x10>
xor    %ecx,%ecx
test   %esi,%esi
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @ft_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %18, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ]
%16 = icmp eq i32 %1, 0
%17 = select i1 %16, i8* %15, i8* null
br label %18
18: ; preds = %5, %14
%19 = phi i8* [ %17, %14 ], [ %7, %5 ]
ret i8* %19
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void s3d_print(const char *s) { fputs(s, stdout); }


x86 assembly (clang, -O0):
<s3d_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s3d_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @s3d_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @s3d_print(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EMU_init();
int /*<<< orphan*/ EMU_run(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  (void)printf("Main called\n");
  EMU_init();
  EMU_run("testPath");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <EMU_init@plt>
lea    0xebf(%rip),%rdi
call   1050 <EMU_run@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <EMU_init@plt>
lea    0xeb5(%rip),%rdi
call   1050 <EMU_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Main called\0A\00"
@.str.1 = [9 x i8] c"testPath\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @EMU_init()
%3 = call i32 @EMU_run(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"testPath\00"
@str = [12 x i8] c"Main called\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @EMU_init()
%3 = tail call i32 @EMU_run(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void spmd(void) {
#pragma omp target teams
#pragma omp parallel
  {}
#pragma omp target teams distribute parallel for
  for (int i = 0; i < 100; ++i) {
  }
}


x86 assembly (clang, -O0):
<spmd>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1128 <spmd+0x28>
jmp    111a <spmd+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <spmd+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @spmd() {
%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, 100
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
ret void
}

LLVM IR (-O2):
define void @spmd() {
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_numericdef1(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_numericdef1() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_numericdef1() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Type definitions */
struct fmt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fmtputc(struct fmt *, int /*<<< orphan*/);
void fmtputs(struct fmt *fmt, char *s) {
  while (*s)
    fmtputc(fmt, *s++);
}


x86 assembly (clang, -O0):
<fmtputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <fmtputs+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <fmtputc@plt>
jmp    1120 <fmtputs+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmtputs>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1146 <fmtputs+0x36>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <fmtputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <fmtputs+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.fmt = type { i32 }
define void @fmtputs(%struct.fmt* %0, i8* %1) {
%3 = alloca %struct.fmt*
%4 = alloca i8*
store %struct.fmt* %0, %struct.fmt** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load %struct.fmt*, %struct.fmt** %3
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = call i32 @fmtputc(%struct.fmt* %10, i32 %14)
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.fmt = type { i32 }
define void @fmtputs(%struct.fmt* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @fmtputc(%struct.fmt* %0, i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memory_Free(char *, int);
char *string_StringCopy(char *);
int strlen(char *);
char *dfg_StripQuotes(char *str) {
  char *newstr;
  int len = strlen(str);
  str[len - 1] = '\0';
  newstr = string_StringCopy(str + 1);
  memory_Free(str, len + 1);
  return newstr;
}


x86 assembly (clang, -O0):
<dfg_StripQuotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1050 <string_StringCopy@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1030 <memory_Free@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfg_StripQuotes>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
movslq %eax,%rbx
movb   $0x0,-0x1(%rbx,%r14,1)
lea    0x1(%r14),%rdi
call   1050 <string_StringCopy@plt>
mov    %rax,%r15
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <memory_Free@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @dfg_StripQuotes(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i8*, i8** %2
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = call i8* @string_StringCopy(i8* %13)
store i8* %14, i8** %3
%15 = load i8*, i8** %2
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
%18 = call i32 @memory_Free(i8* %15, i32 %17)
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @dfg_StripQuotes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i8* @string_StringCopy(i8* %6)
%8 = add nsw i32 %2, 1
%9 = tail call i32 @memory_Free(i8* %0, i32 %8)
ret i8* %7
}
double radius_effective(int mode, double radius, double fuzziness) {
  switch (mode) {
  default:
  case 1:
    return radius;
  case 2:
    return radius + fuzziness;
  }
}


x86 assembly (clang, -O0):
<radius_effective>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x1,%eax
je     113b <radius_effective+0x3b>
jmp    1125 <radius_effective+0x25>
mov    -0x24(%rbp),%eax
sub    $0x2,%eax
je     114a <radius_effective+0x4a>
jmp    1136 <radius_effective+0x36>
jmp    113b <radius_effective+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1159 <radius_effective+0x59>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_effective>:
cmp    $0x2,%edi
je     110d <radius_effective+0xd>
movsd  0xef3(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @radius_effective(i32 %0, double %1, double %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
%8 = load i32, i32* %5
switch i32 %8, label %9 [
i32 1, label %10
i32 2, label %12
]
9: ; preds = %3
br label %10
10: ; preds = %3, %9
%11 = load double, double* %6
store double %11, double* %4
br label %16
12: ; preds = %3
%13 = load double, double* %6
%14 = load double, double* %7
%15 = fadd double %13, %14
store double %15, double* %4
br label %16
16: ; preds = %12, %10
%17 = load double, double* %4
ret double %17
}

LLVM IR (-O2):
define double @radius_effective(i32 %0, double %1, double %2) {
%4 = icmp eq i32 %0, 2
%5 = select i1 %4, double %2, double -0.000000e+00
%6 = fadd double %5, %1
ret double %6
}
int main() {
  char a[3][4];
  a[0][0] = 'A';
  a[0][1] = 'B';
  a[0][2] = 'C';
  a[0][3] = 'E';
  a[1][0] = 'S';
  a[1][1] = 'F';
  a[1][2] = 'C';
  a[1][3] = 'S';
  a[2][0] = 'A';
  a[2][1] = 'D';
  a[2][2] = 'E';
  a[2][3] = 'E';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x10(%rbp)
movb   $0x42,-0xf(%rbp)
movb   $0x43,-0xe(%rbp)
movb   $0x45,-0xd(%rbp)
movb   $0x53,-0xc(%rbp)
movb   $0x46,-0xb(%rbp)
movb   $0x43,-0xa(%rbp)
movb   $0x53,-0x9(%rbp)
movb   $0x41,-0x8(%rbp)
movb   $0x44,-0x7(%rbp)
movb   $0x45,-0x6(%rbp)
movb   $0x45,-0x5(%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 [3 x [4 x i8]]
store i32 0, i32* %1
%3 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 0
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 65, i8* %4
%5 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 66, i8* %6
%7 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 0
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 2
store i8 67, i8* %8
%9 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 0
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 3
store i8 69, i8* %10
%11 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 1
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
store i8 83, i8* %12
%13 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 1
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 1
store i8 70, i8* %14
%15 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 1
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 2
store i8 67, i8* %16
%17 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 1
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %17, i64 0, i64 3
store i8 83, i8* %18
%19 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 2
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %19, i64 0, i64 0
store i8 65, i8* %20
%21 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 2
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %21, i64 0, i64 1
store i8 68, i8* %22
%23 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 2
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %23, i64 0, i64 2
store i8 69, i8* %24
%25 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %2, i64 0, i64 2
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %25, i64 0, i64 3
store i8 69, i8* %26
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int default_mpgdecoder_volume_set(void *ctx, int lvol, int rvol) { return -1; }


x86 assembly (clang, -O0):
<default_mpgdecoder_volume_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @default_mpgdecoder_volume_set(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @default_mpgdecoder_volume_set(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
main(void) {}


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

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

LLVM IR (-O0):
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct dns_server {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dns_server *);
void dns_server_destroy(struct dns_server *srv) { free(srv); }


x86 assembly (clang, -O0):
<dns_server_destroy>:
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):
<dns_server_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.dns_server = type { i32 }
define void @dns_server_destroy(%struct.dns_server* nocapture %0) {
%2 = tail call i32 @free(%struct.dns_server* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int rat_mod_generic_set_val_zero8(const char *argv, uint8_t *data,
                                  uint16_t len) {
  do {
  } while (0);
  if (!argv || !data || len < sizeof(uint8_t))
    return -1;
  *((uint8_t *)data) = 0;
  return 0;
}


x86 assembly (clang, -O0):
<rat_mod_generic_set_val_zero8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
jmp    1114 <rat_mod_generic_set_val_zero8+0x14>
cmpq   $0x0,-0x10(%rbp)
je     1138 <rat_mod_generic_set_val_zero8+0x38>
cmpq   $0x0,-0x18(%rbp)
je     1138 <rat_mod_generic_set_val_zero8+0x38>
movslq -0x1c(%rbp),%rax
cmp    $0x8,%rax
jae    1144 <rat_mod_generic_set_val_zero8+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <rat_mod_generic_set_val_zero8+0x56>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rat_mod_generic_set_val_zero8>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111d <rat_mod_generic_set_val_zero8+0x1d>
test   %rsi,%rsi
je     111d <rat_mod_generic_set_val_zero8+0x1d>
cmp    $0x8,%edx
jb     111d <rat_mod_generic_set_val_zero8+0x1d>
movq   $0x0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rat_mod_generic_set_val_zero8(i8* readnone %0, i64* writeonly %1, i32 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i64* %1, null
%6 = or i1 %4, %5
%7 = icmp ult i32 %2, 8
%8 = or i1 %6, %7
br i1 %8, label %10, label %9
9: ; preds = %3
store i64 0, i64* %1
br label %10
10: ; preds = %3, %9
%11 = phi i32 [ 0, %9 ], [ -1, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int volatile uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t USBLPMLinkStateGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint16_t *)(ui32Base + 0x00000360))) & 0x0000000F);
}


x86 assembly (clang, -O0):
<USBLPMLinkStateGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x360,%eax
cltq
mov    (%rax),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBLPMLinkStateGet>:
mov    %edi,-0x4(%rsp)
movslq -0x4(%rsp),%rax
mov    0x360(%rax),%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @USBLPMLinkStateGet(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = add nsw i32 %3, 864
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 15
ret i32 %8
}

LLVM IR (-O2):
define i32 @USBLPMLinkStateGet(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = add nsw i32 %3, 864
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 15
ret i32 %8
}