xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ xxx();
int main(void) {
  xxx();
  printf("OK\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <xxx@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i32 (...) @xxx()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ plot_sine();
int /*<<< orphan*/ test_qs();
int /*<<< orphan*/ test_queue();
int main(int argc, const char *argv[]) {
  plot_sine();
  test_qs();
  test_queue();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @plot_sine()
%4 = tail call i32 (...) @test_qs()
%5 = tail call i32 (...) @test_queue()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ C_LOG2F(double);
int main() {
  C_LOG2F(1.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
call   1030 <C_LOG2F@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <C_LOG2F@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @C_LOG2F(double 1.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @C_LOG2F(double 1.000000e+00)
ret i32 0
}
/* Variables and functions */
int ares_expand_name(unsigned char const *, unsigned char const *, int, char **,
                     long *);
int ares__expand_name_for_response(const unsigned char *encoded,
                                   const unsigned char *abuf, int alen,
                                   char **s, long *enclen) {
  int status = ares_expand_name(encoded, abuf, alen, s, enclen);
  if (status == 8)
    status = 10;
  return status;
}


x86 assembly (clang, -O0):
<ares__expand_name_for_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <ares_expand_name@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x8,-0x2c(%rbp)
jne    1157 <ares__expand_name_for_response+0x47>
movl   $0xa,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ares__expand_name_for_response>:
push   %rax
call   1030 <ares_expand_name@plt>
cmp    $0x8,%eax
mov    $0xa,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ares__expand_name_for_response(i8* %0, i8* %1, i32 %2, i8** %3, i64* %4) {
%6 = tail call i32 @ares_expand_name(i8* %0, i8* %1, i32 %2, i8** %3, i64* %4)
%7 = icmp eq i32 %6, 8
%8 = select i1 %7, i32 10, i32 %6
ret i32 %8
}
/* Variables and functions */
float flrand(float, float);
float Q_flrand(float min, float max) { return flrand(min, max); }


x86 assembly (clang, -O0):
<Q_flrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <flrand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_flrand>:
jmp    1030 <flrand@plt>

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

LLVM IR (-O2):
define float @Q_flrand(float %0, float %1) {
%3 = tail call float @flrand(float %0, float %1)
ret float %3
}
int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev,
                                      const struct iio_chan_spec *channels,
                                      unsigned int num_channels) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
%struct.iio_chan_spec = type opaque
define i32 @iio_simple_dummy_configure_buffer(%struct.iio_dev* %0, %struct.iio_chan_spec* %1, i32 %2) {
%4 = alloca %struct.iio_dev*
%5 = alloca %struct.iio_chan_spec*
%6 = alloca i32
store %struct.iio_dev* %0, %struct.iio_dev** %4
store %struct.iio_chan_spec* %1, %struct.iio_chan_spec** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
%struct.iio_chan_spec = type opaque
define i32 @iio_simple_dummy_configure_buffer(%struct.iio_dev* nocapture readnone %0, %struct.iio_chan_spec* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hexprint(unsigned char *);
int /*<<< orphan*/ printf(char *);
void modmprint(unsigned char a[32]) {
  printf("Mod(hex(\"");
  hexprint(a);
  printf("\"),m)");
}


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

x86 assembly (clang, -O2):
<modmprint>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <hexprint@plt>
lea    0xecb(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Mod(hex(\22\00"
@.str.1 = [6 x i8] c"\22),m)\00"
define void @modmprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @hexprint(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Mod(hex(\22\00"
@.str.1 = [6 x i8] c"\22),m)\00"
define void @modmprint(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @hexprint(i8* %0)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ CmdRdChk_OFILM();
int /*<<< orphan*/ RegReadA_Ofilm(int, unsigned char *);
void AccWit_OFILM(unsigned char UcTrgDat_OFILM) {
  unsigned char UcFlgVal_OFILM;
  UcFlgVal_OFILM = 1;
  while (UcFlgVal_OFILM) {
    RegReadA_Ofilm(0x0282, &UcFlgVal_OFILM);
    UcFlgVal_OFILM &= UcTrgDat_OFILM;
    if (CmdRdChk_OFILM() != 0)
      break;
  };
}


x86 assembly (clang, -O0):
<AccWit_OFILM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1172 <AccWit_OFILM+0x52>
mov    $0x282,%edi
lea    -0x2(%rbp),%rsi
call   1030 <RegReadA_Ofilm@plt>
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1040 <CmdRdChk_OFILM@plt>
cmp    $0x0,%rax
je     116d <AccWit_OFILM+0x4d>
jmp    1172 <AccWit_OFILM+0x52>
jmp    1132 <AccWit_OFILM+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccWit_OFILM>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movb   $0x1,0x7(%rsp)
lea    0x7(%rsp),%r14
mov    $0x282,%edi
mov    %r14,%rsi
call   1030 <RegReadA_Ofilm@plt>
and    %bl,0x7(%rsp)
xor    %eax,%eax
call   1040 <CmdRdChk_OFILM@plt>
test   %rax,%rax
jne    1154 <AccWit_OFILM+0x34>
cmpb   $0x0,0x7(%rsp)
jne    1130 <AccWit_OFILM+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @AccWit_OFILM(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 1, i8* %3
br label %4
4: ; preds = %18, %1
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = call i32 @RegReadA_Ofilm(i32 642, i8* %3)
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = and i32 %12, %10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
%15 = call i64 (...) @CmdRdChk_OFILM()
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %7
br label %19
18: ; preds = %7
br label %4
19: ; preds = %17, %4
ret void
}

LLVM IR (-O2):
define void @AccWit_OFILM(i8 zeroext %0) {
%2 = alloca i8
store i8 1, i8* %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @RegReadA_Ofilm(i32 642, i8* %2)
%5 = load i8, i8* %2
%6 = and i8 %5, %0
store i8 %6, i8* %2
%7 = call i64 (...) @CmdRdChk_OFILM()
%8 = icmp eq i64 %7, 0
%9 = load i8, i8* %2
%10 = icmp ne i8 %9, 0
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %3, label %12
12: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ line;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
char *read_line(const char *prompt) {
  static char line[1024];
  line[sizeof(line) - 1] = 0;
  fputs(prompt, stdout);
  fflush(stdout);
  return fgets(line, sizeof(line) - 1, stdin);
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,0x330c(%rip)
mov    -0x8(%rbp),%rdi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
lea    0x2edd(%rip),%rdi
mov    $0x3ff,%esi
call   1040 <fgets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x3314(%rip)
lea    0x2f0e(%rip),%r14
mov    0x2e8f(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    $0x3ff,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fgets@plt>

LLVM IR (-O0):
@read_line.line = internal global [1024 x i8] zeroinitializer
@stdout = global i32 0
@stdin = global i32 0
define i8* @read_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @read_line.line, i64 0, i64 1023)
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = load i32, i32* @stdin
%9 = call i8* @fgets(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @read_line.line, i64 0, i64 0), i32 1023, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
@read_line.line = internal global [1024 x i8] zeroinitializer
@stdout = global i32 0
@stdin = global i32 0
define i8* @read_line(i8* %0) {
store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @read_line.line, i64 0, i64 1023)
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stdin
%7 = tail call i8* @fgets(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @read_line.line, i64 0, i64 0), i32 1023, i32 %6)
ret i8* %7
}
int range(int val, int min, int max) {
  if ((val < min) || (val > max)) {
    error("value out of range [%d to %d], using %d", min, max, min);
    return min;
  }
  return val;
}


x86 assembly (clang, -O0):
<range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1139 <range+0x29>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    115b <range+0x4b>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <range+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range>:
push   %rbx
mov    %esi,%ebx
cmp    %esi,%edi
jl     111f <range+0xf>
mov    %edi,%eax
cmp    %edx,%edi
jg     111f <range+0xf>
pop    %rbx
ret
lea    0xeda(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"value out of range [%d to %d], using %d\00"
define i32 @range(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %15, label %11
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11, %3
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @error to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* %6
store i32 %20, i32* %4
br label %23
21: ; preds = %11
%22 = load i32, i32* %5
store i32 %22, i32* %4
br label %23
23: ; preds = %21, %15
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
@.str = [40 x i8] c"value out of range [%d to %d], using %d\00"
define i32 @range(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = or i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @error to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %1)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %1, %7 ], [ %0, %3 ]
ret i32 %10
}
int pop(int *stack, int row) {
  int col = stack[row];
  stack[row] = -1;
  return col;
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
movslq %esi,%rcx
mov    (%rdi,%rcx,4),%eax
movl   $0xffffffff,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define i32 @pop(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* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 -1, i32* %14
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @pop(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
store i32 -1, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *read_line(int);
int /*<<< orphan*/ write_line(int, char *);
void read_and_write(int in_fileno, int out_fileno) {
  char *line;
  while (1) {
    line = read_line(in_fileno);
    if (line == NULL) {
      break;
    }
    write_line(out_fileno, line);
    free(line);
  }
}


x86 assembly (clang, -O0):
<read_and_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <read_line@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <read_and_write+0x2a>
jmp    1174 <read_and_write+0x44>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <write_line@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    113e <read_and_write+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_and_write>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1040 <read_line@plt>
test   %rax,%rax
je     1172 <read_and_write+0x42>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %rbx,%rsi
call   1050 <write_line@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
call   1040 <read_line@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <read_and_write+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @read_and_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %2, %12
%7 = load i32, i32* %3
%8 = call i8* @read_line(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %6
br label %18
12: ; preds = %6
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = call i32 @write_line(i32 %13, i8* %14)
%16 = load i8*, i8** %5
%17 = call i32 @free(i8* %16)
br label %6
18: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @read_and_write(i32 %0, i32 %1) {
%3 = tail call i8* @read_line(i32 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %3, %2 ]
%7 = tail call i32 @write_line(i32 %1, i8* %6)
%8 = tail call i32 @free(i8* %6)
%9 = tail call i8* @read_line(i32 %0)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %5
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearScreen(int /*<<< orphan*/);
int /*<<< orphan*/ getMonitor(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  clearScreen(getMonitor(1));
  char buffer[80];
  while (1) {
    printf("[root]# ");
    scanf(" %s", buffer);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x1,%edi
call   1060 <getMonitor@plt>
mov    %eax,%edi
call   1040 <clearScreen@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1050 <scanf@plt>
jmp    1159 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    $0x1,%edi
call   1060 <getMonitor@plt>
mov    %eax,%edi
call   1040 <clearScreen@plt>
lea    0xe9f(%rip),%r14
lea    0xea1(%rip),%r15
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [9 x i8] c"[root]# \00"
@.str.1 = [4 x i8] c" %s\00"
define void @main() {
%1 = alloca [80 x i8]
%2 = call i32 @getMonitor(i32 1)
%3 = call i32 @clearScreen(i32 %2)
br label %4
4: ; preds = %0, %4
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"[root]# \00"
@.str.1 = [4 x i8] c" %s\00"
define void @main() {
%1 = alloca [80 x i8]
%2 = tail call i32 @getMonitor(i32 1)
%3 = tail call i32 @clearScreen(i32 %2)
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
br label %5
5: ; preds = %5, %0
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %5
}
/* Variables and functions */
double M_PI;
double sin(double);
double sinc(double x) {
  double arg = x * M_PI;
  if (arg == 0)
    return 1;
  return sin(arg) / arg;
}


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115c <sinc+0x4c>
jp     115c <sinc+0x4c>
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1170 <sinc+0x60>
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rax
mov    0x2ed0(%rip),%rax
mulsd  (%rax),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1132 <sinc+0x22>
jp     1132 <sinc+0x22>
movsd  0xed0(%rip),%xmm0
pop    %rax
ret
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @sinc(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = load double, double* @M_PI
%7 = fmul double %5, %6
store double %7, double* %4
%8 = load double, double* %4
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %1
store double 1.000000e+00, double* %2
br label %16
11: ; preds = %1
%12 = load double, double* %4
%13 = call double @sin(double %12)
%14 = load double, double* %4
%15 = fdiv double %13, %14
store double %15, double* %2
br label %16
16: ; preds = %11, %10
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @sinc(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call double @sin(double %3)
%7 = fdiv double %6, %3
br label %8
8: ; preds = %1, %5
%9 = phi double [ %7, %5 ], [ 1.000000e+00, %1 ]
ret double %9
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
struct task_struct *_pick_next_task_rt(struct rq *);
int /*<<< orphan*/ dequeue_pushable_task(struct rq *, struct task_struct *);
struct task_struct *pick_next_task_rt(struct rq *rq) {
  struct task_struct *p = _pick_next_task_rt(rq);
  if (p)
    dequeue_pushable_task(rq, p);
  return p;
}


x86 assembly (clang, -O0):
<pick_next_task_rt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_pick_next_task_rt@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <pick_next_task_rt+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <dequeue_pushable_task@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pick_next_task_rt>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <_pick_next_task_rt@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <pick_next_task_rt+0x1f>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <dequeue_pushable_task@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.task_struct = type { i32 }
%struct.rq = type { i32 }
define %struct.task_struct* @pick_next_task_rt(%struct.rq* %0) {
%2 = alloca %struct.rq*
%3 = alloca %struct.task_struct*
store %struct.rq* %0, %struct.rq** %2
%4 = load %struct.rq*, %struct.rq** %2
%5 = call %struct.task_struct* @_pick_next_task_rt(%struct.rq* %4)
store %struct.task_struct* %5, %struct.task_struct** %3
%6 = load %struct.task_struct*, %struct.task_struct** %3
%7 = icmp ne %struct.task_struct* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load %struct.rq*, %struct.rq** %2
%10 = load %struct.task_struct*, %struct.task_struct** %3
%11 = call i32 @dequeue_pushable_task(%struct.rq* %9, %struct.task_struct* %10)
br label %12
12: ; preds = %8, %1
%13 = load %struct.task_struct*, %struct.task_struct** %3
ret %struct.task_struct* %13
}

LLVM IR (-O2):
%struct.task_struct = type { i32 }
%struct.rq = type { i32 }
define %struct.task_struct* @pick_next_task_rt(%struct.rq* %0) {
%2 = tail call %struct.task_struct* @_pick_next_task_rt(%struct.rq* %0)
%3 = icmp eq %struct.task_struct* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @dequeue_pushable_task(%struct.rq* %0, %struct.task_struct* %2)
br label %6
6: ; preds = %4, %1
ret %struct.task_struct* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ecc_ecdsa_sign(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *);
uint8_t ECC_ECDSA_sign(uint32_t *secretKey, uint32_t *text,
                       uint32_t *randString, uint32_t *sign1, uint32_t *sign2) {
  return (uint8_t)ecc_ecdsa_sign((uint32_t *)secretKey, (uint32_t *)text,
                                 (uint32_t *)randString, (uint32_t *)sign1,
                                 (uint32_t *)sign2);
}


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

x86 assembly (clang, -O2):
<ECC_ECDSA_sign>:
jmp    1030 <ecc_ecdsa_sign@plt>

LLVM IR (-O0):
define i32 @ECC_ECDSA_sign(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @ecc_ecdsa_sign(i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @ECC_ECDSA_sign(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @ecc_ecdsa_sign(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fun(int *);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  int x3content[2];
  long nr_of_reductions = 1;
  fun(x3content);
  printf("RETURNED\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"RETURNED\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 1, i64* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%9 = call i32 @fun(i32* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"RETURNED\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = call i32 @fun(i32* %5)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void show_status_line(char *action, char *file, char *status) {
  printf("%-11s %-57s %-10s\n", action, file, status);
  return;
}


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

x86 assembly (clang, -O2):
<show_status_line>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%-11s %-57s %-10s\0A\00"
define void @show_status_line(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%-11s %-57s %-10s\0A\00"
define void @show_status_line(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret void
}
/* Type definitions */
struct decision {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_modes(struct decision *);
void testTortureExecute(void) {
  struct decision *p = 0;
  clear_modes(p);
  return;
}


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

x86 assembly (clang, -O2):
<testTortureExecute>:
xor    %edi,%edi
jmp    1030 <clear_modes@plt>

LLVM IR (-O0):
%struct.decision = type { i32 }
define void @testTortureExecute() {
%1 = alloca %struct.decision*
store %struct.decision* null, %struct.decision** %1
%2 = load %struct.decision*, %struct.decision** %1
%3 = call i32 @clear_modes(%struct.decision* %2)
ret void
}

LLVM IR (-O2):
%struct.decision = type { i32 }
define void @testTortureExecute() {
%1 = tail call i32 @clear_modes(%struct.decision* null)
ret void
}
void gtk_widget_add_accelerator() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_add_accelerator() {
ret void
}
void event_reserved(p) char p;
{}


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

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

LLVM IR (-O0):
define void @event_reserved(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
ret void
}

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

/* Variables and functions */
void *_xregion_malloc(struct _XRegionHandle *, unsigned int);
void *_xregion_calloc(struct _XRegionHandle *r, unsigned int s) {
  return _xregion_malloc(r, s);
}


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

x86 assembly (clang, -O2):
<_xregion_calloc>:
jmp    1030 <_xregion_malloc@plt>

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

LLVM IR (-O2):
%struct._XRegionHandle = type { i32 }
define i8* @_xregion_calloc(%struct._XRegionHandle* %0, i32 %1) {
%3 = tail call i8* @_xregion_malloc(%struct._XRegionHandle* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int unlink(char *);
int libc_unlink(char *p) { return unlink(p); }


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

x86 assembly (clang, -O2):
<libc_unlink>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @libc_unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned int avail_in;
};
typedef TYPE_1__ z_stream;

/* Variables and functions */
unsigned int streaming_commons_get_avail_in(z_stream *stream) {
  return stream->avail_in;
}


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

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @streaming_commons_get_avail_in(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @streaming_commons_get_avail_in(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
__attribute__((no, noclone)) unsigned __int128 t160_3sub(unsigned __int128 y) {
  unsigned __int128 r;
  if (__builtin_sub_overflow((unsigned __int128)(2), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t160_3sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
xor    %ecx,%ecx
mov    $0x2,%edx
sub    %rsi,%rdx
sbb    %rax,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    115d <t160_3sub+0x4d>
jmp    1164 <t160_3sub+0x54>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t160_3sub>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
mov    $0x2,%ebx
sub    %rdi,%rbx
sbb    %rsi,%r14
jae    112b <t160_3sub+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t160_3sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 2, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t160_3sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.usub.with.overflow.i128(i128 2, i128 %6)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
void rotr(int *a, int *b, int *c) {
  int k;
  k = *a + *b;
  *a = *c;
  *b = k - *b;
  *c = k - *b;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rsi),%eax
add    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
sub    %ecx,%eax
mov    %eax,(%rsi)
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define void @rotr(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
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = add nsw i32 %9, %11
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = sub nsw i32 %16, %18
%20 = load i32*, i32** %5
store i32 %19, i32* %20
%21 = load i32, i32* %7
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
%24 = sub nsw i32 %21, %23
%25 = load i32*, i32** %6
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, %4
%7 = load i32, i32* %2
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = sub i32 %6, %8
store i32 %9, i32* %1
store i32 %8, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: ./packet_mmap [OPTION] [INTERFACE]\n"
                  " -h\tshow this help\n"
                  " -g\tuse SOCK_DGRAM\n"
                  " -t\tuse dual thread\n"
                  " -s\tset packet size\n"
                  " -c\tset packet count\n"
                  " -m\tset mtu\n"
                  " -b\tset buffer size\n"
                  " -n\tset buffer count\n"
                  " -j\tset send() period (mask==0)\n"
                  " -z\tset socket buffer size\n"
                  " -l\tdiscard wrong packets\n"
                  " -e\tgenerate error [num]\n"
                  " -v\tbe verbose\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [320 x i8] c"Usage: ./packet_mmap [OPTION] [INTERFACE]\0A -h\09show this help\0A -g\09use SOCK_DGRAM\0A -t\09use dual thread\0A -s\09set packet size\0A -c\09set packet count\0A -m\09set mtu\0A -b\09set buffer size\0A -n\09set buffer count\0A -j\09set send() period (mask==0)\0A -z\09set socket buffer size\0A -l\09discard wrong packets\0A -e\09generate error [num]\0A -v\09be verbose\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([320 x i8], [320 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [320 x i8] c"Usage: ./packet_mmap [OPTION] [INTERFACE]\0A -h\09show this help\0A -g\09use SOCK_DGRAM\0A -t\09use dual thread\0A -s\09set packet size\0A -c\09set packet count\0A -m\09set mtu\0A -b\09set buffer size\0A -n\09set buffer count\0A -j\09set send() period (mask==0)\0A -z\09set socket buffer size\0A -l\09discard wrong packets\0A -e\09generate error [num]\0A -v\09be verbose\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([320 x i8], [320 x i8]* @.str, i64 0, i64 0))
ret void
}
void ft_strclr(char *s) {
  if (s) {
    while (*s)
      *(s++) = '\0';
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <ft_strclr+0x41>
jmp    1118 <ft_strclr+0x18>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <ft_strclr+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    1118 <ft_strclr+0x18>
jmp    1141 <ft_strclr+0x41>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void __tuntap_close(int fd, const char *name) { close(fd); }


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

x86 assembly (clang, -O2):
<__tuntap_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @__tuntap_close(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xb7() {
  Assert_real((isalnum(183) == 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_isalnum.c",
              920, ("isalnum should be 0 for 0xb7"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xb7>:
push   %rax
mov    $0xb7,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x398,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xb7\00"
define void @t_isalnum_0xb7() {
%1 = call i64 @isalnum(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xb7\00"
define void @t_isalnum_0xb7() {
%1 = tail call i64 @isalnum(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}