xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int num = 0;
  while (num <= 100) {
    printf("value of variable num is: %d\n", num);
    if (num == 2) {
      break;
    }
    num++;
  }
  printf("Out of while-loop");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     115e <main+0x4e>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1150 <main+0x40>
jmp    115e <main+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"value of variable num is: %d\0A\00"
@.str.1 = [18 x i8] c"Out of while-loop\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %6
br label %15
12: ; preds = %6
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %11, %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"value of variable num is: %d\0A\00"
@.str.1 = [18 x i8] c"Out of while-loop\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _dictFree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<_dictFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_dictFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void copy_elements(void *p_source_data, size_t source_index, void *p_dest_data,
                   size_t dest_index, size_t element_size,
                   size_t num_elements) {
  void *p_source_address = p_source_data + (source_index * element_size);
  void *p_dest_address = p_dest_data + (dest_index * element_size);
  memcpy(p_dest_address, p_source_address, element_size * num_elements);
}


x86 assembly (clang, -O0):
<copy_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   -0x28(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x28(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x28(%rbp),%rdx
imul   -0x30(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_elements>:
imul   %r8,%rsi
add    %rdi,%rsi
imul   %r8,%rcx
lea    (%rcx,%rdx,1),%rdi
imul   %r8,%r9
mov    %r9,%rdx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy_elements(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i8*
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%15 = load i8*, i8** %7
%16 = load i64, i64* %8
%17 = load i64, i64* %11
%18 = mul i64 %16, %17
%19 = getelementptr i8, i8* %15, i64 %18
store i8* %19, i8** %13
%20 = load i8*, i8** %9
%21 = load i64, i64* %10
%22 = load i64, i64* %11
%23 = mul i64 %21, %22
%24 = getelementptr i8, i8* %20, i64 %23
store i8* %24, i8** %14
%25 = load i8*, i8** %14
%26 = load i8*, i8** %13
%27 = load i64, i64* %11
%28 = load i64, i64* %12
%29 = mul i64 %27, %28
%30 = call i32 @memcpy(i8* %25, i8* %26, i64 %29)
ret void
}

LLVM IR (-O2):
define void @copy_elements(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4, i64 %5) {
%7 = mul i64 %4, %1
%8 = getelementptr i8, i8* %0, i64 %7
%9 = mul i64 %4, %3
%10 = getelementptr i8, i8* %2, i64 %9
%11 = mul i64 %5, %4
%12 = tail call i32 @memcpy(i8* %10, i8* %8, i64 %11)
ret void
}
int test_imm_F5int8_reg(signed char val) {
  return ((val) & (-0xF5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F5int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -245
%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_F5int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -245
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_6Cint32_reg(int val) { return ((val) & (0x6C << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_6Cint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x6c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_6Cint32_reg(i32 %0) {
%2 = and i32 %0, 108
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int params__is_sign_char(char c) {
  int ret = 0;
  ret |= (c == '+' || c == '-');
  return ret;
}


x86 assembly (clang, -O0):
<params__is_sign_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x9(%rbp)
je     1130 <params__is_sign_char+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<params__is_sign_char>:
add    $0xd5,%dil
xor    %eax,%eax
test   $0xfd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @params__is_sign_char(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 43
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ true, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @params__is_sign_char(i8 signext %0) {
%2 = icmp eq i8 %0, 43
%3 = icmp eq i8 %0, 45
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int delay_ms(int);
int delay_s(unsigned int s) { return delay_ms(1000 * s); }


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

x86 assembly (clang, -O2):
<delay_s>:
imul   $0x3e8,%edi,%edi
jmp    1030 <delay_ms@plt>

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

LLVM IR (-O2):
define i32 @delay_s(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @delay_ms(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_PW1_PIN() { clear_io_bit(0x40, 1); }


x86 assembly (clang, -O0):
<TOSH_CLR_PW1_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0x1,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_PW1_PIN>:
mov    $0x40,%edi
mov    $0x1,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_PW1_PIN() {
%1 = call i32 @clear_io_bit(i32 64, i32 1)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_PW1_PIN() {
%1 = tail call i32 @clear_io_bit(i32 64, i32 1)
ret void
}
int test_imm_18uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x18 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_18uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 103079215104
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *p = s;
  while (*s)
    ++s;
  return s - p;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
unsigned char cpu_get_r8(struct cpu *, int);
unsigned short cpu_get_r16(struct cpu *cpu, int ri) {
  unsigned char l = cpu_get_r8(cpu, ri + 0);
  unsigned char h = cpu_get_r8(cpu, ri + 1);
  return (((unsigned short)((unsigned char)(l))) |
          (((unsigned short)((unsigned char)(h))) << 8));
}


x86 assembly (clang, -O0):
<cpu_get_r16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x0,%esi
call   1030 <cpu_get_r8@plt>
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <cpu_get_r8@plt>
mov    %al,-0xe(%rbp)
movzbl -0xd(%rbp),%eax
movzwl %ax,%eax
movzbl -0xe(%rbp),%ecx
movzwl %cx,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_get_r16>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <cpu_get_r8@plt>
mov    %eax,%ebp
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <cpu_get_r8@plt>
movzbl %bpl,%ecx
movzbl %al,%eax
shl    $0x8,%eax
or     %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.cpu = type { i32 }
define zeroext i16 @cpu_get_r16(%struct.cpu* %0, i32 %1) {
%3 = alloca %struct.cpu*
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store %struct.cpu* %0, %struct.cpu** %3
store i32 %1, i32* %4
%7 = load %struct.cpu*, %struct.cpu** %3
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 0
%10 = call zeroext i8 @cpu_get_r8(%struct.cpu* %7, i32 %9)
store i8 %10, i8* %5
%11 = load %struct.cpu*, %struct.cpu** %3
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
%14 = call zeroext i8 @cpu_get_r8(%struct.cpu* %11, i32 %13)
store i8 %14, i8* %6
%15 = load i8, i8* %5
%16 = zext i8 %15 to i16
%17 = zext i16 %16 to i32
%18 = load i8, i8* %6
%19 = zext i8 %18 to i16
%20 = zext i16 %19 to i32
%21 = shl i32 %20, 8
%22 = or i32 %17, %21
%23 = trunc i32 %22 to i16
ret i16 %23
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define zeroext i16 @cpu_get_r16(%struct.cpu* %0, i32 %1) {
%3 = tail call zeroext i8 @cpu_get_r8(%struct.cpu* %0, i32 %1)
%4 = add nsw i32 %1, 1
%5 = tail call zeroext i8 @cpu_get_r8(%struct.cpu* %0, i32 %4)
%6 = zext i8 %3 to i16
%7 = zext i8 %5 to i16
%8 = shl nuw i16 %7, 8
%9 = or i16 %8, %6
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ logcat(char *);
int close_socket(int socket_fd) {
  logcat("close connect with server !\n ");
  close(socket_fd);
  return 0;
}


x86 assembly (clang, -O0):
<close_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <logcat@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_socket>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <logcat@plt>
mov    %ebx,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"close connect with server !\0A \00"
define i32 @close_socket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @logcat(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"close connect with server !\0A \00"
define i32 @close_socket(i32 %0) {
%2 = tail call i32 @logcat(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @close(i32 %0)
ret i32 0
}
/* Type definitions */
struct t_relay_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ relay_dogechat_protocol_recv(struct t_relay_client *,
                                                char const *);
void relay_dogechat_recv(struct t_relay_client *client, const char *data) {
  relay_dogechat_protocol_recv(client, data);
}


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

x86 assembly (clang, -O2):
<relay_dogechat_recv>:
jmp    1030 <relay_dogechat_protocol_recv@plt>

LLVM IR (-O0):
%struct.t_relay_client = type { i32 }
define void @relay_dogechat_recv(%struct.t_relay_client* %0, i8* %1) {
%3 = alloca %struct.t_relay_client*
%4 = alloca i8*
store %struct.t_relay_client* %0, %struct.t_relay_client** %3
store i8* %1, i8** %4
%5 = load %struct.t_relay_client*, %struct.t_relay_client** %3
%6 = load i8*, i8** %4
%7 = call i32 @relay_dogechat_protocol_recv(%struct.t_relay_client* %5, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.t_relay_client = type { i32 }
define void @relay_dogechat_recv(%struct.t_relay_client* %0, i8* %1) {
%3 = tail call i32 @relay_dogechat_protocol_recv(%struct.t_relay_client* %0, i8* %1)
ret void
}
/* Variables and functions */
unsigned long long fib_internal(unsigned int, int, int);
unsigned long long fib(unsigned int n) { return fib_internal(n, 1, 1); }


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

x86 assembly (clang, -O2):
<fib>:
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <fib_internal@plt>

LLVM IR (-O0):
define i64 @fib(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @fib_internal(i32 %3, i32 1, i32 1)
ret i64 %4
}

LLVM IR (-O2):
define i64 @fib(i32 %0) {
%2 = tail call i64 @fib_internal(i32 %0, i32 1, i32 1)
ret i64 %2
}
void strength_result8(int *data) {
  int i = 0;
  int n = 0;
  do {
    int j = i + 1;
    n = n + 21;
    data[data[2]] = j;
    i = j + 1;
    n = n + 21;
  } while (n < data[3]);
}


x86 assembly (clang, -O0):
<strength_result8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x15,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x15,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     1116 <strength_result8+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_result8>:
xor    %eax,%eax
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
movslq 0x8(%rdi),%rdx
mov    %ecx,(%rdi,%rdx,4)
add    $0x2a,%eax
add    $0x2,%ecx
cmp    0xc(%rdi),%eax
jl     1110 <strength_result8+0x10>
ret

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

LLVM IR (-O2):
define void @strength_result8(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = getelementptr inbounds i32, i32* %0, i64 3
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %12, %4 ]
%6 = phi i32 [ 0, %1 ], [ %11, %4 ]
%7 = or i32 %6, 1
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %7, i32* %10
%11 = add nuw nsw i32 %6, 2
%12 = add nuw nsw i32 %5, 42
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %4, label %15
15: ; preds = %4
ret void
}
int decode_varint(char *data, int *decoded_bytes) {
  int i = -1;
  int value = 0;
  do {
    char byte;
    i++;
    byte = data[i] & 0x7F;
    value += byte << (7 * i);
  } while (data[i] & 0x80 != 0);
  *decoded_bytes = i;
  return value;
}


x86 assembly (clang, -O0):
<decode_varint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0x7f,%eax
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
imul   $0x7,-0x14(%rbp),%ecx
shl    %cl,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    111a <decode_varint+0x1a>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_varint>:
mov    $0xffffffff,%r9d
xor    %ecx,%ecx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%r8d
mov    %r8d,%edx
and    $0x7f,%edx
shl    %cl,%edx
add    %edx,%eax
add    $0x1,%r9d
add    $0x7,%ecx
add    $0x1,%rdi
test   $0x1,%r8b
jne    1110 <decode_varint+0x10>
mov    %r9d,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @decode_varint(i8* nocapture %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %6, %3 ], [ -1, %2 ]
%5 = phi i32 [ %14, %3 ], [ 0, %2 ]
%6 = add nsw i64 %4, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = and i8 %8, 127
%10 = zext i8 %9 to i32
%11 = trunc i64 %6 to i32
%12 = mul i32 %11, 7
%13 = shl i32 %10, %12
%14 = add nsw i32 %13, %5
%15 = and i8 %8, 1
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %3
17: ; preds = %3
%18 = trunc i64 %6 to i32
store i32 %18, i32* %1
ret i32 %14
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn33() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn33");
  return result;
}


x86 assembly (clang, -O0):
<fn33>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn33>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn33\00"
define i8* @fn33() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn33\00"
define i8* @fn33() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int gcd(int x, int y) {
  if (x == 0)
    return y;
  return gcd(y % x, x);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcd+0x37>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
test   %edi,%edi
je     111d <gcd+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(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 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %5
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = load i32, i32* %4
%15 = call i32 @gcd(i32 %13, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %6, %4 ]
ret i32 %10
}
void d2i_X509_VAL(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_X509_VAL() {
ret void
}
/* Variables and functions */
int f10(int *);
int f11(int *p) { return f10(p); }


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

x86 assembly (clang, -O2):
<f11>:
jmp    1030 <f10@plt>

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

LLVM IR (-O2):
define i32 @f11(i32* %0) {
%2 = tail call i32 @f10(i32* %0)
ret i32 %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int pwcmp_check(const char *plain, const char *encod) {
  return strcmp(plain, encod);
}


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

x86 assembly (clang, -O2):
<pwcmp_check>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @pwcmp_check(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ g(float, int);
int f(float a) {
  if (a++ > 0)
    g(a, 3);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xed6(%rip),%xmm2
movaps %xmm0,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,-0x8(%rbp)
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1151 <f+0x41>
movss  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    112f <f+0x1f>
push   %rax
addss  0xedf(%rip),%xmm0
mov    $0x3,%edi
call   1030 <g@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @f(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fadd float %4, 1.000000e+00
store float %5, float* %3
%6 = fcmp ogt float %4, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %3
%9 = call i32 @g(float %8, i32 3)
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @f(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd float %0, 1.000000e+00
%5 = tail call i32 @g(float %4, i32 3)
br label %6
6: ; preds = %3, %1
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int64_t;

/* Variables and functions */
int var_put_u64(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int);
int var_put_s64(uint8_t *cp, const uint8_t *endp, int64_t i) {
  return var_put_u64(cp, endp, (i << 1) ^ (i >> 63));
}


x86 assembly (clang, -O0):
<var_put_s64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
mov    -0x14(%rbp),%eax
mov    $0x3f,%ecx
sar    %cl,%eax
xor    %eax,%edx
call   1030 <var_put_u64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_put_s64>:
jmp    1030 <var_put_u64@plt>

LLVM IR (-O0):
define i32 @var_put_s64(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 = load i32, i32* %6
%10 = shl i32 %9, 1
%11 = load i32, i32* %6
%12 = ashr i32 %11, 63
%13 = xor i32 %10, %12
%14 = call i32 @var_put_u64(i32* %7, i32* %8, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @var_put_s64(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @var_put_u64(i32* %0, i32* %1, i32 poison)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ beep();
int /*<<< orphan*/ bodymsg(char *);
void func1(void) {
  beep();
  bodymsg("One beep! ");
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <beep@plt>
lea    0xece(%rip),%rdi
call   1030 <bodymsg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rax
xor    %eax,%eax
call   1040 <beep@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <bodymsg@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"One beep! \00"
define void @func1() {
%1 = call i32 (...) @beep()
%2 = call i32 @bodymsg(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"One beep! \00"
define void @func1() {
%1 = tail call i32 (...) @beep()
%2 = tail call i32 @bodymsg(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("%0#x", num);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%0#x\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void crvn_(n, geom) int *n;
float geom[][3];
{ crvn((long)*n, geom); }


x86 assembly (clang, -O0):
<crvn_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <crvn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crvn_>:
movslq (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <crvn@plt>

LLVM IR (-O0):
define void @crvn_(i32* %0, [3 x float]* %1) {
%3 = alloca i32*
%4 = alloca [3 x float]*
store i32* %0, i32** %3
store [3 x float]* %1, [3 x float]** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = load [3 x float]*, [3 x float]** %4
%9 = call i32 (i64, [3 x float]*, ...) bitcast (i32 (...)* @crvn to i32 (i64, [3 x float]*, ...)*)(i64 %7, [3 x float]* %8)
ret void
}

LLVM IR (-O2):
define void @crvn_(i32* nocapture %0, [3 x float]* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = tail call i32 (i64, [3 x float]*, ...) bitcast (i32 (...)* @crvn to i32 (i64, [3 x float]*, ...)*)(i64 %4, [3 x float]* %1)
ret void
}
void *GI2C1_GetSemaphore(void) { return 0x00u; }


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

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

LLVM IR (-O0):
define i8* @GI2C1_GetSemaphore() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @GI2C1_GetSemaphore() {
ret i8* null
}
void RTMpGetSet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMpGetSet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg, bool isSysError) {
  if (isSysError) {
    perror(msg);
  } else {
    fprintf(stderr, "%s", msg);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1157 <error+0x27>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    1170 <error+0x40>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
test   %esi,%esi
je     114a <error+0x1a>
mov    %rdx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
br label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %10, %7
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @error(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
br label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %6, %4
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ CPUirqe();
void IntMasterIRQEnable(void) { CPUirqe(); }


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

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

LLVM IR (-O0):
define void @IntMasterIRQEnable() {
%1 = call i32 (...) @CPUirqe()
ret void
}

LLVM IR (-O2):
define void @IntMasterIRQEnable() {
%1 = tail call i32 (...) @CPUirqe()
ret void
}
int g(p)
int *p;
{ return *p; }


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

x86 assembly (clang, -O2):
<g>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int getpid() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @getpid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tapChar(char);
void tapNibbleHex(unsigned char v) {
  v = v & 0xf;
  if (v < 10) {
    tapChar('0' + v);
  } else {
    tapChar('A' + (v - 10));
  }
}


x86 assembly (clang, -O0):
<tapNibbleHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jge    1149 <tapNibbleHex+0x39>
movzbl -0x1(%rbp),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <tapChar@plt>
jmp    115b <tapNibbleHex+0x4b>
movzbl -0x1(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
movsbl %al,%edi
call   1030 <tapChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tapNibbleHex>:
and    $0xf,%dil
lea    0x37(%rdi),%eax
lea    0x30(%rdi),%ecx
cmp    $0xa,%dil
movzbl %cl,%ecx
movzbl %al,%eax
cmovb  %ecx,%eax
movzbl %al,%edi
jmp    1030 <tapChar@plt>

LLVM IR (-O0):
define void @tapNibbleHex(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 15
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = add nsw i32 48, %12
%14 = trunc i32 %13 to i8
%15 = call i32 @tapChar(i8 signext %14)
br label %23
16: ; preds = %1
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = sub nsw i32 %18, 10
%20 = add nsw i32 65, %19
%21 = trunc i32 %20 to i8
%22 = call i32 @tapChar(i8 signext %21)
br label %23
23: ; preds = %16, %10
ret void
}

LLVM IR (-O2):
define void @tapNibbleHex(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = icmp ult i8 %2, 10
%4 = add nuw nsw i8 %2, 55
%5 = or i8 %2, 48
%6 = select i1 %3, i8 %5, i8 %4
%7 = tail call i32 @tapChar(i8 signext %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_idxset_iterate() {
  printf("NOT IMPLEMENTED:"
         "pa_idxset_iterate"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_idxset_iterate\0A\00"
define i32 @pa_idxset_iterate() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_idxset_iterate\00"
define i32 @pa_idxset_iterate() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int _safe_syscall(int r, const char *file, int line, int err_upbound) {
  if (r < err_upbound) {
    fprintf(stderr, "Error in %s:%d, ", file, line);
    perror("");
    abort();
  }
  return r;
}


x86 assembly (clang, -O0):
<_safe_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1180 <_safe_syscall+0x50>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xe9c(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_safe_syscall>:
cmp    %ecx,%edi
jl     1137 <_safe_syscall+0x7>
mov    %edi,%eax
ret
push   %rax
mov    %edx,%eax
mov    %rsi,%rdx
mov    0x2e9c(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb3(%rip),%rsi
mov    %eax,%ecx
call   1040 <fprintf@plt>
lea    0xeb5(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Error in %s:%d, \00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @_safe_syscall(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %4
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15)
%17 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %4
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Error in %s:%d, \00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @_safe_syscall(i32 returned %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %0, %3
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
%9 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %4
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ FEDI_Quit();
scalar_t__ TTY_IsCaptured();
int /*<<< orphan*/ TTY_Release();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void terminationHandler(int signum) {
  FEDI_Quit();
  if (TTY_IsCaptured()) {
    TTY_Release();
  }
  printf("\n");
  exit(0);
}


x86 assembly (clang, -O0):
<terminationHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <FEDI_Quit@plt>
mov    $0x0,%al
call   1030 <TTY_IsCaptured@plt>
cmp    $0x0,%rax
je     117a <terminationHandler+0x2a>
mov    $0x0,%al
call   1060 <TTY_Release@plt>
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<terminationHandler>:
push   %rax
xor    %eax,%eax
call   1050 <FEDI_Quit@plt>
xor    %eax,%eax
call   1040 <TTY_IsCaptured@plt>
test   %rax,%rax
je     116b <terminationHandler+0x1b>
xor    %eax,%eax
call   1060 <TTY_Release@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @terminationHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @FEDI_Quit()
%4 = call i64 (...) @TTY_IsCaptured()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @TTY_Release()
br label %8
8: ; preds = %6, %1
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @terminationHandler(i32 %0) {
%2 = tail call i32 (...) @FEDI_Quit()
%3 = tail call i64 (...) @TTY_IsCaptured()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @TTY_Release()
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @exit(i32 0)
unreachable
}