xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
float FixedToFloat(int32_t val) { return (float)val / 4096.0; }


x86 assembly (clang, -O0):
<FixedToFloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FixedToFloat>:
cvtsi2ss %rdi,%xmm0
mulss  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define float @FixedToFloat(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = fpext float %4 to double
%6 = fdiv double %5, 4.096000e+03
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @FixedToFloat(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = fmul float %2, 0x3F30000000000000
ret float %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotate(uint64_t x, int r) { return (x >> r) | (x << (64 - r)); }


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotate(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_avg_pu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_avg_pu8(__m64 a, __m64 b) { return _mm_avg_pu8(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_avg_pu8>:
jmp    1030 <_mm_avg_pu8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_avg_pu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_avg_pu8(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int octant(int8_t dx, int8_t dy) {}


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

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

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

LLVM IR (-O2):
define i32 @octant(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xf2() {
  Assert_real((isbdigit(242) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1215, ("isbdigit should be 0 for 0xf2"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0xf2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf2,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4bf,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0xf2>:
push   %rax
mov    $0xf2,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4bf,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xf2\00"
define void @t_isbdigit_0xf2() {
%1 = call i64 @isbdigit(i32 242)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1215, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xf2\00"
define void @t_isbdigit_0xf2() {
%1 = tail call i64 @isbdigit(i32 242)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1215, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_fmt(char *, char *, char *);
void log_str(char *name, char *str) { log_fmt(name, "\"%s\"", str); }


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

x86 assembly (clang, -O2):
<log_str>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <log_fmt@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\22%s\22\00"
define void @log_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @log_fmt(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\22%s\22\00"
define void @log_str(i8* %0, i8* %1) {
%3 = tail call i32 @log_fmt(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fcntl(int, int, ...);
int main(void) {
  fcntl(42, 43);
  fcntl(42, 43, 44);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
mov    $0x2b,%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    $0x2a,%edi
mov    $0x2b,%esi
mov    $0x2c,%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
mov    $0x2b,%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    $0x2a,%edi
mov    $0x2b,%esi
mov    $0x2c,%edx
xor    %eax,%eax
call   1030 <fcntl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32, i32, ...) @fcntl(i32 42, i32 43)
%3 = call i32 (i32, i32, ...) @fcntl(i32 42, i32 43, i32 44)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) @fcntl(i32 42, i32 43)
%2 = tail call i32 (i32, i32, ...) @fcntl(i32 42, i32 43, i32 44)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __ROR(uint32_t op1, uint32_t op2) {
  return (op1 >> op2) | (op1 << (32 - op2));
}


x86 assembly (clang, -O0):
<__ROR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ROR>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @__ROR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @__ROR(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_CLR_ADC4_PIN();
int /*<<< orphan*/ TOSH_MAKE_ADC4_INPUT();
int /*<<< orphan*/ TOSH_MAKE_ADC4_OUTPUT();
int /*<<< orphan*/ TOSH_uwait(int);
void ds2770_writeBit(int bit) {
  if (bit) {
    TOSH_MAKE_ADC4_OUTPUT();
    TOSH_CLR_ADC4_PIN();
    TOSH_uwait(4);
    TOSH_MAKE_ADC4_INPUT();
    TOSH_uwait(50);
  } else {
    TOSH_MAKE_ADC4_OUTPUT();
    TOSH_CLR_ADC4_PIN();
    TOSH_uwait(50);
    TOSH_MAKE_ADC4_INPUT();
    TOSH_uwait(8);
  }
}


x86 assembly (clang, -O0):
<ds2770_writeBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1183 <ds2770_writeBit+0x43>
mov    $0x0,%al
call   1050 <TOSH_MAKE_ADC4_OUTPUT@plt>
mov    $0x0,%al
call   1030 <TOSH_CLR_ADC4_PIN@plt>
mov    $0x4,%edi
call   1060 <TOSH_uwait@plt>
mov    $0x0,%al
call   1040 <TOSH_MAKE_ADC4_INPUT@plt>
mov    $0x32,%edi
call   1060 <TOSH_uwait@plt>
jmp    11ac <ds2770_writeBit+0x6c>
mov    $0x0,%al
call   1050 <TOSH_MAKE_ADC4_OUTPUT@plt>
mov    $0x0,%al
call   1030 <TOSH_CLR_ADC4_PIN@plt>
mov    $0x32,%edi
call   1060 <TOSH_uwait@plt>
mov    $0x0,%al
call   1040 <TOSH_MAKE_ADC4_INPUT@plt>
mov    $0x8,%edi
call   1060 <TOSH_uwait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds2770_writeBit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <TOSH_MAKE_ADC4_OUTPUT@plt>
xor    %eax,%eax
call   1030 <TOSH_CLR_ADC4_PIN@plt>
test   %ebx,%ebx
mov    $0x32,%eax
mov    $0x4,%edi
cmove  %eax,%edi
mov    $0x8,%ebx
cmovne %eax,%ebx
call   1060 <TOSH_uwait@plt>
xor    %eax,%eax
call   1040 <TOSH_MAKE_ADC4_INPUT@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <TOSH_uwait@plt>

LLVM IR (-O0):
define void @ds2770_writeBit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = call i32 (...) @TOSH_MAKE_ADC4_OUTPUT()
%7 = call i32 (...) @TOSH_CLR_ADC4_PIN()
%8 = call i32 @TOSH_uwait(i32 4)
%9 = call i32 (...) @TOSH_MAKE_ADC4_INPUT()
%10 = call i32 @TOSH_uwait(i32 50)
br label %17
11: ; preds = %1
%12 = call i32 (...) @TOSH_MAKE_ADC4_OUTPUT()
%13 = call i32 (...) @TOSH_CLR_ADC4_PIN()
%14 = call i32 @TOSH_uwait(i32 50)
%15 = call i32 (...) @TOSH_MAKE_ADC4_INPUT()
%16 = call i32 @TOSH_uwait(i32 8)
br label %17
17: ; preds = %11, %5
ret void
}

LLVM IR (-O2):
define void @ds2770_writeBit(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = tail call i32 (...) @TOSH_MAKE_ADC4_OUTPUT()
%4 = tail call i32 (...) @TOSH_CLR_ADC4_PIN()
%5 = select i1 %2, i32 50, i32 4
%6 = select i1 %2, i32 8, i32 50
%7 = tail call i32 @TOSH_uwait(i32 %5)
%8 = tail call i32 (...) @TOSH_MAKE_ADC4_INPUT()
%9 = tail call i32 @TOSH_uwait(i32 %6)
ret void
}
int valid_act_opt(int x) { return (1 <= x) && (x < (1 << (16))); }


x86 assembly (clang, -O0):
<valid_act_opt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x1,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1127 <valid_act_opt+0x27>
cmpl   $0x10000,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_act_opt>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0xffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @valid_act_opt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 1, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 65536
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @valid_act_opt(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 65535
%4 = zext i1 %3 to i32
ret i32 %4
}
void test_strncmp() {}


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

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

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

LLVM IR (-O2):
define void @test_strncmp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cdoWarning(char *);
int download_gridfile(const char *restrict uri, const char *restrict basename) {
  int rval = 1;
  cdoWarning("CURL support not compiled in!");
  return rval;
}


x86 assembly (clang, -O0):
<download_gridfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <cdoWarning@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<download_gridfile>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <cdoWarning@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"CURL support not compiled in!\00"
define i32 @download_gridfile(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 1, i32* %5
%6 = call i32 @cdoWarning(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %5
ret i32 %7
}

LLVM IR (-O2):
@.str = [30 x i8] c"CURL support not compiled in!\00"
define i32 @download_gridfile(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1) {
%3 = tail call i32 @cdoWarning(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
char *GetConfigValue(char const *, char const *, char *);
float strtof(char const *, int /*<<< orphan*/ *);
int ConfigValueFloat(const char *blockName, const char *keyName, float *ret) {
  const char *val = GetConfigValue(blockName, keyName, "");
  if (!val[0])
    return 0;
  *ret = strtof(val, NULL);
  return 1;
}


x86 assembly (clang, -O0):
<ConfigValueFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xebd(%rip),%rdx
call   1040 <GetConfigValue@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1165 <ConfigValueFloat+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1181 <ConfigValueFloat+0x61>
mov    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtof@plt>
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigValueFloat>:
push   %rbx
mov    %rdx,%rbx
lea    0xed5(%rip),%rdx
call   1040 <GetConfigValue@plt>
cmpb   $0x0,(%rax)
je     114a <ConfigValueFloat+0x2a>
mov    %rax,%rdi
xor    %esi,%esi
call   1030 <strtof@plt>
movss  %xmm0,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @ConfigValueFloat(i8* %0, i8* %1, float* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca float*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store float* %2, float** %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i8* @GetConfigValue(i8* %9, i8* %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %11, i8** %8
%12 = load i8*, i8** %8
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %3
store i32 0, i32* %4
br label %21
17: ; preds = %3
%18 = load i8*, i8** %8
%19 = call float @strtof(i8* %18, i32* null)
%20 = load float*, float** %7
store float %19, float* %20
store i32 1, i32* %4
br label %21
21: ; preds = %17, %16
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @ConfigValueFloat(i8* %0, i8* %1, float* nocapture writeonly %2) {
%4 = tail call i8* @GetConfigValue(i8* %0, i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call float @strtof(i8* nocapture %4, i32* null)
store float %8, float* %2
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int auditwarnlog(char **);
int audit_warn_tmpfile(void) {
  char *args[2];
  args[0] = "tmpfile";
  args[1] = NULL;
  return (auditwarnlog(args));
}


x86 assembly (clang, -O0):
<audit_warn_tmpfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <auditwarnlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audit_warn_tmpfile>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
call   1030 <auditwarnlog@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"tmpfile\00"
define i32 @audit_warn_tmpfile() {
%1 = alloca [2 x i8*]
%2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = call i32 @auditwarnlog(i8** %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [8 x i8] c"tmpfile\00"
define i32 @audit_warn_tmpfile() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @auditwarnlog(i8** %3)
ret i32 %5
}
/* Variables and functions */
scalar_t__ EINTR;
int /*<<< orphan*/ abort();
scalar_t__ errno;
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stack_trace(int);
void fail_errno_except_eintr(const char *code) {
  if (errno == EINTR)
    return;
  perror(code);
  stack_trace(2);
  abort();
}


x86 assembly (clang, -O0):
<fail_errno_except_eintr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%rax
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%rax
jne    115c <fail_errno_except_eintr+0x2c>
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
mov    $0x2,%edi
call   1040 <stack_trace@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<fail_errno_except_eintr>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%rax
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%rax
jne    1149 <fail_errno_except_eintr+0x19>
pop    %rax
ret
call   1050 <perror@plt>
mov    $0x2,%edi
call   1040 <stack_trace@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define void @fail_errno_except_eintr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = load i64, i64* @EINTR
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %1
ret void
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @perror(i8* %8)
%10 = call i32 @stack_trace(i32 2)
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define void @fail_errno_except_eintr(i8* nocapture %0) {
%2 = load i64, i64* @errno
%3 = load i64, i64* @EINTR
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %6
5: ; preds = %1
ret void
6: ; preds = %1
%7 = tail call i32 @perror(i8* %0)
%8 = tail call i32 @stack_trace(i32 2)
%9 = tail call i32 (...) @abort()
unreachable
}
int ft_isascii(int c) {
  if (c >= 0 && c <= 127)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1127 <ft_isascii+0x27>
cmpl   $0x7f,-0x8(%rbp)
jg     1127 <ft_isascii+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isascii+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ comb_sort(int *, int);
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ random_array(int *, int);
int main(void) {
  int a[20];
  random_array(a, 20);
  print_array(a, 20);
  comb_sort(a, 20);
  print_array(a, 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1040 <random_array@plt>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1030 <print_array@plt>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1050 <comb_sort@plt>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <random_array@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1050 <comb_sort@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = call i32 @random_array(i32* %3, i32 20)
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = call i32 @print_array(i32* %5, i32 20)
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%8 = call i32 @comb_sort(i32* %7, i32 20)
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%10 = call i32 @print_array(i32* %9, i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @random_array(i32* %3, i32 20)
%5 = call i32 @print_array(i32* %3, i32 20)
%6 = call i32 @comb_sort(i32* %3, i32 20)
%7 = call i32 @print_array(i32* %3, i32 20)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ioInit();
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ tempInit();
int /*<<< orphan*/ timeInit();
void hwInit() {
  timeInit();
  ioInit();
  print("Initializing...\r");
  tempInit();
}


x86 assembly (clang, -O0):
<hwInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <timeInit@plt>
mov    $0x0,%al
call   1060 <ioInit@plt>
lea    0xea7(%rip),%rdi
call   1050 <print@plt>
mov    $0x0,%al
call   1030 <tempInit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hwInit>:
push   %rax
xor    %eax,%eax
call   1040 <timeInit@plt>
xor    %eax,%eax
call   1060 <ioInit@plt>
lea    0xeaa(%rip),%rdi
call   1050 <print@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tempInit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Initializing...\0D\00"
define void @hwInit() {
%1 = call i32 (...) @timeInit()
%2 = call i32 (...) @ioInit()
%3 = call i32 @print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @tempInit()
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Initializing...\0D\00"
define void @hwInit() {
%1 = tail call i32 (...) @timeInit()
%2 = tail call i32 (...) @ioInit()
%3 = tail call i32 @print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @tempInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cdatas();
int /*<<< orphan*/ nullables();
void traits(void) {
  nullables();
  cdatas();
}


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

x86 assembly (clang, -O2):
<traits>:
push   %rax
xor    %eax,%eax
call   1030 <nullables@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cdatas@plt>

LLVM IR (-O0):
define void @traits() {
%1 = call i32 (...) @nullables()
%2 = call i32 (...) @cdatas()
ret void
}

LLVM IR (-O2):
define void @traits() {
%1 = tail call i32 (...) @nullables()
%2 = tail call i32 (...) @cdatas()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drukujspacja(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int wprowadzona;
  scanf("%d", &wprowadzona);
  drukujspacja(wprowadzona);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @drukujspacja(i32 %4)
ret i32 0
}
/* Variables and functions */
void *ft_memset(void *b, int c, size_t len) {
  char *cast;
  cast = (char *)b;
  while (len-- > 0)
    *cast++ = (unsigned char)c;
  return (b);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
jbe    114b <ft_memset+0x4b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1117 <ft_memset+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
void crGetCurrentDir(char *dir, int maxLen) {
  if (!getcwd(dir, maxLen))
    dir[0] = 0;
}


x86 assembly (clang, -O0):
<crGetCurrentDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <getcwd@plt>
cmp    $0x0,%eax
jne    113b <crGetCurrentDir+0x2b>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crGetCurrentDir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getcwd@plt>
test   %eax,%eax
je     111f <crGetCurrentDir+0xf>
pop    %rbx
ret
movb   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @crGetCurrentDir(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 = call i32 @getcwd(i8* %5, i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 0, i8* %11
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @crGetCurrentDir(i8* %0, i32 %1) {
%3 = tail call i32 @getcwd(i8* %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
store i8 0, i8* %0
br label %6
6: ; preds = %5, %2
ret void
}
/* Variables and functions */
int get_ticks();
int /*<<< orphan*/ milli_delay(int);
int /*<<< orphan*/ printf(char *, int);
void TestA() {
  for (;;)
    ;
  while (1) {
    printf("<Ticks:%d>", get_ticks());
    milli_delay(200);
  }
}


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

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

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

LLVM IR (-O2):
define void @TestA() {
br label %1
1: ; preds = %1, %0
br label %1
}
void test_1(int *out, int a, int b) { *--out = a * b; }


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffffc,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,-0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
imul   %edx,%esi
mov    %esi,-0x4(%rdi)
ret

LLVM IR (-O0):
define void @test_1(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 -1
store i32* %11, i32** %4
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @test_1(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = getelementptr inbounds i32, i32* %0, i64 -1
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  int sum = 0;
  for (i = 0; i <= 100; i++)
    sum += i * i * (i - 1);
  printf("answer; %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     115b <main+0x4b>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"answer; %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}
/* Variables and functions */
int M_PI;
int atan2(int, int);
int loc_x();
int loc_y();
int plot_course(int xx, int yy) {
  int x, y;
  x = xx - loc_x();
  y = yy - loc_y();
  return atan2(y, x) * 180 / M_PI;
}


x86 assembly (clang, -O0):
<plot_course>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <loc_x@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <loc_y@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <atan2@plt>
imul   $0xb4,%eax,%eax
mov    0x2e64(%rip),%rcx
cltd
idivl  (%rcx)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plot_course>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <loc_x@plt>
sub    %eax,%ebp
xor    %eax,%eax
call   1030 <loc_y@plt>
sub    %eax,%ebx
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <atan2@plt>
imul   $0xb4,%eax,%eax
mov    0x2e89(%rip),%rcx
cltd
idivl  (%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define i32 @plot_course(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = call i32 (...) @loc_x()
%9 = sub nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = call i32 (...) @loc_y()
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = call i32 @atan2(i32 %13, i32 %14)
%16 = mul nsw i32 %15, 180
%17 = load i32, i32* @M_PI
%18 = sdiv i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
@M_PI = global i32 0
define i32 @plot_course(i32 %0, i32 %1) {
%3 = tail call i32 (...) @loc_x()
%4 = sub nsw i32 %0, %3
%5 = tail call i32 (...) @loc_y()
%6 = sub nsw i32 %1, %5
%7 = tail call i32 @atan2(i32 %6, i32 %4)
%8 = mul nsw i32 %7, 180
%9 = load i32, i32* @M_PI
%10 = sdiv i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ reset_tiff_channel();
void Reset_Tiff_Channel() { reset_tiff_channel(); }


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

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

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

LLVM IR (-O2):
define void @Reset_Tiff_Channel() {
%1 = tail call i32 (...) @reset_tiff_channel()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputs(char const *, int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundmpx_fputs(const char *s,
                                                              FILE *stream) {
  return fputs(s, stream);
}


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

x86 assembly (clang, -O2):
<softboundmpx_fputs>:
jmp    1030 <fputs@plt>

LLVM IR (-O0):
define weak i32 @softboundmpx_fputs(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 = call i32 @fputs(i8* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @softboundmpx_fputs(i8* %0, i32* %1) {
%3 = tail call i32 @fputs(i8* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void separate(const char *info) {
  if (info)
    printf("------- %s -------\n", info);
  else
    puts("------------------");
}


x86 assembly (clang, -O0):
<separate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <separate+0x2c>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
jmp    1158 <separate+0x38>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<separate>:
test   %rdi,%rdi
je     1134 <separate+0x14>
mov    %rdi,%rsi
lea    0xed1(%rip),%rdi
jmp    1040 <printf@plt>
lea    0xed9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"------- %s -------\0A\00"
@.str.1 = [19 x i8] c"------------------\00"
define void @separate(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %1
%9 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"------- %s -------\0A\00"
@.str.1 = [19 x i8] c"------------------\00"
define void @separate(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
void swapVars(int *varA, int *varB) {
  int tempx;
  tempx = *varA;
  *varA = *varB;
  *varB = tempx;
}


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

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

LLVM IR (-O0):
define void @swapVars(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swapVars(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void ff_hevc_put_hevc_uni_qpel_hv48_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_hv48_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int write(int, char *, int);
int xwrite(int fd, char *buf, int nbytes) {
  int nb;
  if ((nb = write(fd, buf, nbytes)) == -1)
    perror("42sh:");
  return (nb);
}


x86 assembly (clang, -O0):
<xwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1159 <xwrite+0x39>
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xwrite>:
push   %rbx
call   1030 <write@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1131 <xwrite+0x11>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
jmp    112d <xwrite+0xd>

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

LLVM IR (-O2):
@.str = [6 x i8] c"42sh:\00"
define i32 @xwrite(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int write(int, char *, int);
void __attribute__((optimize("0"))) instruction_count_end(void) {
  int size;
  size = write(197, "end", sizeof("end"));
  if (size != sizeof("end"))
    exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<instruction_count_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc5,%edi
lea    0xecc(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0x4,%rax
je     115d <instruction_count_end+0x3d>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<instruction_count_end>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0xc5,%edi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x4,%eax
jne    113e <instruction_count_end+0x1e>
pop    %rax
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"end\00"
@EXIT_FAILURE = global i32 0
define void @instruction_count_end() {
%1 = alloca i32
%2 = call i32 @write(i32 197, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = icmp ne i64 %4, 4
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"end\00"
@EXIT_FAILURE = global i32 0
define void @instruction_count_end() {
%1 = tail call i32 @write(i32 197, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = icmp eq i32 %1, 4
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
6: ; preds = %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *__init_file(int, int, int);
int __parse_mode(char const *);
int open(char const *, int, int);
FILE *fopen(const char *path, const char *mode) {
  int fd;
  int flags;
  flags = __parse_mode(mode);
  fd = open(path, flags, 0666);
  if (fd < 0) {
    return NULL;
  }
  return __init_file(fd, 1, flags);
}


x86 assembly (clang, -O0):
<fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <__parse_mode@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    $0x1b6,%edx
call   1050 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1177 <fopen+0x47>
movq   $0x0,-0x8(%rbp)
jmp    118b <fopen+0x5b>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%edx
mov    $0x1,%esi
call   1030 <__init_file@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <__parse_mode@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x1b6,%edx
call   1050 <open@plt>
test   %eax,%eax
js     1169 <fopen+0x39>
mov    %eax,%edi
mov    $0x1,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__init_file@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @fopen(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @__parse_mode(i8* %1)
%4 = tail call i32 @open(i8* %0, i32 %3, i32 438)
%5 = icmp slt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32* @__init_file(i32 %4, i32 1, i32 %3)
br label %8
8: ; preds = %2, %6
%9 = phi i32* [ %7, %6 ], [ null, %2 ]
ret i32* %9
}
void view_bar_as_foo(struct bar *bar_as_foo) {}


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

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

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

LLVM IR (-O2):
%struct.bar = type opaque
define void @view_bar_as_foo(%struct.bar* nocapture %0) {
ret void
}
void RAWToARGBRow_C() {}


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

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

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

LLVM IR (-O2):
define void @RAWToARGBRow_C() {
ret void
}
/* Variables and functions */
int memcmp(void const *, void const *, size_t);
int(mps_lib_memcmp)(const void *s1, const void *s2, size_t n) {
  return memcmp(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<mps_lib_memcmp>:
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @mps_lib_memcmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}