xunge/DecIR huggingface dataset:
/* Type definitions */
struct pt_image {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pt_image *);
int /*<<< orphan*/ pt_image_fini(struct pt_image *);
void pt_image_free(struct pt_image *image) {
  pt_image_fini(image);
  free(image);
}


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

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

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

LLVM IR (-O2):
%struct.pt_image = type { i32 }
define void @pt_image_free(%struct.pt_image* %0) {
%2 = tail call i32 @pt_image_fini(%struct.pt_image* %0)
%3 = tail call i32 @free(%struct.pt_image* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Name                   : Mi nombre \n");
  printf("Fecha de nacimiento    : Julio 14, 1999\n");
  printf("Celular                : 555-5555-5555 \n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
lea    0xf10(%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
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Name : Mi nombre \0A\00"
@.str.1 = [41 x i8] c"Fecha de nacimiento : Julio 14, 1999\0A\00"
@.str.2 = [41 x i8] c"Celular : 555-5555-5555 \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [36 x i8] c"Name : Mi nombre \00"
@str.3 = [40 x i8] c"Fecha de nacimiento : Julio 14, 1999\00"
@str.4 = [40 x i8] c"Celular : 555-5555-5555 \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int fseekeol(int);
int to_line(int cp) {
  int tdx, line;
  tdx = 0;
  line = 0;
  while (tdx <= cp) {
    tdx = 1 + fseekeol(tdx);
    line++;
  }
  return (line);
}


x86 assembly (clang, -O0):
<to_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1151 <to_line+0x41>
mov    -0x8(%rbp),%edi
call   1030 <fseekeol@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <to_line+0x19>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_line>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1131 <to_line+0x21>
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %edi,%edi
nopl   (%rax)
call   1030 <fseekeol@plt>
lea    0x1(%rax),%edi
add    $0x1,%ebx
cmp    %ebp,%eax
jl     1120 <to_line+0x10>
jmp    1133 <to_line+0x23>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @to_line(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = tail call i32 @fseekeol(i32 %5)
%7 = add nsw i32 %6, 1
%8 = add nuw nsw i32 %4, 1
%9 = icmp slt i32 %6, %0
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ mk20dx256_uart0_put_char(char const);
void mk20dx256_uart0_write(const char *buffer) {
  unsigned int i = 0;
  while (buffer[i] != '\0') {
    mk20dx256_uart0_put_char(buffer[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<mk20dx256_uart0_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1155 <mk20dx256_uart0_write+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <mk20dx256_uart0_put_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <mk20dx256_uart0_write+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk20dx256_uart0_write>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <mk20dx256_uart0_write+0x35>
mov    %rdi,%rbx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <mk20dx256_uart0_put_char@plt>
mov    %ebp,%eax
movzbl (%rbx,%rax,1),%eax
add    $0x1,%ebp
test   %al,%al
jne    1130 <mk20dx256_uart0_write+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @mk20dx256_uart0_write(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = tail call i32 @mk20dx256_uart0_put_char(i8 signext %5)
%8 = add i32 %6, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Type definitions */
struct mp4_context_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mp4_context_exit(struct mp4_context_t *);
void mp4_close(struct mp4_context_t *mp4_context) {
  mp4_context_exit(mp4_context);
}


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

x86 assembly (clang, -O2):
<mp4_close>:
jmp    1030 <mp4_context_exit@plt>

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

LLVM IR (-O2):
%struct.mp4_context_t = type { i32 }
define void @mp4_close(%struct.mp4_context_t* %0) {
%2 = tail call i32 @mp4_context_exit(%struct.mp4_context_t* %0)
ret void
}
/* Type definitions */
struct soap {
  int dummy;
};

/* Variables and functions */
int soap_element_begin_in(struct soap *, char *);
int soap_body_begin_in(struct soap *soap) {
  return soap_element_begin_in(soap, "SOAP-ENV:Body");
}


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

x86 assembly (clang, -O2):
<soap_body_begin_in>:
lea    0xee9(%rip),%rsi
jmp    1030 <soap_element_begin_in@plt>

LLVM IR (-O0):
%struct.soap = type { i32 }
@.str = [14 x i8] c"SOAP-ENV:Body\00"
define i32 @soap_body_begin_in(%struct.soap* %0) {
%2 = alloca %struct.soap*
store %struct.soap* %0, %struct.soap** %2
%3 = load %struct.soap*, %struct.soap** %2
%4 = call i32 @soap_element_begin_in(%struct.soap* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
%struct.soap = type { i32 }
@.str = [14 x i8] c"SOAP-ENV:Body\00"
define i32 @soap_body_begin_in(%struct.soap* %0) {
%2 = tail call i32 @soap_element_begin_in(%struct.soap* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
int dama(int j) {
  if (j == 1) {
    return 3;
  } else {
    return 5;
  }
}


x86 assembly (clang, -O0):
<dama>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <dama+0x1d>
movl   $0x3,-0x4(%rbp)
jmp    1124 <dama+0x24>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dama>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
add    %eax,%eax
add    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @dama(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 3, i32* %2
br label %8
7: ; preds = %1
store i32 5, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @dama(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 3, i32 5
ret i32 %3
}
void kasan_unpoison_vmalloc(const void *start, unsigned long size) {}


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

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

LLVM IR (-O0):
define void @kasan_unpoison_vmalloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @kasan_unpoison_vmalloc(i8* nocapture %0, i64 %1) {
ret void
}
int main(int argc, char *argv[]) {
  int val = 0;
  asm("MOV $100, %0" : "=r"(val));
  printf("val = %d\n", val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x64,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"val = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 asm "MOV $$100, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"val = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 asm "MOV $$100, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void aes_rotword(uint8_t *a) {
  uint8_t t;
  t = a[0];
  a[0] = a[1];
  a[1] = a[2];
  a[2] = a[3];
  a[3] = t;
}


x86 assembly (clang, -O0):
<aes_rotword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_rotword>:
movdqu (%rdi),%xmm0
pshufd $0x39,%xmm0,%xmm0
movdqu %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @aes_rotword(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = load i32*, i32** %2
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32 %19, i32* %21
%22 = load i32, i32* %3
%23 = load i32*, i32** %2
%24 = getelementptr inbounds i32, i32* %23, i64 3
store i32 %22, i32* %24
ret void
}

LLVM IR (-O2):
define void @aes_rotword(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = shufflevector <4 x i32> %3, <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 0>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ response(int, char *, char *, char *);
void ok(int client) {
  response(client, "HTTP/1.0 200 OK\r\n",
           "Content-Type: text/html\r\nContent-Length: %d\r\n\r\n", "OK");
}


x86 assembly (clang, -O0):
<ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
lea    0xee6(%rip),%rdx
lea    0xf0f(%rip),%rcx
call   1030 <response@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok>:
lea    0xee9(%rip),%rsi
lea    0xef4(%rip),%rdx
lea    0xf1d(%rip),%rcx
jmp    1030 <response@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"HTTP/1.0 200 OK\0D\0A\00"
@.str.1 = [48 x i8] c"Content-Type: text/html\0D\0AContent-Length: %d\0D\0A\0D\0A\00"
@.str.2 = [3 x i8] c"OK\00"
define void @ok(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @response(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"HTTP/1.0 200 OK\0D\0A\00"
@.str.1 = [48 x i8] c"Content-Type: text/html\0D\0AContent-Length: %d\0D\0A\0D\0A\00"
@.str.2 = [3 x i8] c"OK\00"
define void @ok(i32 %0) {
%2 = tail call i32 @response(i32 %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_SYS(int /*<<< orphan*/);
int gen_SYS() { handle_SYS(0); }


x86 assembly (clang, -O0):
<gen_SYS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <handle_SYS@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_SYS>:
xor    %edi,%edi
jmp    1030 <handle_SYS@plt>

LLVM IR (-O0):
define i32 @gen_SYS() {
%1 = alloca i32
%2 = call i32 @handle_SYS(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_SYS() {
%1 = tail call i32 @handle_SYS(i32 0)
ret i32 undef
}
int add2com(int *nback, int nod, int *iord, int *riord) {
  iord[nod] = *nback;
  riord[*nback] = nod;
  (*nback)--;
  return 0;
}


x86 assembly (clang, -O0):
<add2com>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2com>:
mov    (%rdi),%eax
movslq %esi,%rsi
mov    %eax,(%rdx,%rsi,4)
movslq (%rdi),%rax
mov    %esi,(%rcx,%rax,4)
addl   $0xffffffff,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @add2com(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %7
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 %10, i32* %14
%15 = load i32, i32* %6
%16 = load i32*, i32** %8
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %16, i64 %19
store i32 %15, i32* %20
%21 = load i32*, i32** %5
%22 = load i32, i32* %21
%23 = add nsw i32 %22, -1
store i32 %23, i32* %21
ret i32 0
}

LLVM IR (-O2):
define i32 @add2com(i32* nocapture %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %2, i64 %6
store i32 %5, i32* %7
%8 = load i32, i32* %0
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %3, i64 %9
store i32 %1, i32* %10
%11 = load i32, i32* %0
%12 = add nsw i32 %11, -1
store i32 %12, i32* %0
ret i32 0
}
char *alloc(nbytes)
int nbytes;
{
  char *malloc();
  return (malloc(nbytes));
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @alloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @alloc(i32 %0) {
%2 = tail call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int my_isneg(int n) {
  if (n >= 0) {
    my_putchar('P');
  } else {
    my_putchar('N');
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_isneg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1134 <my_isneg+0x24>
mov    $0x50,%edi
call   1030 <my_putchar@plt>
jmp    113e <my_isneg+0x2e>
mov    $0x4e,%edi
call   1030 <my_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isneg>:
push   %rax
not    %edi
shr    $0x1f,%edi
add    %edi,%edi
add    $0x4e,%edi
call   1030 <my_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_isneg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @my_putchar(i8 signext 80)
br label %9
7: ; preds = %1
%8 = call i32 @my_putchar(i8 signext 78)
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
define i32 @my_isneg(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i8 80, i8 78
%4 = tail call i32 @my_putchar(i8 signext %3)
ret i32 0
}
void gtk_widget_modify_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_modify_text() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_close(void *);
void freeLuaSession(void *session) { lua_close(session); }


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

x86 assembly (clang, -O2):
<freeLuaSession>:
jmp    1030 <lua_close@plt>

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

LLVM IR (-O2):
define void @freeLuaSession(i8* %0) {
%2 = tail call i32 @lua_close(i8* %0)
ret void
}
double INHGtoPSI(double INHG) {
  double PSI = 0.491130 * INHG;
  return PSI;
}


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

x86 assembly (clang, -O2):
<INHGtoPSI>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @INHGtoPSI(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 4.911300e-01, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @INHGtoPSI(double %0) {
%2 = fmul double %0, 4.911300e-01
ret double %2
}
int test_imm_6Duint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x6D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Duint64_lowword_mem>:
testb  $0x6d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Duint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 109
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int getDebugChar();
int inbyte() { return (getDebugChar()); }


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

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

LLVM IR (-O0):
define i32 @inbyte() {
%1 = call i32 (...) @getDebugChar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @inbyte() {
%1 = tail call i32 (...) @getDebugChar()
ret i32 %1
}
int test_imm_11uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x11 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_11uint64_midword_reg>:
test   $0x110000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_11uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 1114112
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ wmm_close(void *);
void ndt_wmm_close(void **_wmm) {
  if (*_wmm) {
    wmm_close(*_wmm);
  }
}


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

x86 assembly (clang, -O2):
<ndt_wmm_close>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <ndt_wmm_close+0xd>
jmp    1030 <wmm_close@plt>
ret

LLVM IR (-O0):
define void @ndt_wmm_close(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = call i32 @wmm_close(i8* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @ndt_wmm_close(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @wmm_close(i8* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int genrand64_int64();
int mt_rand_bool() { return genrand64_int64() & 0x1; }


x86 assembly (clang, -O0):
<mt_rand_bool>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand64_int64@plt>
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_rand_bool>:
push   %rax
xor    %eax,%eax
call   1030 <genrand64_int64@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mt_rand_bool() {
%1 = call i32 (...) @genrand64_int64()
%2 = and i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @mt_rand_bool() {
%1 = tail call i32 (...) @genrand64_int64()
%2 = and i32 %1, 1
ret i32 %2
}
/* Variables and functions */
scalar_t__ sscanf(char *, char *, float *);
float ct_parse_float(char *src, float err) {
  float x;
  return sscanf(src, "%f", &x) ? x : err;
}


x86 assembly (clang, -O0):
<ct_parse_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed4(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x0,%rax
je     114e <ct_parse_float+0x3e>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1158 <ct_parse_float+0x48>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_parse_float>:
push   %rax
movss  %xmm0,(%rsp)
lea    0xee3(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
movss  (%rsp),%xmm0
test   %rax,%rax
je     1137 <ct_parse_float+0x27>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define float @ct_parse_float(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%6 = load i8*, i8** %3
%7 = call i64 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %5)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %5
br label %13
11: ; preds = %2
%12 = load float, float* %4
br label %13
13: ; preds = %11, %9
%14 = phi float [ %10, %9 ], [ %12, %11 ]
ret float %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define float @ct_parse_float(i8* %0, float %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call i64 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%6 = icmp eq i64 %5, 0
%7 = load float, float* %3
%8 = select i1 %6, float %1, float %7
ret float %8
}
void gtk_drag_dest_set() {}


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

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

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

LLVM IR (-O2):
define void @gtk_drag_dest_set() {
ret void
}
void gtk_label_select_region() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_select_region() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ convert_static();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  convert_static();
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <convert_static@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @convert_static()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @convert_static()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int warning(char *message, char *object_name) {
  fflush(stdout);
  fprintf(stderr, "Warning: %s: %s.\n", object_name, message);
  return 1;
}


x86 assembly (clang, -O0):
<warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [18 x i8] c"Warning: %s: %s.\0A\00"
define i32 @warning(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
ret i32 1
}
void second(char *status, int *counter, char pref) {
  if (*status == 'D') {
    if (pref == 'U')
      *counter += 2;
  } else {
    *counter += 1;
  }
  *status = 'D';
}


x86 assembly (clang, -O0):
<second>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x44,%eax
jne    113e <second+0x3e>
movsbl -0x11(%rbp),%eax
cmp    $0x55,%eax
jne    1139 <second+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %ecx,(%rax)
jmp    1149 <second+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x44,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<second>:
mov    $0x1,%eax
cmpb   $0x44,(%rdi)
jne    1114 <second+0x14>
mov    $0x2,%eax
cmp    $0x55,%dl
jne    1116 <second+0x16>
add    %eax,(%rsi)
movb   $0x44,(%rdi)
ret

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

LLVM IR (-O2):
define void @second(i8* nocapture %0, i32* nocapture %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 68
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = icmp eq i8 %2, 85
br i1 %7, label %8, label %12
8: ; preds = %3, %6
%9 = phi i32 [ 2, %6 ], [ 1, %3 ]
%10 = load i32, i32* %1
%11 = add nsw i32 %10, %9
store i32 %11, i32* %1
br label %12
12: ; preds = %8, %6
store i8 68, i8* %0
ret void
}
void test(int c) {
  char q;
  q = (char)(c || 15);
  return;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jne    1120 <test+0x20>
mov    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    1120 <test+0x20>
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x5(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
br label %7
7: ; preds = %6, %1
%8 = phi i1 [ true, %1 ], [ true, %6 ]
%9 = zext i1 %8 to i32
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
ret void
}

LLVM IR (-O2):
define void @test(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
void *u64_to_ptr(uint64_t ptr) { return (void *)(unsigned long)ptr; }


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

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

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

LLVM IR (-O2):
define i8* @u64_to_ptr(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
/* Type definitions */
struct floc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fatal(struct floc *, int /*<<< orphan*/);
int /*<<< orphan*/ gettext(char *);
char *strdup(char const *);
char *xstrdup(const char *ptr) {
  char *result;
  result = strdup(ptr);
  if (result == 0)
    fatal(((struct floc *)0), gettext("virtual memory exhausted"));
  return result;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <xstrdup+0x3b>
lea    0xea5(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <xstrdup+0x23>
lea    0xebb(%rip),%rdi
call   1030 <gettext@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1050 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.floc = type { i32 }
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @gettext(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @fatal(%struct.floc* null, i32 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
%struct.floc = type { i32 }
@.str = [25 x i8] c"virtual memory exhausted\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @gettext(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @fatal(%struct.floc* null, i32 %5)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_decoders();
int /*<<< orphan*/ cleanup_preferences();
void decoder_cleanup() {
  cleanup_decoders();
  cleanup_preferences();
}


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

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

LLVM IR (-O0):
define void @decoder_cleanup() {
%1 = call i32 (...) @cleanup_decoders()
%2 = call i32 (...) @cleanup_preferences()
ret void
}

LLVM IR (-O2):
define void @decoder_cleanup() {
%1 = tail call i32 (...) @cleanup_decoders()
%2 = tail call i32 (...) @cleanup_preferences()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void usage(char *program_name) {
  printf("usage: %s: -i [IFILE] -o [OFILE] \n", program_name);
  fputs(("             -i ifile | --input  ifile                               "
         " \n             -o ofile | --output ofile                            "
         "    \n             -d       | --debug                                "
         "       \n             -h       | --help                    display "
         "help info   \n\n"),
        stdout);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
call   1040 <fputs@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xed3(%rip),%rdi
call   1040 <fputs@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"usage: %s: -i [IFILE] -o [OFILE] \0A\00"
@.str.1 = [286 x i8] c" -i ifile | --input ifile \0A -o ofile | --output ofile \0A -d | --debug \0A -h | --help display help info \0A\0A\00"
@stdout = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i8* getelementptr inbounds ([286 x i8], [286 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [35 x i8] c"usage: %s: -i [IFILE] -o [OFILE] \0A\00"
@.str.1 = [286 x i8] c" -i ifile | --input ifile \0A -o ofile | --output ofile \0A -d | --debug \0A -h | --help display help info \0A\0A\00"
@stdout = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([286 x i8], [286 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ outop2str(char *);
void outload() { outop2str("LD"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"LD\00"
define void @outload() {
%1 = tail call i32 @outop2str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pelpe3_(double *, double *);
void cpelpe3(double *xmom, double *para) { pelpe3_(xmom, para); }


x86 assembly (clang, -O0):
<cpelpe3>:
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 <pelpe3_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpelpe3>:
jmp    1030 <pelpe3_@plt>

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

LLVM IR (-O2):
define void @cpelpe3(double* %0, double* %1) {
%3 = tail call i32 @pelpe3_(double* %0, double* %1)
ret void
}
int fsl_layerscape_wake_seconday_cores(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fsl_layerscape_wake_seconday_cores() {
ret i32 0
}
int main(void) {
  const const int a = 3;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%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
store i32 0, i32* %1
store i32 3, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int rand();
int get_rand(int iSpread) { return ((rand() % iSpread) + 1); }


x86 assembly (clang, -O0):
<get_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_rand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_rand(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Beta_Up(int value) {
  if (value) {
    cpc_key_press(0x60);
  } else {
    cpc_key_unpress(0x60);
  };
}


x86 assembly (clang, -O0):
<Joy_Beta_Up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Beta_Up+0x24>
mov    $0x60,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Beta_Up+0x2e>
mov    $0x60,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Beta_Up>:
test   %edi,%edi
je     112e <Joy_Beta_Up+0xe>
mov    $0x60,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x60,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Beta_Up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @cpc_key_press(i32 96)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 96)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Beta_Up(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 96)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 96)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
unsigned int getRandom();
int getRandomInt(int min, int max) {
  unsigned int span = 0;
  if (max <= min) {
    return min;
  }
  span = max - min + 1;
  return min + getRandom() % span;
}


x86 assembly (clang, -O0):
<getRandomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     113c <getRandomInt+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <getRandomInt+0x52>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getRandom@plt>
xor    %edx,%edx
divl   -0x10(%rbp)
mov    -0x14(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
sub    %edi,%ebp
jle    112b <getRandomInt+0x1b>
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <getRandom@plt>
xor    %edx,%edx
div    %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getRandomInt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = tail call i32 (...) @getRandom()
%8 = urem i32 %7, %6
%9 = add i32 %8, %0
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ %0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handle(int s) { printf("signal!!!!!\n"); }


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"signal!!!!!\0A\00"
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"signal!!!!!\00"
define void @handle(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}