xunge/DecIR huggingface dataset:
/* Variables and functions */
int set_logpriority(int /*<<< orphan*/);
int /*<<< orphan*/ systemlog(int, char *);
int put_default_logpriority() {
  int success = 0;
  systemlog(3, "put_default_logpriority");
  success = set_logpriority(0);
  if (success > 0)
    systemlog(93, "\t[DONE]");
  else
    systemlog(93, "\t[FAILD]");
  return success;
}


x86 assembly (clang, -O0):
<put_default_logpriority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
lea    0xec5(%rip),%rsi
call   1030 <systemlog@plt>
xor    %edi,%edi
call   1040 <set_logpriority@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    116a <put_default_logpriority+0x4a>
mov    $0x5d,%edi
lea    0xeb8(%rip),%rsi
call   1030 <systemlog@plt>
jmp    117b <put_default_logpriority+0x5b>
mov    $0x5d,%edi
lea    0xeaa(%rip),%rsi
call   1030 <systemlog@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_default_logpriority>:
push   %rbx
lea    0xed8(%rip),%rsi
mov    $0x3,%edi
call   1030 <systemlog@plt>
xor    %edi,%edi
call   1040 <set_logpriority@plt>
mov    %eax,%ebx
test   %eax,%eax
lea    0xed4(%rip),%rax
lea    0xed5(%rip),%rsi
cmovg  %rax,%rsi
mov    $0x5d,%edi
call   1030 <systemlog@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"put_default_logpriority\00"
@.str.1 = [8 x i8] c"\09[DONE]\00"
@.str.2 = [9 x i8] c"\09[FAILD]\00"
define i32 @put_default_logpriority() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @systemlog(i32 3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @set_logpriority(i32 0)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @systemlog(i32 93, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @systemlog(i32 93, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [24 x i8] c"put_default_logpriority\00"
@.str.1 = [8 x i8] c"\09[DONE]\00"
@.str.2 = [9 x i8] c"\09[FAILD]\00"
define i32 @put_default_logpriority() {
%1 = tail call i32 @systemlog(i32 3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @set_logpriority(i32 0)
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @systemlog(i32 93, i8* %4)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ dump_mem(void *, int, uintptr_t, int);
void dump_u16(void *buf, int len, uintptr_t addr) {
  dump_mem(buf, len, addr, 2);
}


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

x86 assembly (clang, -O2):
<dump_u16>:
mov    $0x2,%ecx
jmp    1030 <dump_mem@plt>

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

LLVM IR (-O2):
define void @dump_u16(i8* %0, i32 %1, i64 %2) {
%4 = tail call i32 @dump_mem(i8* %0, i32 %1, i64 %2, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TPM1_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void TPM1_IRQHandler(void) {
  TPM1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @TPM1_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @TPM1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @TPM1_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @TPM1_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t cram_into_u8(int val) {
  if (val > 0xfe)
    return 0xfe;
  if (val < 0)
    return 0xff;
  return val;
}


x86 assembly (clang, -O0):
<cram_into_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xfe,-0x8(%rbp)
jle    1120 <cram_into_u8+0x20>
movl   $0xfe,-0x4(%rbp)
jmp    113c <cram_into_u8+0x3c>
cmpl   $0x0,-0x8(%rbp)
jge    1136 <cram_into_u8+0x36>
movl   $0xff,-0x4(%rbp)
jmp    113c <cram_into_u8+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cram_into_u8>:
test   %edi,%edi
mov    $0xff,%ecx
cmovns %edi,%ecx
cmp    $0xff,%edi
mov    $0xfe,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cram_into_u8(i32 %0) {
%2 = icmp sgt i32 %0, 254
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i32 255, i32 %0
%5 = select i1 %2, i32 254, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void write_flashram_commandb() { printf("write_flashram_commandb\n"); }


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"write_flashram_commandb\00"
define void @write_flashram_commandb() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int detectPresence(char *);
int speakertestPresent(void) {
  static int lSpeakertestPresent = -1;
  if (lSpeakertestPresent < 0) {
    lSpeakertestPresent = detectPresence("speaker-test");
  }
  return lSpeakertestPresent;
}


x86 assembly (clang, -O0):
<speakertestPresent>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
jge    1133 <speakertestPresent+0x23>
lea    0xed8(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef5(%rip)
mov    0x2eef(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<speakertestPresent>:
push   %rax
mov    0x2f11(%rip),%eax
test   %eax,%eax
js     111d <speakertestPresent+0xd>
pop    %rcx
ret
lea    0xedc(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef9(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@speakertestPresent.lSpeakertestPresent = internal global i32 -1
@.str = [13 x i8] c"speaker-test\00"
define i32 @speakertestPresent() {
%1 = load i32, i32* @speakertestPresent.lSpeakertestPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @speakertestPresent.lSpeakertestPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @speakertestPresent.lSpeakertestPresent
ret i32 %6
}

LLVM IR (-O2):
@speakertestPresent.lSpeakertestPresent = internal unnamed_addr global i32 -1
@.str = [13 x i8] c"speaker-test\00"
define i32 @speakertestPresent() {
%1 = load i32, i32* @speakertestPresent.lSpeakertestPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @speakertestPresent.lSpeakertestPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ out;

/* Variables and functions */
uint32_t TO_BE32(uint32_t in) {
  uint32_t out = 0;
  unsigned char *pout = (unsigned char *)&out;
  int i;
  for (i = sizeof(out) - 1; i >= 0; --i, in >>= 8)
    pout[i] = in & 0xff;
  return out;
}


x86 assembly (clang, -O0):
<TO_BE32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1153 <TO_BE32+0x53>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    111d <TO_BE32+0x1d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TO_BE32>:
mov    %edi,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @TO_BE32(i32 %0) {
%2 = call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void trace_eval(const char *s, ...) {}


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

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

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

LLVM IR (-O2):
define void @trace_eval(i8* nocapture %0, ...) {
ret void
}
toupper(c) char c;
{ return ((c >= 'a' && c <= 'z') ? c - 32 : c); }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <toupper+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <toupper+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <toupper+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
movsbl %dil,%ecx
shl    $0x18,%edi
add    $0x9fffffff,%edi
lea    -0x20(%rcx),%eax
cmp    $0x1affffff,%edi
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 32
br label %18
15: ; preds = %7, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %11
%19 = phi i32 [ %14, %11 ], [ %17, %15 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = add i32 %2, -1610612737
%5 = icmp ult i32 %4, 452984831
%6 = add nsw i32 %3, -32
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
/* Variables and functions */
long gcd(long, long);
long lcm(long m, long n) { return m * n / gcd(m, n); }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cqto
idiv   %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %rsi,%rbx
imul   %rdi,%rbx
call   1030 <gcd@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1133 <lcm+0x23>
mov    %rbx,%rax
cqto
idiv   %rcx
pop    %rbx
ret
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @lcm(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 = mul nsw i64 %5, %6
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i64 @gcd(i64 %8, i64 %9)
%11 = sdiv i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @lcm(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = tail call i64 @gcd(i64 %0, i64 %1)
%5 = sdiv i64 %3, %4
ret i64 %5
}
int main(void) {
  int counter = 0;
  for (;;) {
    int a;
    counter++;
    if (3 == counter) {
      continue;
    }
    if (counter > 5) {
      break;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jne    112e <main+0x2e>
jmp    1112 <main+0x12>
cmpl   $0x5,-0x8(%rbp)
jle    113d <main+0x3d>
jmp    1142 <main+0x42>
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int sysfs_create_group(struct kobject *k, const struct attribute_group *g) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
%struct.attribute_group = type opaque
define i32 @sysfs_create_group(%struct.kobject* %0, %struct.attribute_group* %1) {
%3 = alloca %struct.kobject*
%4 = alloca %struct.attribute_group*
store %struct.kobject* %0, %struct.kobject** %3
store %struct.attribute_group* %1, %struct.attribute_group** %4
ret i32 0
}

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute_group = type opaque
define i32 @sysfs_create_group(%struct.kobject* nocapture readnone %0, %struct.attribute_group* nocapture readnone %1) {
ret i32 0
}
void lib_service(void) {
  printf("%s: This is a service of the shared library\n", __func__);
}


x86 assembly (clang, -O0):
<lib_service>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf0b(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_service>:
lea    0xee9(%rip),%rdi
lea    0xf0f(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"%s: This is a service of the shared library\0A\00"
@__func__.lib_service = [12 x i8] c"lib_service\00"
define void @lib_service() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.lib_service, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"%s: This is a service of the shared library\0A\00"
@__func__.lib_service = [12 x i8] c"lib_service\00"
define void @lib_service() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.lib_service, i64 0, i64 0))
ret void
}
void tt_complex_set(double *out, const double *in) {
  out[0] = in[0];
  out[1] = in[1];
}


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

x86 assembly (clang, -O2):
<tt_complex_set>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @tt_complex_set(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
ret void
}

LLVM IR (-O2):
define void @tt_complex_set(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 1
store double %5, double* %6
ret void
}
/* Variables and functions */
int cut_value(int, int);
int not_func(int src, int dest, int is_word) {
  (void)src;
  return cut_value(~dest, is_word);
}


x86 assembly (clang, -O0):
<not_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
xor    $0xffffffff,%edi
mov    -0xc(%rbp),%esi
call   1030 <cut_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_func>:
mov    %esi,%edi
not    %edi
mov    %edx,%esi
jmp    1030 <cut_value@plt>

LLVM IR (-O0):
define i32 @not_func(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* %4
%8 = load i32, i32* %5
%9 = xor i32 %8, -1
%10 = load i32, i32* %6
%11 = call i32 @cut_value(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @not_func(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, -1
%5 = tail call i32 @cut_value(i32 %4, i32 %2)
ret i32 %5
}
/* Type definitions */
struct timeval {
  int tv_usec;
  double tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double now() {
  struct timeval t;
  gettimeofday(&t, 0);
  return t.tv_usec / 1e6 + t.tv_sec;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, double }
define double @now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 1.000000e+06
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load double, double* %7
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, double }
define double @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.000000e+06
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = fadd double %9, %7
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, size_t);
void __senderr(void *junk, const char *data, size_t len) {
  (void)junk;
  write(STDERR_FILENO, data, len);
}


x86 assembly (clang, -O0):
<__senderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__senderr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
define void @__senderr(i8* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = load i32, i32* @STDERR_FILENO
%5 = tail call i32 @write(i32 %4, i8* %1, i64 %2)
ret void
}
int stub_math_is_inf(double value) {
  return value != 0.0 && value + value == value;
}


x86 assembly (clang, -O0):
<stub_math_is_inf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jne    112b <stub_math_is_inf+0x2b>
jp     112b <stub_math_is_inf+0x2b>
jmp    1145 <stub_math_is_inf+0x45>
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stub_math_is_inf>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setp   %al
setne  %cl
or     %al,%cl
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
ucomisd %xmm0,%xmm1
setnp  %al
sete   %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @stub_math_is_inf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp une double %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fadd double %6, %7
%9 = load double, double* %2
%10 = fcmp oeq double %8, %9
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @stub_math_is_inf(double %0) {
%2 = fcmp une double %0, 0.000000e+00
%3 = fadd double %0, %0
%4 = fcmp oeq double %3, %0
%5 = and i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int real_cmd(cp)
char *cp;
{ return complex_func(cp, 0); }


x86 assembly (clang, -O0):
<real_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <complex_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_cmd>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <complex_func@plt>

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

LLVM IR (-O2):
define i32 @real_cmd(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @complex_func to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
void *MALLOC(int);
int /*<<< orphan*/ pthread_exit(void *);
void thrd_exit(int res) {
  void *pres = MALLOC(sizeof(int));
  if (pres != (void *)0) {
    *(int *)pres = res;
  }
  pthread_exit(pres);
}


x86 assembly (clang, -O0):
<thrd_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <MALLOC@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <thrd_exit+0x2d>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thrd_exit>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1040 <MALLOC@plt>
test   %rax,%rax
je     1134 <thrd_exit+0x14>
mov    %ebx,(%rax)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @thrd_exit(i32 %0) {
%2 = tail call i8* @MALLOC(i32 4)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = bitcast i8* %2 to i32*
store i32 %0, i32* %5
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @pthread_exit(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void *write_fun(void *args) {
  int fd = *(int *)args;
  int i;
  for (i = 0; i < 2; i++) {
    write(fd, "ciao", 4);
  }
}


x86 assembly (clang, -O0):
<write_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    1158 <write_fun+0x48>
mov    -0x14(%rbp),%edi
lea    0xec0(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112c <write_fun+0x1c>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_fun>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%ebx
lea    0xee3(%rip),%r14
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"ciao\00"
define noalias i8* @write_fun(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret i8* undef
}
unsigned int get_InitHH(unsigned char *pds) { return pds[15]; }


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

x86 assembly (clang, -O2):
<get_InitHH>:
movzbl 0xf(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_InitHH(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 15
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_InitHH(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 15
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ f;
typedef int /*<<< orphan*/ d;
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
int main() {
  short x;
  int a;
  long b;
  float f;
  double d;
  char c;
  printf("short:%d\nint:%d\nlong:%d\nfloat:%d\ndouble:%d\nchar:%d\n", sizeof(x),
         sizeof(a), sizeof(b), sizeof(f), sizeof(d), sizeof(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x2,%esi
mov    $0x4,%r8d
mov    $0x8,%r9d
mov    %r8d,%edx
mov    %r9d,%ecx
movl   $0x1,(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,(%rsp)
lea    0xee1(%rip),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
mov    $0x4,%r8d
mov    $0x8,%r9d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"short:%d\0Aint:%d\0Along:%d\0Afloat:%d\0Adouble:%d\0Achar:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
%5 = alloca float
%6 = alloca double
%7 = alloca i8
store i32 0, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 2, i32 4, i32 8, i32 4, i32 8, i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"short:%d\0Aint:%d\0Along:%d\0Afloat:%d\0Adouble:%d\0Achar:%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 2, i32 4, i32 8, i32 4, i32 8, i32 1)
ret i32 0
}
int main(void) {
  int x, f(int);
  return (x++ + f(x));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 undef)
ret i32 undef
}
int pertence(char x) {
  int i;
  char navios[7] = {'O', '<', '>', '#', 'o', '^', 'v'};
  for (i = 0; i < 7; i++) {
    if (x == navios[i])
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<pertence>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x13(%rbp)
mov    0xeea(%rip),%ax
mov    %ax,-0xf(%rbp)
mov    0xee2(%rip),%al
mov    %al,-0xd(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    116c <pertence+0x6c>
movsbl -0x5(%rbp),%eax
movslq -0xc(%rbp),%rcx
movsbl -0x13(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    1159 <pertence+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1173 <pertence+0x73>
jmp    115e <pertence+0x5e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <pertence+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pertence>:
mov    $0x1,%eax
lea    -0x3c(%rdi),%ecx
cmp    $0x3a,%cl
ja     1121 <pertence+0x21>
movzbl %cl,%ecx
movabs $0x408000400080005,%rdx
bt     %rcx,%rdx
jae    1121 <pertence+0x21>
ret
cmp    $0x23,%dil
je     1120 <pertence+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
@__const.pertence.navios = [7 x i8] c"O<>#o^v"
define i32 @pertence(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
%5 = alloca [7 x i8]
store i8 %0, i8* %3
%6 = bitcast [7 x i8]* %5 to i8*
store i32 0, i32* %4
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %12, %17
br i1 %18, label %19, label %20
19: ; preds = %10
store i32 1, i32* %2
br label %25
20: ; preds = %10
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %7
24: ; preds = %7
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @pertence(i8 signext %0) {
switch i8 %0, label %2 [
i8 79, label %3
i8 60, label %3
i8 62, label %3
i8 35, label %3
i8 111, label %3
i8 94, label %3
i8 118, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int mystery2(const char *s) {
  int x;
  x = 0;
  while (*s != '\0') {
    ++x;
    ++s;
  }
  return x;
}


x86 assembly (clang, -O0):
<mystery2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <mystery2+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <mystery2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystery2>:
cmpb   $0x0,(%rdi)
je     111c <mystery2+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mystery2+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mystery2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int atan(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("pi=%1.10g", 4 * atan(1));
  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    $0x1,%edi
call   1040 <atan@plt>
mov    %eax,%esi
shl    $0x2,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <atan@plt>
lea    0x0(,%rax,4),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"pi=%1.10g\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 = call i32 @atan(i32 1)
%7 = mul nsw i32 4, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"pi=%1.10g\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @atan(i32 1)
%4 = shl nsw i32 %3, 2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void *loop() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <loop+0x9>
jmp    1109 <loop+0x9>

x86 assembly (clang, -O2):
<loop>:
jmp    1100 <loop>

LLVM IR (-O0):
define i8* @loop() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define noalias i8* @loop() {
br label %1
1: ; preds = %0, %1
br label %1
}
void IncDelta(double *Val) {
  if (*Val < (1.0 - 0.001))
    *Val += 0.001;
  else
    *Val -= 0.001;
}


x86 assembly (clang, -O0):
<IncDelta>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1137 <IncDelta+0x37>
mov    -0x8(%rbp),%rax
movsd  0xede(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    114f <IncDelta+0x4f>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xec1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IncDelta>:
movsd  (%rdi),%xmm0
movsd  0xef4(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @IncDelta(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = fcmp olt double %4, 0x3FEFF7CED916872B
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double*, double** %2
%8 = load double, double* %7
%9 = fadd double %8, 1.000000e-03
store double %9, double* %7
br label %14
10: ; preds = %1
%11 = load double*, double** %2
%12 = load double, double* %11
%13 = fsub double %12, 1.000000e-03
store double %13, double* %11
br label %14
14: ; preds = %10, %6
ret void
}

LLVM IR (-O2):
define void @IncDelta(double* nocapture %0) {
%2 = load double, double* %0
%3 = fcmp olt double %2, 0x3FEFF7CED916872B
%4 = select i1 %3, double 1.000000e-03, double -1.000000e-03
%5 = fadd double %2, %4
store double %5, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ finishup();
int /*<<< orphan*/ listline();
int /*<<< orphan*/ skipline();
void fatalerror(char *err_str) {
  error(err_str);
  skipline();
  listline();
  finishup();
}


x86 assembly (clang, -O0):
<fatalerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <error@plt>
mov    $0x0,%al
call   1040 <skipline@plt>
mov    $0x0,%al
call   1030 <listline@plt>
mov    $0x0,%al
call   1050 <finishup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatalerror>:
push   %rax
call   1060 <error@plt>
xor    %eax,%eax
call   1040 <skipline@plt>
xor    %eax,%eax
call   1030 <listline@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <finishup@plt>

LLVM IR (-O0):
define void @fatalerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i8* %3)
%5 = call i32 (...) @skipline()
%6 = call i32 (...) @listline()
%7 = call i32 (...) @finishup()
ret void
}

LLVM IR (-O2):
define void @fatalerror(i8* %0) {
%2 = tail call i32 @error(i8* %0)
%3 = tail call i32 (...) @skipline()
%4 = tail call i32 (...) @listline()
%5 = tail call i32 (...) @finishup()
ret void
}
/* Type definitions */
struct screen_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ play_step(struct screen_t *);
void game_step(struct screen_t *scr) { play_step(scr); }


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

x86 assembly (clang, -O2):
<game_step>:
jmp    1030 <play_step@plt>

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

LLVM IR (-O2):
%struct.screen_t = type { i32 }
define void @game_step(%struct.screen_t* %0) {
%2 = tail call i32 @play_step(%struct.screen_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alloc_init();
int /*<<< orphan*/ log_init(char *);
void libsigcomp_init() {
  log_init("/tmp/libsigcomp.log");
  alloc_init();
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"/tmp/libsigcomp.log\00"
define void @libsigcomp_init() {
%1 = call i32 @log_init(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @alloc_init()
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"/tmp/libsigcomp.log\00"
define void @libsigcomp_init() {
%1 = tail call i32 @log_init(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @alloc_init()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ err;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ np_werror(char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int /*<<< orphan*/ strerror_r(int, char *, int);
void np_suerror(char *s, int ecode) {
  char err[256];
  char buf[512];
  strerror_r(ecode, err, sizeof(err));
  snprintf(buf, sizeof(buf), "%s: %s", s, err);
  np_werror(buf, ecode);
}


x86 assembly (clang, -O0):
<np_suerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x310,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1050 <strerror_r@plt>
lea    -0x310(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    -0x110(%rbp),%r8
mov    $0x200,%esi
lea    0xe8c(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x310(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <np_werror@plt>
add    $0x310,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<np_suerror>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x308,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
mov    %rsp,%r15
mov    %esi,%edi
mov    %r15,%rsi
mov    $0x100,%edx
call   1050 <strerror_r@plt>
lea    0xea4(%rip),%rdx
lea    0x100(%rsp),%r12
mov    %r12,%rdi
mov    $0x200,%esi
mov    %r14,%rcx
mov    %r15,%r8
call   1040 <snprintf@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <np_werror@plt>
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %s\00"
define void @np_suerror(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [256 x i8]
%6 = alloca [512 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%9 = call i32 @strerror_r(i32 %7, i8* %8, i32 256)
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%11 = load i8*, i8** %3
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%13 = call i32 @snprintf(i8* %10, i32 512, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%15 = load i32, i32* %4
%16 = call i32 @np_werror(i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
define void @np_suerror(i8* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = call i32 @strerror_r(i32 %1, i8* %5, i32 256)
%8 = call i32 @snprintf(i8* %6, i32 512, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
%9 = call i32 @np_werror(i8* %6, i32 %1)
ret void
}
/* Variables and functions */
int *bar(int *);
int *f(int a) { return bar(&a); }


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

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <bar@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32* @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32* @bar(i32* %2)
ret i32* %3
}

LLVM IR (-O2):
define i32* @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32* @bar(i32* %2)
ret i32* %3
}
/* Variables and functions */
double aa_ang_norm_pi(double);
double aa_ang_delta(double a, double b) {
  return aa_ang_norm_pi(aa_ang_norm_pi(a) - aa_ang_norm_pi(b));
}


x86 assembly (clang, -O0):
<aa_ang_delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <aa_ang_norm_pi@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <aa_ang_norm_pi@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <aa_ang_norm_pi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_ang_delta>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <aa_ang_norm_pi@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <aa_ang_norm_pi@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
jmp    1030 <aa_ang_norm_pi@plt>

LLVM IR (-O0):
define double @aa_ang_delta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @aa_ang_norm_pi(double %5)
%7 = load double, double* %4
%8 = call double @aa_ang_norm_pi(double %7)
%9 = fsub double %6, %8
%10 = call double @aa_ang_norm_pi(double %9)
ret double %10
}

LLVM IR (-O2):
define double @aa_ang_delta(double %0, double %1) {
%3 = tail call double @aa_ang_norm_pi(double %0)
%4 = tail call double @aa_ang_norm_pi(double %1)
%5 = fsub double %3, %4
%6 = tail call double @aa_ang_norm_pi(double %5)
ret double %6
}