xunge/DecIR huggingface dataset:
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *
createUnaryGeneralMathsExpression(struct memorycontainer *, int);
struct memorycontainer *
createSqrtExpression(struct memorycontainer *expression) {
  return createUnaryGeneralMathsExpression(expression, 0x0000);
}


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

x86 assembly (clang, -O2):
<createSqrtExpression>:
xor    %esi,%esi
jmp    1030 <createUnaryGeneralMathsExpression@plt>

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

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createSqrtExpression(%struct.memorycontainer* %0) {
%2 = tail call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %0, i32 0)
ret %struct.memorycontainer* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
__attribute__((always_)) void print_string(const char *v) { printf("%s", v); }


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

x86 assembly (clang, -O2):
<print_string>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int chdir(char *dir) {}


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

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

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

LLVM IR (-O2):
define i32 @chdir(i8* nocapture readnone %0) {
ret i32 undef
}
int g1(__attribute((blah)) int x) {}


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

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

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

LLVM IR (-O2):
define i32 @g1(i32 %0) {
ret i32 undef
}
int twice(int val) { return val * 2; }


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

x86 assembly (clang, -O2):
<twice>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @twice(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int test_imm_CDuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xCD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CDuint64_highword_reg>:
movabs $0xcd00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CDuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 205
%6 = icmp ne i64 %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_CDuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 880468295680
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void f6(_Bool b) {
  switch (b)
    break;
  switch (!b)
    break;
  switch (b++)
    break;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f6(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = zext i1 %5 to i32
switch i32 %6, label %7 [
]
7: ; preds = %1
%8 = load i8, i8* %2
%9 = trunc i8 %8 to i1
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
switch i32 %11, label %12 [
]
12: ; preds = %7
%13 = load i8, i8* %2
%14 = trunc i8 %13 to i1
store i8 1, i8* %2
%15 = zext i1 %14 to i32
switch i32 %15, label %16 [
]
16: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @f6(i1 zeroext %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void clearerr(FILE *fp) {}


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

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

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

LLVM IR (-O2):
define void @clearerr(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comprlib_write_byte(int);
int comprlib_write_block(int c, int size) {
  int i;
  for (i = 0; i < size; i++)
    comprlib_write_byte(c);
  return (i);
}


x86 assembly (clang, -O0):
<comprlib_write_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1147 <comprlib_write_block+0x37>
mov    -0x4(%rbp),%edi
call   1030 <comprlib_write_byte@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <comprlib_write_block+0x15>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comprlib_write_block>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    112e <comprlib_write_block+0x1e>
mov    %esi,%r14d
mov    %edi,%ebp
mov    %esi,%ebx
nop
mov    %ebp,%edi
call   1030 <comprlib_write_byte@plt>
add    $0xffffffff,%ebx
jne    1120 <comprlib_write_block+0x10>
jmp    1131 <comprlib_write_block+0x21>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @comprlib_write_block(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @comprlib_write_byte(i32 %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ 0, %2 ], [ %1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fd_lis3dh_sleep();
void fd_hal_accelerometer_sleep(void) { fd_lis3dh_sleep(); }


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

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

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

LLVM IR (-O2):
define void @fd_hal_accelerometer_sleep() {
%1 = tail call i32 (...) @fd_lis3dh_sleep()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ consumer(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
void finish(const char *fn) {
  char cmd[1024];
  snprintf(cmd, 1024, "pvbatch --use-offscreen-rendering script.py %s", fn);
  consumer(cmd);
}


x86 assembly (clang, -O0):
<finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x400,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <consumer@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finish>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <consumer@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"pvbatch --use-offscreen-rendering script.py %s\00"
define void @finish(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 1024, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i32 @consumer(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"pvbatch --use-offscreen-rendering script.py %s\00"
define void @finish(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 1024, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @consumer(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ CS_Off(int /*<<< orphan*/);
int /*<<< orphan*/ CS_On(int /*<<< orphan*/);
int SPI_Read();
int /*<<< orphan*/ Write_SPI(int);
int IsFlashReady(uint32_t pin) {
  int status;
  CS_On(pin);
  Write_SPI(0xD7);
  Write_SPI(0xFF);
  status = SPI_Read();
  CS_Off(pin);
  return (status & (1 << (7)));
}


x86 assembly (clang, -O0):
<IsFlashReady>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <CS_On@plt>
mov    $0xd7,%edi
call   1060 <Write_SPI@plt>
mov    $0xff,%edi
call   1060 <Write_SPI@plt>
mov    $0x0,%al
call   1040 <SPI_Read@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <CS_Off@plt>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsFlashReady>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <CS_On@plt>
mov    $0xd7,%edi
call   1060 <Write_SPI@plt>
mov    $0xff,%edi
call   1060 <Write_SPI@plt>
xor    %eax,%eax
call   1040 <SPI_Read@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <CS_Off@plt>
and    $0x80,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @IsFlashReady(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @CS_On(i32 %4)
%6 = call i32 @Write_SPI(i32 215)
%7 = call i32 @Write_SPI(i32 255)
%8 = call i32 (...) @SPI_Read()
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = call i32 @CS_Off(i32 %9)
%11 = load i32, i32* %3
%12 = and i32 %11, 128
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsFlashReady(i32 %0) {
%2 = tail call i32 @CS_On(i32 %0)
%3 = tail call i32 @Write_SPI(i32 215)
%4 = tail call i32 @Write_SPI(i32 255)
%5 = tail call i32 (...) @SPI_Read()
%6 = tail call i32 @CS_Off(i32 %0)
%7 = and i32 %5, 128
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *NoFailMalloc(size_t size) {
  void *result;
  if ((result = malloc(size)) == NULL) {
    fprintf(stderr, "Can't allocate memory.\n");
    exit(1);
  }
  return (result);
}


x86 assembly (clang, -O0):
<NoFailMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1172 <NoFailMalloc+0x42>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NoFailMalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <NoFailMalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Can't allocate memory.\0A\00"
define i8* @NoFailMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Can't allocate memory.\0A\00"
define noalias i8* @NoFailMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
double atanh(x)
double x;
{
  double z;
  z = copysign(0.5, x);
  x = copysign(x, 1.0);
  x = x / (1.0 - x);
  return (z * log1p(x + x));
}


x86 assembly (clang, -O0):
<atanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xef7(%rip),%xmm1
pand   %xmm1,%xmm0
movaps 0xefc(%rip),%xmm1
por    %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xec7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea1(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanh>:
sub    $0x18,%rsp
movapd 0xee4(%rip),%xmm1
andpd  %xmm0,%xmm1
orpd   0xee8(%rip),%xmm1
movapd %xmm1,(%rsp)
andpd  0xeeb(%rip),%xmm0
movsd  0xef3(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
call   1030 <log1p@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @atanh(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.copysign.f64(double 5.000000e-01, double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = call double @llvm.copysign.f64(double %6, double 1.000000e+00)
store double %7, double* %2
%8 = load double, double* %2
%9 = load double, double* %2
%10 = fsub double 1.000000e+00, %9
%11 = fdiv double %8, %10
store double %11, double* %2
%12 = load double, double* %3
%13 = load double, double* %2
%14 = load double, double* %2
%15 = fadd double %13, %14
%16 = call double @log1p(double %15)
%17 = fmul double %12, %16
ret double %17
}

LLVM IR (-O2):
define double @atanh(double %0) {
%2 = tail call double @llvm.copysign.f64(double 5.000000e-01, double %0)
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fsub double 1.000000e+00, %3
%5 = fdiv double %3, %4
%6 = fadd double %5, %5
%7 = tail call double @log1p(double %6)
%8 = fmul double %2, %7
ret double %8
}
void signal_irsc_completion(void) {}


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

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

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

LLVM IR (-O2):
define void @signal_irsc_completion() {
ret void
}
void qpnp_chg_notify_charger_type(int type) {}


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

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

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

LLVM IR (-O2):
define void @qpnp_chg_notify_charger_type(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void signal_handler(int signo) { fprintf(stdout, "CAUGHT signal %d\n", signo); }


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [18 x i8] c"CAUGHT signal %d\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [18 x i8] c"CAUGHT signal %d\0A\00"
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sum(int);
int main() {
  int n;
  sum(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <sum@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @sum(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
int main(void) {
  float f = 1;
  long double d = 1;
  printf("\nO tamanho de f(float): %zu bytes / %zu bits\n", sizeof f,
         sizeof f * 8);
  printf("\nO tamanho de d(long double): %zu bytes / %zu bits\n", sizeof d,
         sizeof d * 8);
  printf("\nValor de i: %f\n ~ %.2f ", f, f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3f800000,-0x8(%rbp)
fld1
fstpt  -0x20(%rbp)
lea    0xede(%rip),%rdi
movss  0xece(%rip),%xmm0
movss  0xeca(%rip),%xmm1
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
movss  0xeaa(%rip),%xmm0
movss  0xea6(%rip),%xmm1
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefc(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
call   1030 <printf@plt>
lea    0xf0e(%rip),%rdi
movss  0xecc(%rip),%xmm0
movss  0xec8(%rip),%xmm1
call   1030 <printf@plt>
lea    0xf26(%rip),%rdi
movss  0xeb8(%rip),%xmm0
movaps %xmm0,%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"\0AO tamanho de f(float): %zu bytes / %zu bits\0A\00"
@.str.1 = [52 x i8] c"\0AO tamanho de d(long double): %zu bytes / %zu bits\0A\00"
@.str.2 = [25 x i8] c"\0AValor de i: %f\0A ~ %.2f \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca x86_fp80
store i32 0, i32* %1
store float 1.000000e+00, float* %2
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), float 4.000000e+00, float 3.200000e+01)
%5 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), float 1.600000e+01, float 1.280000e+02)
%6 = load float, float* %2
%7 = load float, float* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), float %6, float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"\0AO tamanho de f(float): %zu bytes / %zu bits\0A\00"
@.str.1 = [52 x i8] c"\0AO tamanho de d(long double): %zu bytes / %zu bits\0A\00"
@.str.2 = [25 x i8] c"\0AValor de i: %f\0A ~ %.2f \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), float 4.000000e+00, float 3.200000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), float 1.600000e+01, float 1.280000e+02)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), float 1.000000e+00, float 1.000000e+00)
ret i32 0
}
void floatViewClean(struct LSD_SceneNodeInst const *inst, void *instData) {}


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

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

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

LLVM IR (-O2):
%struct.LSD_SceneNodeInst = type opaque
define void @floatViewClean(%struct.LSD_SceneNodeInst* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
int tpm_read_index(int base, int index) {
  outb(index, base);
  return inb(base + 1) & 0xFF;
}


x86 assembly (clang, -O0):
<tpm_read_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <inb@plt>
and    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tpm_read_index>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <inb@plt>
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tpm_read_index(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @outb(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = call i32 @inb(i32 %9)
%11 = and i32 %10, 255
ret i32 %11
}

LLVM IR (-O2):
define i32 @tpm_read_index(i32 %0, i32 %1) {
%3 = tail call i32 @outb(i32 %1, i32 %0)
%4 = add nsw i32 %0, 1
%5 = tail call i32 @inb(i32 %4)
%6 = and i32 %5, 255
ret i32 %6
}
int test_imm_AAint16_mem(short *val) {
  return ((*val) & (-0xAA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AAint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff56,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_AAint16_mem>:
movzwl (%rdi),%eax
test   $0xff56,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_AAint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -170
%7 = icmp ne i32 %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_AAint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -170
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ is_prime(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  printf("Enter number: ");
  scanf("%d", &number);
  if (is_prime(number))
    printf("1\n");
  else
    printf("0\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    118a <main+0x5a>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <is_prime@plt>
test   %rax,%rax
lea    0xea1(%rip),%rax
lea    0xe9c(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"1\0A\00"
@.str.3 = [3 x i8] c"0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i64 @is_prime(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter number: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [2 x i8] c"0\00"
@str.4 = [2 x i8] c"1\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @is_prime(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int func_strlen(char *p) {
  strcpy(p, "Hello world");
  return strlen(p);
}


x86 assembly (clang, -O0):
<func_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_strlen>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strlen@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define i32 @func_strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define i32 @func_strlen(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strlen(i8* %0)
ret i32 %3
}
char itoc(int x) { return (x >= 10 && x <= 15) ? 'A' + x - 10 : '0' + x; }


x86 assembly (clang, -O0):
<itoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     112c <itoc+0x2c>
cmpl   $0xf,-0x4(%rbp)
jg     112c <itoc+0x2c>
mov    -0x4(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <itoc+0x35>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoc>:
lea    -0xa(%rdi),%ecx
lea    0x30(%rdi),%edx
lea    0x37(%rdi),%eax
cmp    $0x6,%ecx
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @itoc(i32 %0) {
%2 = add i32 %0, -10
%3 = icmp ult i32 %2, 6
%4 = select i1 %3, i32 55, i32 48
%5 = add nsw i32 %4, %0
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
int *mrgcore(int *, int /*<<< orphan*/, unsigned int);
int *mrgsort(int *a, unsigned n) { return mrgcore(a, 0, n - 1); }


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

x86 assembly (clang, -O2):
<mrgsort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <mrgcore@plt>

LLVM IR (-O0):
define i32* @mrgsort(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 = sub i32 %6, 1
%8 = call i32* @mrgcore(i32* %5, i32 0, i32 %7)
ret i32* %8
}

LLVM IR (-O2):
define i32* @mrgsort(i32* %0, i32 %1) {
%3 = add i32 %1, -1
%4 = tail call i32* @mrgcore(i32* %0, i32 0, i32 %3)
ret i32* %4
}
int is_nc(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<is_nc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_nc+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_nc>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_nc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_nc(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void platform_intr_mask_irq(unsigned irq __attribute__((unused))) {}


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

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

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

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

/* Variables and functions */
int spi_write_cmd(struct flashrom_flashctx *, int, int, unsigned int,
                  int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int spi_block_erase_c4(struct flashrom_flashctx *flash, unsigned int addr,
                       unsigned int blocklen) {
  return spi_write_cmd(flash, 0xc4, false, addr, NULL, 0, 500 * 1000);
}


x86 assembly (clang, -O0):
<spi_block_erase_c4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0xc4,%esi
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%r8d
mov    %r9d,%edx
movl   $0x7a120,(%rsp)
call   1030 <spi_write_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_block_erase_c4>:
push   %rax
mov    %esi,%ecx
movl   $0x7a120,(%rsp)
mov    $0xc4,%esi
xor    %edx,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <spi_write_cmd@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_block_erase_c4(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = alloca %struct.flashrom_flashctx*
%5 = alloca i32
%6 = alloca i32
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %4
%8 = load i32, i32* %5
%9 = call i32 @spi_write_cmd(%struct.flashrom_flashctx* %7, i32 196, i32 0, i32 %8, i32* null, i32 0, i32 500000)
ret i32 %9
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_block_erase_c4(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = tail call i32 @spi_write_cmd(%struct.flashrom_flashctx* %0, i32 196, i32 0, i32 %1, i32* null, i32 0, i32 500000)
ret i32 %4
}
/* Variables and functions */
int ndigits(size_t n) {
  int i = 0;
  while (n) {
    i++;
    n /= 10;
  }
  return i;
}


x86 assembly (clang, -O0):
<ndigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <ndigits+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    110f <ndigits+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndigits>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1136 <ndigits+0x36>
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <ndigits+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ndigits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i64 %5, 10
%8 = icmp ult i64 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ LONG_MAX;
int /*<<< orphan*/ SIZE_MAX;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("LONG_MAX: %li\n", LONG_MAX);
  printf("SIZE_MAX: %zu\n", SIZE_MAX);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"LONG_MAX: %li\0A\00"
@LONG_MAX = global i32 0
@.str.1 = [15 x i8] c"SIZE_MAX: %zu\0A\00"
@SIZE_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @LONG_MAX
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @SIZE_MAX
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"LONG_MAX: %li\0A\00"
@LONG_MAX = global i32 0
@.str.1 = [15 x i8] c"SIZE_MAX: %zu\0A\00"
@SIZE_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @LONG_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @SIZE_MAX
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpord_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpord_sd(__m128d A, __m128d B) { return _mm_cmpord_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cmpord_sd>:
jmp    1030 <_mm_cmpord_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpord_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpord_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int _read_r(struct _reent *r, int file, char *ptr, int len) {
  r = r;
  file = file;
  ptr = ptr;
  len = len;
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<_read_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea2(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read_r>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct._reent = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_read_r(%struct._reent* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct._reent*, %struct._reent** %5
store %struct._reent* %9, %struct._reent** %5
%10 = load i32, i32* %6
store i32 %10, i32* %6
%11 = load i8*, i8** %7
store i8* %11, i8** %7
%12 = load i32, i32* %8
store i32 %12, i32* %8
%13 = load i32, i32* @EINVAL
store i32 %13, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct._reent = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_read_r(%struct._reent* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}
int i_status(int argc, char **argv) { return 0; }


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

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

LLVM IR (-O0):
define i32 @i_status(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @i_status(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t hash_map_function(uint16_t key) {
  uint8_t result;
  uint16_t derived_key = key >> 2;
  result = (derived_key & 0x7f);
  result ^= (derived_key >> 7);
  return result;
}


x86 assembly (clang, -O0):
<hash_map_function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x7,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_map_function>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0x7f,%eax
sar    $0x9,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hash_map_function(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 2
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, 127
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 7
%11 = load i32, i32* %3
%12 = xor i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @hash_map_function(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 127
%4 = ashr i32 %0, 9
%5 = xor i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void writeToFile(char *filename, char *text) {
  FILE *file = fopen(filename, "w");
  fprintf(file, text);
  fclose(file);
}


x86 assembly (clang, -O0):
<writeToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeToFile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @writeToFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32* %8, i8* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @writeToFile(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fprintf(i32* %3, i8* %1)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
void mp_load_0(int n, int radix, int out[]) {
  int j;
  for (j = 0; j <= n + 1; j++) {
    out[j] = 0;
  }
}


x86 assembly (clang, -O0):
<mp_load_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1143 <mp_load_0+0x43>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <mp_load_0+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_load_0>:
cmp    $0xffffffff,%edi
jl     1132 <mp_load_0+0x22>
push   %rax
add    $0x1,%edi
lea    0x4(,%rdi,4),%rax
mov    %rdx,%rdi
xor    %esi,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @mp_load_0(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp slt i32 %0, -1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = bitcast i32* %2 to i8*
%7 = add nsw i32 %0, 1
%8 = zext i32 %7 to i64
%9 = shl nuw nsw i64 %8, 2
%10 = add nuw nsw i64 %9, 4
br label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookinteger8array_(char *x, unsigned int *n) { lookNarray(x, (*n * 8)); }


x86 assembly (clang, -O0):
<lookinteger8array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x3,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookinteger8array_>:
mov    (%rsi),%esi
shl    $0x3,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookinteger8array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 8
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookinteger8array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 3
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
void conditional_write(char *p, char *q) {
  if (p != 0 && q != 0) {
    *p = *q;
  }
}


x86 assembly (clang, -O0):
<conditional_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112e <conditional_write+0x2e>
cmpq   $0x0,-0x10(%rbp)
je     112e <conditional_write+0x2e>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditional_write>:
test   %rdi,%rdi
je     110e <conditional_write+0xe>
test   %rsi,%rsi
je     110e <conditional_write+0xe>
mov    (%rsi),%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @conditional_write(i8* writeonly %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load i8, i8* %1
store i8 %7, i8* %0
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned long flsl(unsigned long);
unsigned long ilog2(unsigned long x) { return (flsl(x) - 1); }


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

x86 assembly (clang, -O2):
<ilog2>:
push   %rax
call   1030 <flsl@plt>
add    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @ilog2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @flsl(i64 %3)
%5 = sub i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @ilog2(i64 %0) {
%2 = tail call i64 @flsl(i64 %0)
%3 = add i64 %2, -1
ret i64 %3
}