xunge/DecIR huggingface dataset:
void strcpy4(char *s, char *t) {
  while (*s++ = *t++)
    ;
}


x86 assembly (clang, -O0):
<strcpy4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strcpy4+0x3b>
jmp    110c <strcpy4+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy4>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy4+0x10>
ret

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

LLVM IR (-O2):
define void @strcpy4(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
int executecmd(char command) { return 0; }


x86 assembly (clang, -O0):
<executecmd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @executecmd(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @executecmd(i8 signext %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
typedef int ui32Base;

/* Variables and functions */
void PWMDeadBandEnable(uint32_t ui32Base, uint32_t ui32Gen, uint16_t ui16Rise,
                       uint16_t ui16Fall) {
  ;
  ;
  ;
  ;
  ui32Gen = ((ui32Base) + (ui32Gen));
  (*((volatile uint32_t *)(ui32Gen + 0x0000002C))) = ui16Rise;
  (*((volatile uint32_t *)(ui32Gen + 0x00000030))) = ui16Fall;
  (*((volatile uint32_t *)(ui32Gen + 0x00000028))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<PWMDeadBandEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x30,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x28,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMDeadBandEnable>:
movslq %esi,%rax
movslq %edi,%rsi
mov    %edx,0x2c(%rax,%rsi,1)
mov    %ecx,0x30(%rax,%rsi,1)
orl    $0x1,0x28(%rax,%rsi,1)
ret

LLVM IR (-O0):
define void @PWMDeadBandEnable(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* %6
%11 = add nsw i32 %9, %10
store i32 %11, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 44
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %12, i32* %16
%17 = load i32, i32* %8
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 48
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 %17, i32* %21
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 40
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = or i32 %26, 1
store volatile i32 %27, i32* %25
ret void
}

LLVM IR (-O2):
define void @PWMDeadBandEnable(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = add nsw i32 %5, 44
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %2, i32* %8
%9 = add nsw i32 %5, 48
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %3, i32* %11
%12 = add nsw i32 %5, 40
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = or i32 %15, 1
store volatile i32 %16, i32* %14
ret void
}
OP(dd, fa) {
  illegal_1();
  op_fa();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_fa@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_fa()
ret i32 undef
}
void write_4_byte_int(unsigned char *a_output, long a_int) {
  a_output[0] = (unsigned char)(a_int >> 24);
  a_output[1] = (unsigned char)(a_int >> 16);
  a_output[2] = (unsigned char)(a_int >> 8);
  a_output[3] = (unsigned char)(a_int & 0xFF);
}


x86 assembly (clang, -O0):
<write_4_byte_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
sar    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_4_byte_int>:
bswap  %esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write_4_byte_int(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
store i8 %4, i8* %0
%5 = lshr i64 %1, 16
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i64 %1, 8
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i64 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printhdr(char *name, int page) {
  printf("\n\n\n");
  printf("--- page %i | %s\n\n", page, name);
}


x86 assembly (clang, -O0):
<printhdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhdr>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\0A\0A\0A\00"
@.str.1 = [19 x i8] c"--- page %i | %s\0A\0A\00"
define void @printhdr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"--- page %i | %s\0A\0A\00"
@str = [3 x i8] c"\0A\0A\00"
define void @printhdr(i8* %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* %0)
ret void
}
char lookup(char *haystack, char *needle) {
  char x;
  for (x = haystack[-2]; x < *needle; x++)
    haystack[x] = needle[x];
  return 1;
}


x86 assembly (clang, -O0):
<lookup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x2(%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    114e <lookup+0x4e>
mov    -0x10(%rbp),%rax
movsbq -0x11(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movsbq -0x11(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    1116 <lookup+0x16>
mov    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup>:
movsbq -0x2(%rdi),%rax
cmp    (%rsi),%al
jge    1124 <lookup+0x24>
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
movsbq (%rsi),%rcx
cmp    %rcx,%rax
jl     1110 <lookup+0x10>
mov    $0x1,%al
ret

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

LLVM IR (-O2):
define signext i8 @lookup(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 -2
%4 = load i8, i8* %3
%5 = load i8, i8* %1
%6 = icmp slt i8 %4, %5
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = sext i8 %4 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ %8, %7 ], [ %14, %9 ]
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %12, i8* %13
%14 = add nsw i64 %10, 1
%15 = load i8, i8* %1
%16 = sext i8 %15 to i64
%17 = icmp slt i64 %14, %16
br i1 %17, label %9, label %18
18: ; preds = %9, %2
ret i8 1
}
/* Variables and functions */
unsigned int config_cmd(unsigned char, unsigned int, unsigned int);
int /*<<< orphan*/ outl(unsigned int, int);
void pcibios_write_config_dword(unsigned char bus, unsigned devfn,
                                unsigned where, unsigned int value) {
  outl(config_cmd(bus, devfn, where), 0xCF8);
  outl(value, 0xCFC);
}


x86 assembly (clang, -O0):
<pcibios_write_config_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movzbl %al,%edi
call   1040 <config_cmd@plt>
mov    %eax,%edi
mov    $0xcf8,%esi
call   1030 <outl@plt>
mov    -0x10(%rbp),%edi
mov    $0xcfc,%esi
call   1030 <outl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcibios_write_config_dword>:
push   %rbx
mov    %ecx,%ebx
call   1040 <config_cmd@plt>
mov    %eax,%edi
mov    $0xcf8,%esi
call   1030 <outl@plt>
mov    %ebx,%edi
mov    $0xcfc,%esi
pop    %rbx
jmp    1030 <outl@plt>

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

LLVM IR (-O2):
define void @pcibios_write_config_dword(i8 zeroext %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @config_cmd(i8 zeroext %0, i32 %1, i32 %2)
%6 = tail call i32 @outl(i32 %5, i32 3320)
%7 = tail call i32 @outl(i32 %3, i32 3324)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lprcat(char *);
void ignore(void) { lprcat("ignore\n"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"ignore\0A\00"
define void @ignore() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void mul_handler(void) {
  write_src("{\n");
  write_src("imm_t b = POP();\n");
  write_src("imm_t a = POP();\n");
  write_src("PUSH(a*b);\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<mul_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [12 x i8] c"PUSH(a*b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @mul_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [12 x i8] c"PUSH(a*b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @mul_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void pause(void) {
  printf("\n\t*****\tAPPUYEZ SUR UNE TOUCHE POUR CONTINUER\t*****");
  (void)getchar();
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"\0A\09*****\09APPUYEZ SUR UNE TOUCHE POUR CONTINUER\09*****\00"
define void @pause() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"\0A\09*****\09APPUYEZ SUR UNE TOUCHE POUR CONTINUER\09*****\00"
define void @pause() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
/* Type definitions */
struct ts_attr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ts_attr *);
int /*<<< orphan*/ ts_destroy_attr(struct ts_attr *);
void ts_free_attr(struct ts_attr *attr) {
  ts_destroy_attr(attr);
  free(attr);
}


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

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

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

LLVM IR (-O2):
%struct.ts_attr = type { i32 }
define void @ts_free_attr(%struct.ts_attr* %0) {
%2 = tail call i32 @ts_destroy_attr(%struct.ts_attr* %0)
%3 = tail call i32 @free(%struct.ts_attr* %0)
ret void
}
int getPixelPositionY(int index, int width) { return index / width; }


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

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

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

LLVM IR (-O2):
define i32 @getPixelPositionY(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
void nullname(char **name) { ; }


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

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

LLVM IR (-O0):
define void @nullname(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
ret void
}

LLVM IR (-O2):
define void @nullname(i8** nocapture %0) {
ret void
}
/* Variables and functions */
size_t min(size_t a, size_t b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
double my_cimag(double _Complex x) { return ((double *)&x)[1]; }


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

x86 assembly (clang, -O2):
<my_cimag>:
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @my_cimag(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = bitcast { double, double }* %3 to double*
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
ret double %8
}

LLVM IR (-O2):
define double @my_cimag(double %0, double returned %1) {
ret double %1
}
unsigned short int f21(unsigned short int x, int y) {
  return (x >> (8 * 2 - y)) ^ (x << y);
}


x86 assembly (clang, -O0):
<f21>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f21>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f21(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sub nsw i32 16, %7
%9 = ashr i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i32, i32* %4
%13 = shl i32 %11, %12
%14 = xor i32 %9, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @f21(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub nsw i32 16, %1
%5 = lshr i32 %3, %4
%6 = shl i32 %3, %1
%7 = xor i32 %5, %6
%8 = trunc i32 %7 to i16
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int n;
  char s[1000];
  n = -1309;
  itoa(n, s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffae3,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x3f0(%rbp),%rsi
call   1040 <itoa@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    $0xfffffae3,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
store i32 -1309, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @itoa(i32 %4, i8* %5)
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 -1309, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int jeTrokut(int opseg, int promjerRupe) {
  float promjerPeciva;
  promjerPeciva = opseg / 3.0;
  if (promjerPeciva <= (float)promjerRupe)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<jeTrokut>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xee9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1143 <jeTrokut+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <jeTrokut+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jeTrokut>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtsi2ss %esi,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @jeTrokut(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 3.000000e+00
%10 = fptrunc double %9 to float
store float %10, float* %6
%11 = load float, float* %6
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to float
%14 = fcmp ole float %11, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @jeTrokut(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = fdiv double %3, 3.000000e+00
%5 = fptrunc double %4 to float
%6 = sitofp i32 %1 to float
%7 = fcmp ole float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef char u_char;

/* Variables and functions */
int /*<<< orphan*/ do_write(char const *, int);
void do_init_image(void) {
  const u_char const buf[8] = {'V', 'M', 'F', 'S', 'I', 'M', 'G', 2};
  do_write(buf, 8);
}


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

x86 assembly (clang, -O2):
<do_init_image>:
push   %rax
movabs $0x2474d4953464d56,%rax
4d 47 02
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <do_write@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.do_init_image.buf = [8 x i8] c"VMFSIMG\02"
define void @do_init_image() {
%1 = alloca [8 x i8]
%2 = bitcast [8 x i8]* %1 to i8*
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%4 = call i32 @do_write(i8* %3, i32 8)
ret void
}

LLVM IR (-O2):
define void @do_init_image() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 164184888747380054, i64* %1
%3 = call i32 @do_write(i8* %2, i32 8)
ret void
}
/* Type definitions */
struct athena_args {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ arg_parser_required2(struct athena_args *, char const *,
                                int /*<<< orphan*/);
int arg_parser_required(struct athena_args *args_info, const char *prog_name) {
  int result = EXIT_SUCCESS;
  if (arg_parser_required2(args_info, prog_name, 0) > 0)
    result = EXIT_FAILURE;
  return result;
}


x86 assembly (clang, -O0):
<arg_parser_required>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <arg_parser_required2@plt>
cmp    $0x0,%rax
jle    1151 <arg_parser_required+0x41>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_parser_required>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
xor    %edx,%edx
call   1030 <arg_parser_required2@plt>
test   %rax,%rax
jle    112f <arg_parser_required+0x1f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.athena_args = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @arg_parser_required(%struct.athena_args* %0, i8* %1) {
%3 = alloca %struct.athena_args*
%4 = alloca i8*
%5 = alloca i32
store %struct.athena_args* %0, %struct.athena_args** %3
store i8* %1, i8** %4
%6 = load i32, i32* @EXIT_SUCCESS
store i32 %6, i32* %5
%7 = load %struct.athena_args*, %struct.athena_args** %3
%8 = load i8*, i8** %4
%9 = call i64 @arg_parser_required2(%struct.athena_args* %7, i8* %8, i32 0)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %5
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.athena_args = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @arg_parser_required(%struct.athena_args* %0, i8* %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i64 @arg_parser_required2(%struct.athena_args* %0, i8* %1, i32 0)
%5 = icmp sgt i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
/* Variables and functions */
int gcd(int, int);
int isCoprime(int a, int b) {
  if (gcd(a, b) == 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isCoprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gcd@plt>
cmp    $0x1,%eax
jne    113e <isCoprime+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <isCoprime+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCoprime>:
push   %rax
call   1030 <gcd@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isCoprime(i32 %0, i32 %1) {
%3 = tail call i32 @gcd(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
void goal_state_recv_msg(void *msg) {}


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

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

LLVM IR (-O0):
define void @goal_state_recv_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @goal_state_recv_msg(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void myprint(char *buf, int n) {
  int i, j;
  for (i = 0; i < n; i++) {
    printf("%08x\n", buf[i]);
  }
}


x86 assembly (clang, -O0):
<myprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <myprint+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <myprint+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <myprint+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <myprint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%08x\0A\00"
define void @myprint(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(char *, int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char *);
int sasm_write_string(FILE *fp, char *string) {
  if (fp == NULL || string == NULL)
    return 0;
  return fwrite(string, sizeof(char), strlen(string), fp);
}


x86 assembly (clang, -O0):
<sasm_write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <sasm_write_string+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1152 <sasm_write_string+0x32>
movl   $0x0,-0x4(%rbp)
jmp    117a <sasm_write_string+0x5a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sasm_write_string>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1155 <sasm_write_string+0x35>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1155 <sasm_write_string+0x35>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @sasm_write_string(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%6 = load i32*, i32** %4
%7 = icmp eq i32* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %18
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i8*, i8** %5
%15 = call i32 @strlen(i8* %14)
%16 = load i32*, i32** %4
%17 = call i32 @fwrite(i8* %13, i32 1, i32 %15, i32* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @sasm_write_string(i32* %0, i8* %1) {
%3 = icmp eq i32* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i32 @fwrite(i8* %1, i32 1, i32 %7, i32* %0)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usleep(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "Usage: %s microseconds:[us | -] \n", argv[0]);
    exit(1);
  }
  usleep(atoi(argv[1]));
  exit(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)
cmpl   $0x2,-0x8(%rbp)
je     1186 <main+0x46>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1060 <usleep@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    115d <main+0x1d>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1060 <usleep@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s microseconds:[us | -] \0A\00"
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
%20 = call i32 @usleep(i32 %19)
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s microseconds:[us | -] \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = tail call i32 @usleep(i32 %12)
%14 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _cspec_should(int, char const *, int);
_cspec_should_power(const char *filename, int line, void *actual,
                    int (*f)(void *, void *), void *expected) {
  _cspec_should(f(actual, expected), filename, line);
}


x86 assembly (clang, -O0):
<_cspec_should_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   *%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_cspec_should@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cspec_should_power>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
mov    %r8,%rsi
call   *%rcx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_cspec_should@plt>

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

LLVM IR (-O2):
define i32 @_cspec_should_power(i8* %0, i32 %1, i8* %2, i32 (i8*, i8*)* nocapture %3, i8* %4) {
%6 = tail call i32 %3(i8* %2, i8* %4)
%7 = tail call i32 @_cspec_should(i32 %6, i8* %0, i32 %1)
ret i32 undef
}
long long countlength(long long i) {
  long long count = 0;
  while (i != 0) {
    count++;
    i = i / 10;
  }
  return count;
}


x86 assembly (clang, -O0):
<countlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <countlength+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1110 <countlength+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countlength>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1145 <countlength+0x45>
movabs $0x6666666666666667,%rsi
66 66 66
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rcx
mov    %rdi,%rax
imul   %rsi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    $0x9,%rdi
cmp    $0x12,%rdi
mov    %rdx,%rdi
ja     1120 <countlength+0x20>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @countlength(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i64 %4, 1
%7 = sdiv i64 %5, 10
%8 = add i64 %5, 9
%9 = icmp ult i64 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: convbdf [options] [input-files]\n"
                  "Options:\n"
                  "    -s N   Start output at character encodings >= N\n"
                  "    -l N   Limit output to character encodings <= N\n"
                  "    -x N-M Exclude character range N...M\n"
                  "    -u N   Use code N as default char \n"
                  "    -a N   Decrease ascent by N\n"
                  "    -d N   Decrease descent by N\n"
                  "    -n     Don't generate bitmaps as comments in .c file\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [355 x i8] c"Usage: convbdf [options] [input-files]\0AOptions:\0A -s N Start output at character encodings >= N\0A -l N Limit output to character encodings <= N\0A -x N-M Exclude character range N...M\0A -u N Use code N as default char \0A -a N Decrease ascent by N\0A -d N Decrease descent by N\0A -n Don't generate bitmaps as comments in .c file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([355 x i8], [355 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [355 x i8] c"Usage: convbdf [options] [input-files]\0AOptions:\0A -s N Start output at character encodings >= N\0A -l N Limit output to character encodings <= N\0A -x N-M Exclude character range N...M\0A -u N Use code N as default char \0A -a N Decrease ascent by N\0A -d N Decrease descent by N\0A -n Don't generate bitmaps as comments in .c file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([355 x i8], [355 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_D8uint16_reg(unsigned short val) {
  return ((val) & (0xD8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D8uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xd8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D8uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 216
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void stress_child_atexit(void) { _exit((6)); }


x86 assembly (clang, -O0):
<stress_child_atexit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<stress_child_atexit>:
push   %rax
mov    $0x6,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @stress_child_atexit() {
%1 = call i32 @_exit(i32 6)
unreachable
}

LLVM IR (-O2):
define void @stress_child_atexit() {
%1 = tail call i32 @_exit(i32 6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(char *);
void call() {
  pthread_exit("kill");
  return;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"kill\00"
define void @call() {
%1 = tail call i32 @pthread_exit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, char const *, struct timeval const *);
int futimesat(int dirfd, const char *pathname, const struct timeval times[2]) {
  return syscall(326, dirfd, pathname, times);
}


x86 assembly (clang, -O0):
<futimesat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x146,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futimesat>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x146,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @futimesat(i32 %0, i8* %1, %struct.timeval* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.timeval*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.timeval* %2, %struct.timeval** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load %struct.timeval*, %struct.timeval** %6
%10 = call i32 @syscall(i32 326, i32 %7, i8* %8, %struct.timeval* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @futimesat(i32 %0, i8* %1, %struct.timeval* %2) {
%4 = tail call i32 @syscall(i32 326, i32 %0, i8* %1, %struct.timeval* %2)
ret i32 %4
}