xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printCounting(int count) {
  int i;
  for (i = 0; i < count; i++) {
    printf("%d\t", i + 1);
  }
}


x86 assembly (clang, -O0):
<printCounting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114e <printCounting+0x3e>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printCounting+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCounting>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    114d <printCounting+0x3d>
mov    %edi,%r15d
neg    %r15d
mov    $0x1,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <printCounting+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @printCounting(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ 0, %1 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp eq i32 %5, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
struct comp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CloseBreezeSimulation(int);
int /*<<< orphan*/ printf(char *);
void BrzAdapt_ackup(struct comp *comp, int port) {
  printf("BrzAdapt_ackup: This code should never be reached\n");
  CloseBreezeSimulation(2);
}


x86 assembly (clang, -O0):
<BrzAdapt_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <CloseBreezeSimulation@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzAdapt_ackup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <CloseBreezeSimulation@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
@.str = [51 x i8] c"BrzAdapt_ackup: This code should never be reached\0A\00"
define void @BrzAdapt_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @CloseBreezeSimulation(i32 2)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
@str = [50 x i8] c"BrzAdapt_ackup: This code should never be reached\00"
define void @BrzAdapt_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @CloseBreezeSimulation(i32 2)
ret void
}
int test_imm_D2uint8_reg(unsigned char val) {
  return ((val) & (0xD2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D2uint8_reg(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, 210
%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_D2uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -46
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int sz1, sz2;
  int i;
  sz1 = sizeof('a');
  assert(sz1 == sizeof(int));
  sz2 = sizeof((char)'a');
  assert(sz2 == sizeof(char));
  i = '\xff';
  assert((int)i == (int)-1);
  {
    char array[(unsigned int)'\xff' - (unsigned int)0xfffff000];
    assert(sizeof(array) == 0xfff);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x4,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x1,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x1,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0xffffffff,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4095 x i8]
store i32 0, i32* %1
store i32 4, i32* %2
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 4
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
store i32 1, i32* %3
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = icmp eq i64 %12, 1
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
store i32 -1, i32* %4
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, -1
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i32 @assert(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int platform_remove(char const *);
int io_remove(const char *path) { return platform_remove(path); }


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

x86 assembly (clang, -O2):
<io_remove>:
jmp    1030 <platform_remove@plt>

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

LLVM IR (-O2):
define i32 @io_remove(i8* %0) {
%2 = tail call i32 @platform_remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ containerIsEmpty(int);
int /*<<< orphan*/ isOpaque(int);
int /*<<< orphan*/ list(int);
void describeContainer(int container) {
  if (!containerIsEmpty(container) && !isOpaque(container))
    list(container);
}


x86 assembly (clang, -O0):
<describeContainer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <containerIsEmpty@plt>
cmp    $0x0,%eax
jne    1165 <describeContainer+0x35>
mov    -0x4(%rbp),%edi
call   1050 <isOpaque@plt>
cmp    $0x0,%eax
jne    1165 <describeContainer+0x35>
mov    -0x4(%rbp),%edi
call   1030 <list@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<describeContainer>:
push   %rbx
mov    %edi,%ebx
call   1040 <containerIsEmpty@plt>
test   %eax,%eax
jne    1147 <describeContainer+0x17>
mov    %ebx,%edi
call   1050 <isOpaque@plt>
test   %eax,%eax
je     1149 <describeContainer+0x19>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <list@plt>

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

LLVM IR (-O2):
define void @describeContainer(i32 %0) {
%2 = tail call i32 @containerIsEmpty(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @isOpaque(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @list(i32 %0)
br label %9
9: ; preds = %7, %4, %1
ret void
}
/* Variables and functions */
unsigned long gfx_ind(int);
int /*<<< orphan*/ gfx_outd(int, unsigned long);
void Dorado9211ClearDataOut(void) {
  unsigned long value;
  value = gfx_ind(0x6400 + 0x04);
  gfx_outd(0x6400 + 0x00, value & (~0x00040000));
}


x86 assembly (clang, -O0):
<Dorado9211ClearDataOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6404,%edi
call   1040 <gfx_ind@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
and    $0xfffffffffffbffff,%rsi
mov    $0x6400,%edi
call   1030 <gfx_outd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dorado9211ClearDataOut>:
push   %rax
mov    $0x6404,%edi
call   1040 <gfx_ind@plt>
and    $0xfffffffffffbffff,%rax
mov    $0x6400,%edi
mov    %rax,%rsi
pop    %rax
jmp    1030 <gfx_outd@plt>

LLVM IR (-O0):
define void @Dorado9211ClearDataOut() {
%1 = alloca i64
%2 = call i64 @gfx_ind(i32 25604)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = and i64 %3, -262145
%5 = call i32 @gfx_outd(i32 25600, i64 %4)
ret void
}

LLVM IR (-O2):
define void @Dorado9211ClearDataOut() {
%1 = tail call i64 @gfx_ind(i32 25604)
%2 = and i64 %1, -262145
%3 = tail call i32 @gfx_outd(i32 25600, i64 %2)
ret void
}
int round_to_int(float number) { return (int)(number + 0.5); }


x86 assembly (clang, -O0):
<round_to_int>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_int>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @round_to_int(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @round_to_int(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 5.000000e-01
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
int dup2(int, int);
int /*<<< orphan*/ err(int, char *, int, int);
void dup2_or_die(int oldd, int newd) {
  if (dup2(oldd, newd) == -1) {
    err(1, "dup2(2) failed: oldd=%d, newd=%d", oldd, newd);
  }
}


x86 assembly (clang, -O0):
<dup2_or_die>:
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 <dup2@plt>
cmp    $0xffffffff,%eax
jne    1159 <dup2_or_die+0x39>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%edi
lea    0xeac(%rip),%rsi
call   1040 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup2_or_die>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <dup2@plt>
cmp    $0xffffffff,%eax
je     1138 <dup2_or_die+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xec1(%rip),%rsi
mov    $0x1,%edi
mov    %ebp,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <err@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"dup2(2) failed: oldd=%d, newd=%d\00"
define void @dup2_or_die(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 @dup2(i32 %5, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @err(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
br label %13
13: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"dup2(2) failed: oldd=%d, newd=%d\00"
define void @dup2_or_die(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
float extract(float);
int extract3Digit(int a) {
  float tmp = a / 1000.0;
  tmp = extract(tmp);
  return tmp * 10;
}


x86 assembly (clang, -O0):
<extract3Digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <extract@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xeb4(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract3Digit>:
push   %rax
cvtsi2sd %edi,%xmm0
divsd  0xee3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <extract@plt>
mulss  0xeda(%rip),%xmm0
cvttss2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @extract3Digit(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 1.000000e+03
%7 = fptrunc double %6 to float
store float %7, float* %3
%8 = load float, float* %3
%9 = call float @extract(float %8)
store float %9, float* %3
%10 = load float, float* %3
%11 = fmul float %10, 1.000000e+01
%12 = fptosi float %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @extract3Digit(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 1.000000e+03
%4 = fptrunc double %3 to float
%5 = tail call float @extract(float %4)
%6 = fmul float %5, 1.000000e+01
%7 = fptosi float %6 to i32
ret i32 %7
}
/* Variables and functions */
char *Cvar_BitInfo(int);
char *Cvar_Userinfo(void) { return Cvar_BitInfo(2); }


x86 assembly (clang, -O0):
<Cvar_Userinfo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <Cvar_BitInfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cvar_Userinfo>:
mov    $0x2,%edi
jmp    1030 <Cvar_BitInfo@plt>

LLVM IR (-O0):
define i8* @Cvar_Userinfo() {
%1 = call i8* @Cvar_BitInfo(i32 2)
ret i8* %1
}

LLVM IR (-O2):
define i8* @Cvar_Userinfo() {
%1 = tail call i8* @Cvar_BitInfo(i32 2)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void mov_reg8_m8(int reg8, unsigned char *m8) {
  put8(0x8A);
  put8((reg8 << 3) | 5);
  put32((unsigned int)(m8));
}


x86 assembly (clang, -O0):
<mov_reg8_m8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x8a,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg8_m8>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x8a,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_reg8_m8(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @put8(i32 138)
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = or i32 %7, 5
%9 = call i32 @put8(i32 %8)
%10 = load i8*, i8** %4
%11 = ptrtoint i8* %10 to i32
%12 = call i32 @put32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @mov_reg8_m8(i32 %0, i8* %1) {
%3 = tail call i32 @put8(i32 138)
%4 = shl i32 %0, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i8* %1 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usb_irq_handler();
void usb_fiq_handler(void) { usb_irq_handler(); }


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

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

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

LLVM IR (-O2):
define void @usb_fiq_handler() {
%1 = tail call i32 (...) @usb_irq_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void menu() { printf("1.insertion\n\n2.deletion\n\n3.exit\n\n"); }


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"1.insertion\0A\0A2.deletion\0A\0A3.exit\0A\00"
define void @menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
char str_copy(char *s2, const char *s1) {
  int loop;
  for (loop = 0; s1[loop] != '\0'; loop++) {
    s2[loop] = s1[loop];
  }
  s2[(loop++)] = '\0';
  return *s2;
}


x86 assembly (clang, -O0):
<str_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <str_copy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <str_copy+0x13>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_copy>:
mov    (%rsi),%al
test   %al,%al
je     1124 <str_copy+0x24>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <str_copy+0x10>
mov    %ecx,%eax
jmp    1126 <str_copy+0x26>
xor    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @str_copy(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
%18 = load i8, i8* %0
ret i8 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ze_yellow() { printf("[33m"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[33m\00"
define void @ze_yellow() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
const char *skip_string(const char *str) {
  while (*str && *str++ != '"')
    ;
  return str;
}


x86 assembly (clang, -O0):
<skip_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1138 <skip_string+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x22,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1148 <skip_string+0x48>
jmp    114d <skip_string+0x4d>
jmp    1108 <skip_string+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_string>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1120 <skip_string+0x20>
add    $0x1,%rax
cmp    $0x22,%cl
jne    1110 <skip_string+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_string(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = icmp eq i8 %4, 34
br i1 %8, label %9, label %2
9: ; preds = %2, %6
%10 = phi i8* [ %7, %6 ], [ %3, %2 ]
ret i8* %10
}
void db_unlock(unsigned char *lock) { __atomic_store_1(lock, 0, 0); }


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

x86 assembly (clang, -O2):
<db_unlock>:
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <__atomic_store_1@plt>

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

LLVM IR (-O2):
define void @db_unlock(i8* %0) {
%2 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @__atomic_store_1 to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, char *, char *);
int /*<<< orphan*/ setegid(int /*<<< orphan*/);
int /*<<< orphan*/ seteuid(int /*<<< orphan*/);
int /*<<< orphan*/ setgid(int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  setegid(0);
  seteuid(0);
  setgid(0);
  setuid(0);
  execl("/usr/sbin/service", "/usr/sbin/service", "apache2", "reload",
        (char *)NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1060 <setegid@plt>
xor    %edi,%edi
call   1070 <seteuid@plt>
xor    %edi,%edi
call   1030 <setgid@plt>
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xe7e(%rip),%rsi
lea    0xe89(%rip),%rdx
lea    0xe8a(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rsi,%rdi
call   1050 <execl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <setegid@plt>
xor    %edi,%edi
call   1070 <seteuid@plt>
xor    %edi,%edi
call   1030 <setgid@plt>
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xe8c(%rip),%rdi
lea    0xe97(%rip),%rdx
lea    0xe98(%rip),%rcx
mov    %rdi,%rsi
xor    %r8d,%r8d
call   1050 <execl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/usr/sbin/service\00"
@.str.1 = [8 x i8] c"apache2\00"
@.str.2 = [7 x i8] c"reload\00"
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 @setegid(i32 0)
%6 = call i32 @seteuid(i32 0)
%7 = call i32 @setgid(i32 0)
%8 = call i32 @setuid(i32 0)
%9 = call i32 @execl(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"/usr/sbin/service\00"
@.str.1 = [8 x i8] c"apache2\00"
@.str.2 = [7 x i8] c"reload\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @setegid(i32 0)
%4 = tail call i32 @seteuid(i32 0)
%5 = tail call i32 @setgid(i32 0)
%6 = tail call i32 @setuid(i32 0)
%7 = tail call i32 @execl(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g_mutex_unlock(void *);
int gcry_gthread_mutex_unlock(void **lock) {
  g_mutex_unlock(*lock);
  return 0;
}


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

x86 assembly (clang, -O2):
<gcry_gthread_mutex_unlock>:
push   %rax
mov    (%rdi),%rdi
call   1030 <g_mutex_unlock@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gcry_gthread_mutex_unlock(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @g_mutex_unlock(i8* %2)
ret i32 0
}
void my_unlock(int fd) { return; }


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

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

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

LLVM IR (-O2):
define void @my_unlock(i32 %0) {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
int path_exists(char *pathname) {
  struct stat buffer;
  return stat(pathname, &buffer);
}


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

x86 assembly (clang, -O2):
<path_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @path_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @path_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
ret i32 %4
}
/* Variables and functions */
char EOF;
int /*<<< orphan*/ affiche_entier(int);
char getchar();
int main(void) {
  int cpt_lignes;
  char c;
  while ((c = getchar()) != EOF) {
    if (c == '\n') {
      cpt_lignes++;
    }
  }
  affiche_entier(cpt_lignes);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1169 <main+0x49>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    1164 <main+0x44>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0xf>
mov    -0x8(%rbp),%edi
call   1040 <affiche_entier@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ecx,%ecx
cmp    $0xa,%al
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    (%r14),%al
jne    1140 <main+0x20>
mov    %ebx,%edi
call   1040 <affiche_entier@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
br label %4
4: ; preds = %17, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %18
10: ; preds = %4
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %10
br label %4
18: ; preds = %4
%19 = load i32, i32* %2
%20 = call i32 @affiche_entier(i32 %19)
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp ne i8 %1, %2
br label %4
4: ; preds = %0, %4
%5 = phi i8 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ undef, %0 ]
%7 = icmp eq i8 %5, 10
%8 = zext i1 %7 to i32
%9 = add nsw i32 %6, %8
%10 = tail call signext i8 (...) @getchar()
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = tail call i32 @affiche_entier(i32 %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint64_t;

/* Variables and functions */
uint64_t copy_uint64_t(const uint64_t _val) { return _val; }


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

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

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

LLVM IR (-O2):
define i32 @copy_uint64_t(i32 returned %0) {
ret i32 %0
}
void IxmlPrintf(const char *FmtStr, ...) { FmtStr = FmtStr; }


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

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

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

LLVM IR (-O2):
define void @IxmlPrintf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, unsigned char);
void serial_write_cell(unsigned short com, unsigned char c) { outb((com), c); }


x86 assembly (clang, -O0):
<serial_write_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzbl -0x3(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write_cell>:
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @serial_write_cell(i16 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @outb(i16 zeroext %0, i8 zeroext %1)
ret void
}
/* Variables and functions */
int f439(int *);
int f440(int *p) { return f439(p); }


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

x86 assembly (clang, -O2):
<f440>:
jmp    1030 <f439@plt>

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

LLVM IR (-O2):
define i32 @f440(i32* %0) {
%2 = tail call i32 @f439(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void hea_cq_aer_cq_threshold_exceed_warn_reset(__u64 *aer) {
  *aer = hea_set_u64_bits(*aer, 0, 10, 51);
}


x86 assembly (clang, -O0):
<hea_cq_aer_cq_threshold_exceed_warn_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x33,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_cq_aer_cq_threshold_exceed_warn_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x33,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @hea_cq_aer_cq_threshold_exceed_warn_reset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @hea_set_u64_bits(i32 %4, i32 0, i32 10, i32 51)
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @hea_cq_aer_cq_threshold_exceed_warn_reset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_set_u64_bits(i32 %2, i32 0, i32 10, i32 51)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(long);
void seed_random_float(long seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<seed_random_float>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @seed_random_float(i64 %0) {
%2 = tail call i32 @srand(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e(int);
int /*<<< orphan*/ set_err(char *);
c_to_l() {
  char c = -1;
  long l;
  set_err("c_to_l");
  l = c;
  if (c == 255) {
    if (l != 255)
      e(1);
  } else {
    if (l != -1)
      e(2);
  }
}


x86 assembly (clang, -O0):
<c_to_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xff,-0x5(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <set_err@plt>
movsbq -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xff,%eax
jne    116d <c_to_l+0x4d>
cmpq   $0xff,-0x10(%rbp)
je     1168 <c_to_l+0x48>
mov    $0x1,%edi
call   1030 <e@plt>
jmp    1187 <c_to_l+0x67>
cmpq   $0xffffffffffffffff,-0x10(%rbp)
je     1182 <c_to_l+0x62>
mov    $0x2,%edi
call   1030 <e@plt>
jmp    1187 <c_to_l+0x67>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"c_to_l\00"
define i32 @c_to_l() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i64
store i8 -1, i8* %2
%4 = call i32 @set_err(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = load i8, i8* %2
%6 = sext i8 %5 to i64
store i64 %6, i64* %3
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 255
br i1 %9, label %10, label %16
10: ; preds = %0
%11 = load i64, i64* %3
%12 = icmp ne i64 %11, 255
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @e(i32 1)
br label %15
15: ; preds = %13, %10
br label %22
16: ; preds = %0
%17 = load i64, i64* %3
%18 = icmp ne i64 %17, -1
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @e(i32 2)
br label %21
21: ; preds = %19, %16
br label %22
22: ; preds = %21, %15
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [7 x i8] c"c_to_l\00"
define i32 @c_to_l() {
%1 = tail call i32 @set_err(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void usl_signal_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @usl_signal_cleanup() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_sub_epi16(__m128i A, __m128i B) { return _mm_sub_epi16(A, B); }


x86 assembly (clang, -O0):
<test_mm_sub_epi16>:
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_sub_epi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_sub_epi16>:
jmp    1030 <_mm_sub_epi16@plt>

LLVM IR (-O0):
define i32 @test_mm_sub_epi16(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_sub_epi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_sub_epi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_epi16(i32 %0, i32 %1)
ret i32 %3
}
int getcmd(char *buf, int nbuf) {
  printf(2, "$ ");
  memset(buf, 0, nbuf);
  gets(buf, nbuf);
  if (buf[0] == 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<getcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x2,%edi
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1050 <gets@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    118b <getcmd+0x5b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1192 <getcmd+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcmd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec1(%rip),%rsi
mov    $0x2,%edi
xor    %eax,%eax
call   1030 <printf@plt>
movslq %ebp,%rbp
mov    %rbx,%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <gets@plt>
cmpb   $0x1,(%rbx)
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"$ \00"
define i32 @getcmd(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 2 to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = sext i32 %1 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %4, i1 false)
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @gets to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, int, int, int);
int mm_write_mtx_crd_size(FILE *f, int M, int N, int nz) {
  if (fprintf(f, "%d %d %d\n", M, N, nz) < 0)
    return 17;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mm_write_mtx_crd_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jge    1155 <mm_write_mtx_crd_size+0x45>
movl   $0x11,-0x4(%rbp)
jmp    115c <mm_write_mtx_crd_size+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_write_mtx_crd_size>:
push   %rax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee1(%rip),%rsi
call   1030 <fprintf@plt>
sar    $0x3f,%rax
and    $0x11,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @mm_write_mtx_crd_size(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%6 = icmp slt i64 %5, 0
%7 = select i1 %6, i32 17, i32 0
ret i32 %7
}
void glMatrixIndexPointerOES(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glMatrixIndexPointerOES() {
ret void
}
/* Variables and functions */
int strlen(char *);
int string_length(char *str) {
  int data_len = strlen(str);
  return data_len;
}


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

x86 assembly (clang, -O2):
<string_length>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @string_length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
void cw1200_debug_tx_cache_miss(struct cw1200_common *priv) {}


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

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.cw1200_common = type opaque
define void @cw1200_debug_tx_cache_miss(%struct.cw1200_common* %0) {
%2 = alloca %struct.cw1200_common*
store %struct.cw1200_common* %0, %struct.cw1200_common** %2
ret void
}

LLVM IR (-O2):
%struct.cw1200_common = type opaque
define void @cw1200_debug_tx_cache_miss(%struct.cw1200_common* nocapture %0) {
ret void
}
double differential(double (*math_func)(double), double h, double x) {
  double value = 0;
  value = (math_func(x + h) - math_func(x)) / h;
  return value;
}


x86 assembly (clang, -O0):
<differential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
call   *%rax
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<differential>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %rdi,%rbx
addsd  %xmm1,%xmm0
call   *%rdi
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   *%rbx
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
divsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @differential(double (double)* %0, double %1, double %2) {
%4 = alloca double (double)*
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double (double)* %0, double (double)** %4
store double %1, double* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
%8 = load double (double)*, double (double)** %4
%9 = load double, double* %6
%10 = load double, double* %5
%11 = fadd double %9, %10
%12 = call double %8(double %11)
%13 = load double (double)*, double (double)** %4
%14 = load double, double* %6
%15 = call double %13(double %14)
%16 = fsub double %12, %15
%17 = load double, double* %5
%18 = fdiv double %16, %17
store double %18, double* %7
%19 = load double, double* %7
ret double %19
}

LLVM IR (-O2):
define double @differential(double (double)* nocapture %0, double %1, double %2) {
%4 = fadd double %1, %2
%5 = tail call double %0(double %4)
%6 = tail call double %0(double %2)
%7 = fsub double %5, %6
%8 = fdiv double %7, %1
ret double %8
}