xunge/DecIR huggingface dataset:
/* Type definitions */
typedef char *__m128d;

/* Variables and functions */
char *_mm_move_sd(char *, char *);
__m128d __attribute__((no, unused)) test(__m128d a, __m128d b) {
  __asm("" : "+v"(a), "+v"(b));
  return _mm_move_sd(a, b);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
movq   %rcx,%xmm0
movq   %rax,%xmm1
movq   %xmm1,%rax
movq   %xmm0,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_mm_move_sd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movq   %rdi,%xmm0
movq   %rsi,%xmm1
movq   %xmm0,%rdi
movq   %xmm1,%rsi
jmp    1030 <_mm_move_sd@plt>

LLVM IR (-O0):
define i8* @test(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %5, i8* %6)
%8 = extractvalue { i8*, i8* } %7, 0
%9 = extractvalue { i8*, i8* } %7, 1
store i8* %8, i8** %3
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i8* @_mm_move_sd(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @test(i8* %0, i8* %1) {
%3 = tail call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i8*, i8* } %3, 0
%5 = extractvalue { i8*, i8* } %3, 1
%6 = tail call i8* @_mm_move_sd(i8* %4, i8* %5)
ret i8* %6
}
int givePtr(ptrToPtr)
int *ptrToPtr;
{
  output(*ptrToPtr);
  *ptrToPtr = 1;
  output(*ptrToPtr);
  return *ptrToPtr;
}


x86 assembly (clang, -O0):
<givePtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <output@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <output@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<givePtr>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %eax,%eax
call   1030 <output@plt>
movl   $0x1,(%rbx)
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <output@plt>
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @givePtr(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @output to i32 (i32, ...)*)(i32 %2)
store i32 1, i32* %0
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @output to i32 (i32, ...)*)(i32 1)
%5 = load i32, i32* %0
ret i32 %5
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, int, char);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int a;
  char c;
  scanf("%d", &a);
  c = getchar();
  printf("a:%d and c:%c", a, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
movsbl -0x9(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x4(%rsp),%esi
movsbl %al,%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"a:%d and c:%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = load i32, i32* %2
%7 = load i8, i8* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %6, i8 signext %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"a:%d and c:%c\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call signext i8 (...) @getchar()
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5, i8 signext %4)
ret i32 0
}
/* Variables and functions */
size_t GenIntHash(size_t);
size_t FloatHash(const float fval) {
  union {
    float f;
    size_t s;
  } conv = {fval};
  return GenIntHash(conv.s);
}


x86 assembly (clang, -O0):
<FloatHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <GenIntHash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FloatHash>:
movd   %xmm0,%edi
jmp    1030 <GenIntHash@plt>

LLVM IR (-O0):
%union.anon = type { i64 }
define i64 @FloatHash(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = bitcast %union.anon* %3 to float*
%5 = load float, float* %2
store float %5, float* %4
%6 = bitcast %union.anon* %3 to i64*
%7 = load i64, i64* %6
%8 = call i64 @GenIntHash(i64 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @FloatHash(float %0) {
%2 = bitcast float %0 to i32
%3 = zext i32 %2 to i64
%4 = tail call i64 @GenIntHash(i64 %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int sys_unlink(const char *name) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<sys_unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_unlink>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @sys_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @sys_unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
ret i32 -1
}
int tls13_client_end_of_early_data_recv(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_end_of_early_data_recv(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool is_thumb2(uint16_t insn) { return insn >= 0xe800; }


x86 assembly (clang, -O0):
<is_thumb2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xe800,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_thumb2>:
xor    %eax,%eax
cmp    $0xe800,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @is_thumb2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 59392
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_thumb2(i32 %0) {
%2 = icmp sgt i32 %0, 59391
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vs4();
int /*<<< orphan*/ take_struct_vs4(int /*<<< orphan*/);
void test_struct_vs4() { take_struct_vs4(return_struct_vs4()); }


x86 assembly (clang, -O0):
<test_struct_vs4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_struct_vs4@plt>
mov    %eax,%edi
call   1040 <take_struct_vs4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_vs4>:
push   %rax
xor    %eax,%eax
call   1030 <return_struct_vs4@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <take_struct_vs4@plt>

LLVM IR (-O0):
define void @test_struct_vs4() {
%1 = call i32 (...) @return_struct_vs4()
%2 = call i32 @take_struct_vs4(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vs4() {
%1 = tail call i32 (...) @return_struct_vs4()
%2 = tail call i32 @take_struct_vs4(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OSD_Putchar(int);
int OSD_Puts(char *str) {
  int c;
  while ((c = *str++))
    OSD_Putchar(c);
  return (1);
}


x86 assembly (clang, -O0):
<OSD_Puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1147 <OSD_Puts+0x37>
mov    -0xc(%rbp),%edi
call   1030 <OSD_Putchar@plt>
jmp    111c <OSD_Puts+0xc>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSD_Puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <OSD_Puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <OSD_Putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <OSD_Puts+0x10>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @OSD_Puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
store i32 %8, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i32, i32* %3
%12 = call i32 @OSD_Putchar(i32 %11)
br label %4
13: ; preds = %4
ret i32 1
}

LLVM IR (-O2):
define i32 @OSD_Puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @OSD_Putchar(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 1
}
void shift_and_trim(char **str) {
  *str += 4;
  while (**str == ' ')
    ++*str;
}


x86 assembly (clang, -O0):
<shift_and_trim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    113c <shift_and_trim+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1116 <shift_and_trim+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_and_trim>:
mov    (%rdi),%rax
add    $0x4,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,(%rdi)
cmpb   $0x20,(%rax)
lea    0x1(%rax),%rax
je     1110 <shift_and_trim+0x10>
ret

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

LLVM IR (-O2):
define void @shift_and_trim(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 4
br label %4
4: ; preds = %4, %1
%5 = phi i8* [ %3, %1 ], [ %8, %4 ]
store i8* %5, i8** %0
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
%8 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %7, label %4, label %9
9: ; preds = %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct rc4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rc4_emit_byte(struct rc4 *);
void rc4_emit(struct rc4 *k, void *buffer, size_t count) {
  for (size_t b = 0; b < count; b++) {
    ((uint8_t *)buffer)[b] = rc4_emit_byte(k);
  }
}


x86 assembly (clang, -O0):
<rc4_emit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1161 <rc4_emit+0x51>
mov    -0x8(%rbp),%rdi
call   1030 <rc4_emit_byte@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <rc4_emit+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc4_emit>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1145 <rc4_emit+0x35>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <rc4_emit_byte@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <rc4_emit+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.rc4 = type { i32 }
define void @rc4_emit(%struct.rc4* %0, i8* nocapture writeonly %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = bitcast i8* %1 to i32*
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %12, %8 ]
%10 = tail call i32 @rc4_emit_byte(%struct.rc4* %0)
%11 = getelementptr inbounds i32, i32* %6, i64 %9
store i32 %10, i32* %11
%12 = add nuw i64 %9, 1
%13 = icmp eq i64 %12, %2
br i1 %13, label %7, label %8
}
/* Variables and functions */
int errno;
int write(int, void *, int);
int os_write_file(int fd, const void *buf, int len) {
  int n = write(fd, (void *)buf, len);
  if (n < 0)
    return -errno;
  return n;
}


x86 assembly (clang, -O0):
<os_write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1151 <os_write_file+0x41>
xor    %eax,%eax
mov    0x2e99(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <os_write_file+0x47>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_write_file>:
push   %rax
call   1030 <write@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovs  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @os_write_file(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @write(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = load i32, i32* @errno
%17 = sub nsw i32 0, %16
store i32 %17, i32* %4
br label %20
18: ; preds = %3
%19 = load i32, i32* %8
store i32 %19, i32* %4
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @os_write_file(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EPIConfigSDRAMSet(uint32_t ui32Base, uint32_t ui32Config,
                       uint32_t ui32Refresh) {
  ;
  ;
  ui32Config &= ~0x07FF0000;
  ui32Config |= ui32Refresh << 16;
  (*((volatile uint32_t *)(ui32Base + 0x00000010))) = ui32Config;
}


x86 assembly (clang, -O0):
<EPIConfigSDRAMSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf800ffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIConfigSDRAMSet>:
and    $0xf800ffff,%esi
shl    $0x10,%edx
or     %esi,%edx
movslq %edi,%rax
mov    %edx,0x10(%rax)
ret

LLVM IR (-O0):
define void @EPIConfigSDRAMSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = and i32 %7, -134152193
store i32 %8, i32* %5
%9 = load i32, i32* %6
%10 = shl i32 %9, 16
%11 = load i32, i32* %5
%12 = or i32 %11, %10
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 16
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store volatile i32 %13, i32* %17
ret void
}

LLVM IR (-O2):
define void @EPIConfigSDRAMSet(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, -134152193
%5 = shl i32 %2, 16
%6 = or i32 %5, %4
%7 = add nsw i32 %0, 16
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %6, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dmbit();
int /*<<< orphan*/ dmchk();
int /*<<< orphan*/ dmcll();
int /*<<< orphan*/ dmll();
int /*<<< orphan*/ dmsort();
int main(int argc, char **argv) {
  dmll();
  dmcll();
  dmchk();
  dmbit();
  dmsort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <dmll@plt>
mov    $0x0,%al
call   1050 <dmcll@plt>
mov    $0x0,%al
call   1060 <dmchk@plt>
mov    $0x0,%al
call   1030 <dmbit@plt>
mov    $0x0,%al
call   1070 <dmsort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <dmll@plt>
xor    %eax,%eax
call   1050 <dmcll@plt>
xor    %eax,%eax
call   1060 <dmchk@plt>
xor    %eax,%eax
call   1030 <dmbit@plt>
xor    %eax,%eax
call   1070 <dmsort@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @dmll()
%7 = call i32 (...) @dmcll()
%8 = call i32 (...) @dmchk()
%9 = call i32 (...) @dmbit()
%10 = call i32 (...) @dmsort()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @dmll()
%4 = tail call i32 (...) @dmcll()
%5 = tail call i32 (...) @dmchk()
%6 = tail call i32 (...) @dmbit()
%7 = tail call i32 (...) @dmsort()
ret i32 0
}
int ft_nbrlen(int nombre) {
  int counter;
  counter = 0;
  if (nombre == 0)
    return (1);
  while (nombre > 0) {
    nombre = nombre / 10;
    counter++;
  }
  return (counter);
}


x86 assembly (clang, -O0):
<ft_nbrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <ft_nbrlen+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1155 <ft_nbrlen+0x55>
jmp    1129 <ft_nbrlen+0x29>
cmpl   $0x0,-0x8(%rbp)
jle    114f <ft_nbrlen+0x4f>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <ft_nbrlen+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nbrlen>:
test   %edi,%edi
je     1125 <ft_nbrlen+0x25>
jle    112b <ft_nbrlen+0x2b>
xor    %eax,%eax
mov    $0xcccccccd,%ecx
nopl   (%rax)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <ft_nbrlen+0x10>
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_nbrlen(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = phi i32 [ %8, %5 ], [ %0, %3 ]
%8 = udiv i32 %7, 10
%9 = add nuw nsw i32 %6, 1
%10 = icmp ult i32 %7, 10
br i1 %10, label %11, label %5
11: ; preds = %5, %3, %1
%12 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %9, %5 ]
ret i32 %12
}
/* Variables and functions */
bool is_hex_digit(char c) {
  return (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') ||
         (c >= '0' && c <= '9');
}


x86 assembly (clang, -O0):
<is_hex_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_hex_digit+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_hex_digit+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <is_hex_digit+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x46,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_hex_digit+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <is_hex_digit+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_digit>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x6,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_hex_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 102
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 70
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 48
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 57
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_hex_digit(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 6
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
double pathconN_nm9_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<pathconN_nm9_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm9_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pathconN_nm9_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @pathconN_nm9_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
int diminuto_daemon_install(int, int /*<<< orphan*/);
int diminuto_daemon_ignore(int signum) {
  return diminuto_daemon_install(signum, SIG_IGN);
}


x86 assembly (clang, -O0):
<diminuto_daemon_ignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <diminuto_daemon_install@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_daemon_ignore>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <diminuto_daemon_install@plt>

LLVM IR (-O0):
@SIG_IGN = global i32 0
define i32 @diminuto_daemon_ignore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @diminuto_daemon_install(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
define i32 @diminuto_daemon_ignore(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @diminuto_daemon_install(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_sql_empty_comments() {
  test_parser_verify_parse(test_parser_sourcefile("sql", " --\n"), "sql", "",
                           "--\n", 0);
}


x86 assembly (clang, -O0):
<test_sql_empty_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xeb7(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sql_empty_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xeca(%rip),%rdx
lea    0xec0(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sql\00"
@.str.1 = [5 x i8] c" --\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"--\0A\00"
define void @test_sql_empty_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"sql\00"
@.str.1 = [5 x i8] c" --\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"--\0A\00"
define void @test_sql_empty_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void unparseable() {
  puts("the program is unparseable!");
  exit(127);
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"the program is unparseable!\00"
define void @unparseable() {
%1 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 127)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"the program is unparseable!\00"
define void @unparseable() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 127)
unreachable
}
struct note *music_sheet_get_notes(struct music_sheet *self,
                                   unsigned long *num_notes) {
  return (void *)0X0;
}


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

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

LLVM IR (-O0):
%struct.note = type opaque
%struct.music_sheet = type opaque
define %struct.note* @music_sheet_get_notes(%struct.music_sheet* %0, i64* %1) {
%3 = alloca %struct.music_sheet*
%4 = alloca i64*
store %struct.music_sheet* %0, %struct.music_sheet** %3
store i64* %1, i64** %4
ret %struct.note* null
}

LLVM IR (-O2):
%struct.note = type opaque
%struct.music_sheet = type opaque
define noalias %struct.note* @music_sheet_get_notes(%struct.music_sheet* nocapture readnone %0, i64* nocapture readnone %1) {
ret %struct.note* null
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ GetINIString(char *, char *, char *, char *, int, char *);
int atol(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int32_t GetINIInt(char *section, char *key, int32_t def, char *filename) {
  char buf[80];
  sprintf(buf, "%i", def);
  GetINIString(section, key, buf, buf, 80, filename);
  return atol(buf);
}


x86 assembly (clang, -O0):
<GetINIInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xeab(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x70(%rbp),%rcx
mov    -0x20(%rbp),%r9
mov    $0x50,%r8d
call   1030 <GetINIString@plt>
lea    -0x70(%rbp),%rdi
call   1040 <atol@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetINIInt>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    0xeb5(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %rbx,%rcx
mov    $0x50,%r8d
mov    %r14,%r9
call   1030 <GetINIString@plt>
mov    %rbx,%rdi
call   1040 <atol@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i32 @GetINIInt(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [80 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %7
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%17 = load i8*, i8** %8
%18 = call i32 @GetINIString(i8* %13, i8* %14, i8* %15, i8* %16, i32 80, i8* %17)
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%20 = call i32 @atol(i8* %19)
ret i32 %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @GetINIInt(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca [80 x i8]
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%8 = call i32 @GetINIString(i8* %0, i8* %1, i8* %6, i8* %6, i32 80, i8* %3)
%9 = call i32 @atol(i8* %6)
ret i32 %9
}
void nseel_asm_or_op_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_or_op_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int rand();
int /*<<< orphan*/ stdout;
int main() {
  for (unsigned int i = 0; i < 1000000000000000000; i++)
    fprintf(stdout, "%d ", rand() % 10000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movabs $0xde0b6b3a7640000,%rcx
b6 e0 0d
cmp    %rcx,%rax
jge    1184 <main+0x64>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0xc(%rbp),%edi
mov    $0x2710,%ecx
cltd
idiv   %ecx
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x2eb5(%rip),%r14
lea    0xece(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%ebp
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rdx
imul   $0x68db8bad,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rax
add    %ecx,%eax
imul   $0x2710,%eax,%eax
sub    %eax,%edx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <fprintf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = icmp slt i64 %5, 1000000000000000000
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i32, i32* @stdout
%9 = call i32 (...) @rand()
%10 = srem i32 %9, 10000
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%d \00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @stdout
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 10000
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %1
}
int test_imm_B3uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xB3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B3uint64_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, 179
%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_B3uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 179
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int generar_numero() {
  int num;
  srand(time(NULL));
  num = rand() % 8;
  return num;
}


x86 assembly (clang, -O0):
<generar_numero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generar_numero>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @generar_numero() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 8
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @generar_numero() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 8
ret i32 %4
}
void dump_stack() {}


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

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

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

LLVM IR (-O2):
define void @dump_stack() {
ret void
}
void pc(name, value) const char *const name;
const int value;
{
  pname(name, 0);
  putcesc(value);
  putsg();
}


x86 assembly (clang, -O0):
<pc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <pname@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1050 <putcesc@plt>
mov    $0x0,%al
call   1030 <putsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc>:
push   %rbx
mov    %esi,%ebx
xor    %esi,%esi
xor    %eax,%eax
call   1040 <pname@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <putcesc@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <putsg@plt>

LLVM IR (-O0):
define void @pc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @pname to i32 (i8*, i32, ...)*)(i8* %5, i32 0)
%7 = load i32, i32* %4
%8 = call i32 (i32, ...) bitcast (i32 (...)* @putcesc to i32 (i32, ...)*)(i32 %7)
%9 = call i32 (...) @putsg()
ret void
}

LLVM IR (-O2):
define void @pc(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @pname to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @putcesc to i32 (i32, ...)*)(i32 %1)
%5 = tail call i32 (...) @putsg()
ret void
}
/* Variables and functions */
int d18(int);
int d19(int a) { return d18(d18(a)); }


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

x86 assembly (clang, -O2):
<d19>:
push   %rax
call   1030 <d18@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d18@plt>

LLVM IR (-O0):
define i32 @d19(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @d18(i32 %3)
%5 = call i32 @d18(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @d19(i32 %0) {
%2 = tail call i32 @d18(i32 %0)
%3 = tail call i32 @d18(i32 %2)
ret i32 %3
}
__attribute__((always_)) int api3(int api_no, int arg1, int arg2, int arg3) {
  int ret = 0;
  __asm__ __volatile__("int $0x44"
                       : "=a"(ret)
                       : "0"(api_no), "b"(arg1), "c"(arg2), "d"(arg3));
  return ret;
}


x86 assembly (clang, -O0):
<api3>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
int    $0x44
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<api3>:
push   %rbx
mov    %ecx,%eax
mov    %edx,%ecx
mov    %esi,%ebx
mov    %eax,%edx
mov    %edi,%eax
int    $0x44
pop    %rbx
ret

LLVM IR (-O0):
define i32 @api3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 asm sideeffect "int $$0x44", "={ax},0,{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %10, i32 %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @api3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 asm sideeffect "int $$0x44", "={ax},0,{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ local_time();
int32_t qmtime() { return local_time() + (732 * 86400L); }


x86 assembly (clang, -O0):
<qmtime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <local_time@plt>
add    $0x3c50a00,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qmtime>:
push   %rax
xor    %eax,%eax
call   1030 <local_time@plt>
add    $0x3c50a00,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @qmtime() {
%1 = call i64 (...) @local_time()
%2 = add nsw i64 %1, 63244800
ret i64 %2
}

LLVM IR (-O2):
define i64 @qmtime() {
%1 = tail call i64 (...) @local_time()
%2 = add nsw i64 %1, 63244800
ret i64 %2
}
long lennob(char *str) {
  long i, i_nb;
  for (i = 0, i_nb = -1L; *(str + i); i++)
    if (*(str + i) != ' ')
      i_nb = i;
  return (i_nb + 1);
}


x86 assembly (clang, -O0):
<lennob>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <lennob+0x5d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     1147 <lennob+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    114c <lennob+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <lennob+0x18>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lennob>:
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
jmp    1114 <lennob+0x14>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rcx
movzbl (%rdi,%rcx,1),%edx
cmp    $0x20,%dl
je     1110 <lennob+0x10>
test   %dl,%dl
je     1126 <lennob+0x26>
mov    %rcx,%rax
jmp    1110 <lennob+0x10>
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @lennob(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i64 [ 0, %1 ], [ %10, %8 ]
%4 = phi i64 [ -1, %1 ], [ %9, %8 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 0, label %11
i8 32, label %8
]
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i64 [ %3, %7 ], [ %4, %2 ]
%10 = add nuw nsw i64 %3, 1
br label %2
11: ; preds = %2
%12 = add nsw i64 %4, 1
ret i64 %12
}
int ctm_version(void) { return 0x269; }


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

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

LLVM IR (-O0):
define i32 @ctm_version() {
ret i32 617
}

LLVM IR (-O2):
define i32 @ctm_version() {
ret i32 617
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, void *, size_t, int /*<<< orphan*/);
ssize_t myread(int fd, void *buf, size_t len) { return recv(fd, buf, len, 0); }


x86 assembly (clang, -O0):
<myread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myread>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @myread(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}