xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ le32toh(int /*<<< orphan*/);
uint32_t ReadLE32(const unsigned char *ptr) {
  return le32toh(*((uint32_t *)ptr));
}


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

x86 assembly (clang, -O2):
<ReadLE32>:
mov    (%rdi),%edi
jmp    1030 <le32toh@plt>

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

LLVM IR (-O2):
define i32 @ReadLE32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @le32toh(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(char *);
int /*<<< orphan*/ sched_yield();
void *run(void *data) {
  printf("Thread....\n");
  sched_yield();
  pthread_exit("world");
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <sched_yield@plt>
lea    0xeb6(%rip),%rdi
call   1050 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rax
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <sched_yield@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Thread....\0A\00"
@.str.1 = [6 x i8] c"world\00"
define i8* @run(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @sched_yield()
%6 = call i32 @pthread_exit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"world\00"
@str = [11 x i8] c"Thread....\00"
define noalias i8* @run(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @sched_yield()
%4 = tail call i32 @pthread_exit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i8* undef
}
int setup_server(unsigned port) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setup_server(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ orgfx_wait(int);
void orgfx_vga_bank_switch() {
  orgfx_wait(1024);
  *((volatile unsigned int *)((0x97000000 + 0x000))) |= 0x00000020;
}


x86 assembly (clang, -O0):
<orgfx_vga_bank_switch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400,%edi
call   1030 <orgfx_wait@plt>
mov    $0x97000000,%eax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    $0x97000000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgfx_vga_bank_switch>:
push   %rax
mov    $0x400,%edi
call   1030 <orgfx_wait@plt>
mov    $0x97000000,%eax
orl    $0x20,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @orgfx_vga_bank_switch() {
%1 = call i32 @orgfx_wait(i32 1024)
%2 = load volatile i32, i32* inttoptr (i64 2533359616 to i32*)
%3 = or i32 %2, 32
store volatile i32 %3, i32* inttoptr (i64 2533359616 to i32*)
ret void
}

LLVM IR (-O2):
define void @orgfx_vga_bank_switch() {
%1 = tail call i32 @orgfx_wait(i32 1024)
%2 = load volatile i32, i32* inttoptr (i64 2533359616 to i32*)
%3 = or i32 %2, 32
store volatile i32 %3, i32* inttoptr (i64 2533359616 to i32*)
ret void
}
char *hello_world() { return "hello world!"; }


x86 assembly (clang, -O0):
<hello_world>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello_world>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world!\00"
define i8* @hello_world() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
define i8* @hello_world() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
int test_imm_95uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x95 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_95uint64_midword_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, 16
%6 = and i64 %5, 149
%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_95uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9764864
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ AccumulatorInitialize();
int /*<<< orphan*/ InstRegisInitialize();
int /*<<< orphan*/ InstrCountInitialize();
int /*<<< orphan*/ MemoryInitialize();
int /*<<< orphan*/ OpCodInitialize();
int /*<<< orphan*/ OperandInitialize();
int /*<<< orphan*/ ValidInstructionsInitialize();
void TurnOnTheSimpletron(void) {
  AccumulatorInitialize();
  InstrCountInitialize();
  InstRegisInitialize();
  OperandInitialize();
  OpCodInitialize();
  ValidInstructionsInitialize();
  MemoryInitialize();
}


x86 assembly (clang, -O0):
<TurnOnTheSimpletron>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AccumulatorInitialize@plt>
mov    $0x0,%al
call   1060 <InstrCountInitialize@plt>
mov    $0x0,%al
call   1090 <InstRegisInitialize@plt>
mov    $0x0,%al
call   1050 <OperandInitialize@plt>
mov    $0x0,%al
call   1070 <OpCodInitialize@plt>
mov    $0x0,%al
call   1040 <ValidInstructionsInitialize@plt>
mov    $0x0,%al
call   1080 <MemoryInitialize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TurnOnTheSimpletron>:
push   %rax
xor    %eax,%eax
call   1030 <AccumulatorInitialize@plt>
xor    %eax,%eax
call   1060 <InstrCountInitialize@plt>
xor    %eax,%eax
call   1090 <InstRegisInitialize@plt>
xor    %eax,%eax
call   1050 <OperandInitialize@plt>
xor    %eax,%eax
call   1070 <OpCodInitialize@plt>
xor    %eax,%eax
call   1040 <ValidInstructionsInitialize@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <MemoryInitialize@plt>

LLVM IR (-O0):
define void @TurnOnTheSimpletron() {
%1 = call i32 (...) @AccumulatorInitialize()
%2 = call i32 (...) @InstrCountInitialize()
%3 = call i32 (...) @InstRegisInitialize()
%4 = call i32 (...) @OperandInitialize()
%5 = call i32 (...) @OpCodInitialize()
%6 = call i32 (...) @ValidInstructionsInitialize()
%7 = call i32 (...) @MemoryInitialize()
ret void
}

LLVM IR (-O2):
define void @TurnOnTheSimpletron() {
%1 = tail call i32 (...) @AccumulatorInitialize()
%2 = tail call i32 (...) @InstrCountInitialize()
%3 = tail call i32 (...) @InstRegisInitialize()
%4 = tail call i32 (...) @OperandInitialize()
%5 = tail call i32 (...) @OpCodInitialize()
%6 = tail call i32 (...) @ValidInstructionsInitialize()
%7 = tail call i32 (...) @MemoryInitialize()
ret void
}
/* Type definitions */
struct mat3 {
  int dummy;
};

/* Variables and functions */
float mat3_minor(struct mat3 *, unsigned int, unsigned int);
float mat3_cofactor(struct mat3 *mat, unsigned int col, unsigned int row) {
  float cofactor = mat3_minor(mat, col, row);
  if ((col + row) % 2 == 0)
    return cofactor;
  return -cofactor;
}


x86 assembly (clang, -O0):
<mat3_cofactor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <mat3_minor@plt>
movss  %xmm0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1157 <mat3_cofactor+0x47>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116e <mat3_cofactor+0x5e>
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3_cofactor>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <mat3_minor@plt>
add    %ebp,%ebx
test   $0x1,%bl
je     112a <mat3_cofactor+0x1a>
xorps  0xed6(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.mat3 = type { i32 }
define float @mat3_cofactor(%struct.mat3* %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca %struct.mat3*
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store %struct.mat3* %0, %struct.mat3** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load %struct.mat3*, %struct.mat3** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call float @mat3_minor(%struct.mat3* %9, i32 %10, i32 %11)
store float %12, float* %8
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = add i32 %13, %14
%16 = urem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %3
%19 = load float, float* %8
store float %19, float* %4
br label %23
20: ; preds = %3
%21 = load float, float* %8
%22 = fneg float %21
store float %22, float* %4
br label %23
23: ; preds = %20, %18
%24 = load float, float* %4
ret float %24
}

LLVM IR (-O2):
%struct.mat3 = type { i32 }
define float @mat3_cofactor(%struct.mat3* %0, i32 %1, i32 %2) {
%4 = tail call float @mat3_minor(%struct.mat3* %0, i32 %1, i32 %2)
%5 = add i32 %2, %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = fneg float %4
%9 = select i1 %7, float %4, float %8
ret float %9
}
/* Variables and functions */
scalar_t__ COND_CS();
int /*<<< orphan*/ EA_AL_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_scs_8_al(void) { m68ki_write_8(EA_AL_8(), COND_CS() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_scs_8_al>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AL_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_CS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_scs_8_al>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AL_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_CS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_scs_8_al() {
%1 = call i32 (...) @EA_AL_8()
%2 = call i64 (...) @COND_CS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_scs_8_al() {
%1 = tail call i32 (...) @EA_AL_8()
%2 = tail call i64 (...) @COND_CS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
int fun906() { return 906; }


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

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

LLVM IR (-O0):
define i32 @fun906() {
ret i32 906
}

LLVM IR (-O2):
define i32 @fun906() {
ret i32 906
}
int main() {
  int i;
  int res = 12;
  goto L1;
  i = 0;
  do {
    if (i > 100) {
    L1:
      res = 0;
      goto L2;
      break;
    }
  } while (i < 100);
L2:
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%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 12, i32* %3
br label %9
4: ; No predecessors!
br label %5
5: ; preds = %11, %4
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 100
br i1 %7, label %8, label %10
8: ; preds = %5
br label %9
9: ; preds = %8, %0
store i32 0, i32* %3
br label %15
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 100
br i1 %13, label %5, label %14
14: ; preds = %11
br label %15
15: ; preds = %14, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
char decode_base(uint32_t code, int bitpos) {
  static const char base[4] = {'A', 'C', 'G', 'T'};
  return base[((code >> bitpos) & 0x3)];
}


x86 assembly (clang, -O0):
<decode_base>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x3,%eax
movslq %eax,%rcx
lea    0xee1(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_base>:
mov    %esi,%ecx
sar    %cl,%edi
and    $0x3,%edi
lea    0xef2(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@decode_base.base = internal constant [4 x i8] c"ACGT"
define signext i8 @decode_base(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = and i32 %7, 3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [4 x i8], [4 x i8]* @decode_base.base, i64 0, i64 %9
%11 = load i8, i8* %10
ret i8 %11
}

LLVM IR (-O2):
@decode_base.base = internal unnamed_addr constant [4 x i8] c"ACGT"
define signext i8 @decode_base(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = and i32 %3, 3
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [4 x i8], [4 x i8]* @decode_base.base, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}
/* Type definitions */
struct sembuf {
  int sem_op;
  scalar_t__ sem_num;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void myop(int id, int val) {
  struct sembuf sb;
  sb.sem_flg = 0;
  sb.sem_num = 0;
  sb.sem_op = val;
  semop(id, &sb, 1);
}


x86 assembly (clang, -O0):
<myop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myop>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
mov    %esi,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i64, i64 }
define void @myop(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i64 0, i64* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = call i32 @semop(i32 %10, %struct.sembuf* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i64, i64 }
define void @myop(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
%7 = bitcast i64* %5 to i8*
store i32 %1, i32* %6
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long strtol(char *, char **, int);
void test2(char *array, char *endptr) {
  array[2] = 'z';
  long r = strtol(array, &endptr, 35);
  assert(array + 2 == endptr);
  assert(r == 37);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x7a,0x2(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x23,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x25,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,(%rsp)
lea    0x2(%rdi),%r14
movb   $0x7a,0x2(%rdi)
mov    %rsp,%rsi
mov    $0x23,%edx
call   1040 <strtol@plt>
mov    %rax,%rbx
xor    %edi,%edi
cmp    (%rsp),%r14
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x25,%rbx
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 2
store i8 122, i8* %7
%8 = load i8*, i8** %3
%9 = call i64 @strtol(i8* %8, i8** %4, i32 35)
store i64 %9, i64* %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8*, i8** %4
%13 = icmp eq i8* %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i64, i64* %5
%17 = icmp eq i64 %16, 37
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}

LLVM IR (-O2):
define void @test2(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = getelementptr inbounds i8, i8* %0, i64 2
store i8 122, i8* %4
%5 = call i64 @strtol(i8* %0, i8** %3, i32 35)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %4, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp eq i64 %5, 37
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
int _dbg_level(unsigned l) { return 0 >= l; }


x86 assembly (clang, -O0):
<_dbg_level>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dbg_level>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @_dbg_level(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void dbg_hcs_params(struct ehci_hcd *ehci, char *label) {}


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

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

LLVM IR (-O0):
%struct.ehci_hcd = type opaque
define void @dbg_hcs_params(%struct.ehci_hcd* %0, i8* %1) {
%3 = alloca %struct.ehci_hcd*
%4 = alloca i8*
store %struct.ehci_hcd* %0, %struct.ehci_hcd** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.ehci_hcd = type opaque
define void @dbg_hcs_params(%struct.ehci_hcd* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ factor(char const *, size_t *);
int term_r(char const *, size_t *, int /*<<< orphan*/);
int term(const char *expr_str, size_t *cursor) {
  return term_r(expr_str, cursor, factor(expr_str, cursor));
}


x86 assembly (clang, -O0):
<term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <factor@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <term_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <factor@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <term_r@plt>

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

LLVM IR (-O2):
define i32 @term(i8* %0, i64* %1) {
%3 = tail call i32 @factor(i8* %0, i64* %1)
%4 = tail call i32 @term_r(i8* %0, i64* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lstat(char *, struct stat *);
int main(void) {
  struct stat buf;
  lstat("tata", &buf);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <lstat@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [5 x i8] c"tata\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = call i32 @lstat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [5 x i8] c"tata\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @lstat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
ret i32 0
}
/* Type definitions */
struct event_base {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_base_loopexit(struct event_base *,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
void handle_sigint(int sig, short ev, void *arg) {
  struct event_base *base = arg;
  printf("Caught signal %d\n", sig);
  event_base_loopexit(base, NULL);
}


x86 assembly (clang, -O0):
<handle_sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <event_base_loopexit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_sigint>:
push   %rbx
mov    %rdx,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <event_base_loopexit@plt>

LLVM IR (-O0):
%struct.event_base = type { i32 }
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @handle_sigint(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.event_base*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.event_base*
store %struct.event_base* %9, %struct.event_base** %7
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load %struct.event_base*, %struct.event_base** %7
%13 = call i32 @event_base_loopexit(%struct.event_base* %12, i32* null)
ret void
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @handle_sigint(i32 %0, i16 signext %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.event_base*
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @event_base_loopexit(%struct.event_base* %4, i32* null)
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

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


x86 assembly (clang, -O0):
<getMilliseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xebc(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMilliseconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0xecb(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
%struct.timezone = type { i32 }
define double @getMilliseconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+03
%10 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+03, double %9)
ret double %10
}
/* Variables and functions */
scalar_t__ getErrString(unsigned int, char *);
int /*<<< orphan*/ printf(char *, char *);
int printErr(unsigned int err) {
  char errStr[60];
  if (getErrString(err, errStr) == 0) {
    printf("%s\n", errStr);
    return 0;
  }
  return 2;
}


x86 assembly (clang, -O0):
<printErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x50(%rbp),%rsi
call   1030 <getErrString@plt>
cmp    $0x0,%rax
jne    115d <printErr+0x3d>
lea    -0x50(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1164 <printErr+0x44>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printErr>:
sub    $0x48,%rsp
mov    %rsp,%rsi
call   1030 <getErrString@plt>
mov    %rax,%rcx
mov    $0x2,%eax
test   %rcx,%rcx
je     113e <printErr+0x1e>
add    $0x48,%rsp
ret
lea    0xebb(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @printErr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [60 x i8]
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = getelementptr inbounds [60 x i8], [60 x i8]* %4, i64 0, i64 0
%7 = call i64 @getErrString(i32 %5, i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = getelementptr inbounds [60 x i8], [60 x i8]* %4, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 2, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @printErr(i32 %0) {
%2 = alloca [60 x i8]
%3 = getelementptr inbounds [60 x i8], [60 x i8]* %2, i64 0, i64 0
%4 = call i64 @getErrString(i32 %0, i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 0, %6 ], [ 2, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ init_rot13();
void _initrot13(int *w) { init_rot13(); }


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

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

LLVM IR (-O0):
define void @_initrot13(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @init_rot13()
ret void
}

LLVM IR (-O2):
define void @_initrot13(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @init_rot13()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ init_current_volume();
int /*<<< orphan*/ load_mbr();
int main(int argc, char **argv) {
  init();
  load_mbr();
  init_current_volume();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1050 <load_mbr@plt>
mov    $0x0,%al
call   1030 <init_current_volume@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <load_mbr@plt>
xor    %eax,%eax
call   1030 <init_current_volume@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @init()
%6 = call i32 (...) @load_mbr()
%7 = call i32 (...) @init_current_volume()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @load_mbr()
%5 = tail call i32 (...) @init_current_volume()
ret i32 0
}
/* Type definitions */
struct server {
  int dummy;
};
struct imapmsg {
  int dummy;
};
struct folder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ start_fetch(struct server *, struct folder *);
void imap_deleteok(struct imapmsg *msg, struct server *sptr,
                   struct folder *fptr) {
  start_fetch(sptr, fptr);
}


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

x86 assembly (clang, -O2):
<imap_deleteok>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <start_fetch@plt>

LLVM IR (-O0):
%struct.imapmsg = type { i32 }
%struct.server = type { i32 }
%struct.folder = type { i32 }
define void @imap_deleteok(%struct.imapmsg* %0, %struct.server* %1, %struct.folder* %2) {
%4 = alloca %struct.imapmsg*
%5 = alloca %struct.server*
%6 = alloca %struct.folder*
store %struct.imapmsg* %0, %struct.imapmsg** %4
store %struct.server* %1, %struct.server** %5
store %struct.folder* %2, %struct.folder** %6
%7 = load %struct.server*, %struct.server** %5
%8 = load %struct.folder*, %struct.folder** %6
%9 = call i32 @start_fetch(%struct.server* %7, %struct.folder* %8)
ret void
}

LLVM IR (-O2):
%struct.imapmsg = type { i32 }
%struct.server = type { i32 }
%struct.folder = type { i32 }
define void @imap_deleteok(%struct.imapmsg* nocapture readnone %0, %struct.server* %1, %struct.folder* %2) {
%4 = tail call i32 @start_fetch(%struct.server* %1, %struct.folder* %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ parent;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
unsigned long get_XCreateWindowEvent_parent(void *_p) {
  return (unsigned long)((XCreateWindowEvent *)_p)->parent;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XCreateWindowEvent_parent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XCreateWindowEvent_parent(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct gsm_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct gsm_state *);
void gsm_destroy(struct gsm_state *S) {
  if (S != NULL)
    free(S);
}


x86 assembly (clang, -O0):
<gsm_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <gsm_destroy+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_destroy>:
test   %rdi,%rdi
je     111a <gsm_destroy+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.gsm_state = type { i32 }
define void @gsm_destroy(%struct.gsm_state* %0) {
%2 = alloca %struct.gsm_state*
store %struct.gsm_state* %0, %struct.gsm_state** %2
%3 = load %struct.gsm_state*, %struct.gsm_state** %2
%4 = icmp ne %struct.gsm_state* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.gsm_state*, %struct.gsm_state** %2
%7 = call i32 @free(%struct.gsm_state* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.gsm_state = type { i32 }
define void @gsm_destroy(%struct.gsm_state* %0) {
%2 = icmp eq %struct.gsm_state* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.gsm_state* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void siag_puts(char *p) {}


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

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

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

LLVM IR (-O2):
define void @siag_puts(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int cli_send_feedback(int client_fd, char *msg) {
  if ((send(client_fd, msg, strlen(msg), 0)) <= 0) {
    perror("[cli_manager]: send");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cli_send_feedback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0x0,%rax
jg     1188 <cli_send_feedback+0x58>
lea    0xe89(%rip),%rdi
call   1050 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    118f <cli_send_feedback+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_send_feedback>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
xor    %r14d,%r14d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
test   %rax,%rax
jle    115f <cli_send_feedback+0x2f>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe9a(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%r14d
jmp    1157 <cli_send_feedback+0x27>

LLVM IR (-O0):
@.str = [20 x i8] c"[cli_manager]: send\00"
define i32 @cli_send_feedback(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
%10 = call i64 @send(i32 %6, i8* %7, i32 %9, i32 0)
%11 = icmp sle i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [20 x i8] c"[cli_manager]: send\00"
define i32 @cli_send_feedback(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @send(i32 %0, i8* %1, i32 %3, i32 0)
%5 = icmp slt i64 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
float hgetdecender();
float hgetdecender_() { return (hgetdecender()); }


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

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

LLVM IR (-O0):
define float @hgetdecender_() {
%1 = call float (...) @hgetdecender()
ret float %1
}

LLVM IR (-O2):
define float @hgetdecender_() {
%1 = tail call float (...) @hgetdecender()
ret float %1
}
/* Variables and functions */
int wcsulexe(char const *, int *, double *, double *, int);
int wcsulex(const char unitstr[], int *func, double *scale, double units[17]) {
  return wcsulexe(unitstr, func, scale, units, 0x0);
}


x86 assembly (clang, -O0):
<wcsulex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <wcsulexe@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsulex>:
xor    %r8d,%r8d
jmp    1030 <wcsulexe@plt>

LLVM IR (-O0):
define i32 @wcsulex(i8* %0, i32* %1, double* %2, double* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca double*
%8 = alloca double*
store i8* %0, i8** %5
store i32* %1, i32** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
%13 = call i32 @wcsulexe(i8* %9, i32* %10, double* %11, double* %12, i32 0)
ret i32 %13
}

LLVM IR (-O2):
define i32 @wcsulex(i8* %0, i32* %1, double* %2, double* %3) {
%5 = tail call i32 @wcsulexe(i8* %0, i32* %1, double* %2, double* %3, i32 0)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_adds_pu16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_adds_pu16(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_adds_pu16@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_adds_pu16(i32 %0, i32 %1)
ret i32 %3
}
void mvVecAdd2(float *r, const float *a, const float *b) {
  r[0] = a[0] + b[0];
  r[1] = a[1] + b[1];
}


x86 assembly (clang, -O0):
<mvVecAdd2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecAdd2>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @mvVecAdd2(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
ret void
}
int calculate_score(int points, long time_sec) {
  return points * 10 - time_sec * 2;
}


x86 assembly (clang, -O0):
<calculate_score>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0xa,-0x4(%rbp),%eax
cltq
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_score>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
add    %esi,%esi
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @calculate_score(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = mul nsw i32 %5, 10
%7 = sext i32 %6 to i64
%8 = load i64, i64* %4
%9 = mul nsw i64 %8, 2
%10 = sub nsw i64 %7, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @calculate_score(i32 %0, i64 %1) {
%3 = mul nsw i32 %0, 10
%4 = trunc i64 %1 to i32
%5 = mul i32 %4, -2
%6 = add i32 %5, %3
ret i32 %6
}
void ff_hevc_put_hevc_uni_epel_v48_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v48_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void clearScreen(void) { system("clear"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @clearScreen() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int g(int a, int b, int c) {
  if (a != 0)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <g+0x22>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <g+0x28>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
ret i32 %5
}
/* Variables and functions */
char *utf8_next_char(char const *);
int utf8_strlen(char const *p) {
  int i;
  if (!p)
    return 0;
  for (i = 0; *p; i++) {
    p = utf8_next_char(p);
  }
  return i;
}


x86 assembly (clang, -O0):
<utf8_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <utf8_strlen+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1168 <utf8_strlen+0x58>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <utf8_strlen+0x52>
mov    -0x10(%rbp),%rdi
call   1030 <utf8_next_char@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <utf8_strlen+0x2a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_strlen>:
push   %rbx
xor    %ebx,%ebx
test   %rdi,%rdi
je     1140 <utf8_strlen+0x30>
mov    %rdi,%rax
cmpb   $0x0,(%rdi)
je     1140 <utf8_strlen+0x30>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,%rdi
call   1030 <utf8_next_char@plt>
add    $0x1,%ebx
cmpb   $0x0,(%rax)
jne    1130 <utf8_strlen+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @utf8_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = tail call i8* @utf8_next_char(i8* %8)
%10 = add nuw nsw i32 %7, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}