xunge/DecIR huggingface dataset:
int test_imm_6Duint8_reg(unsigned char val) {
  return ((val) & (0x6D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Duint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 109
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_6Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 109
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gtk_list_store_move_after() {}


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

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

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

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

/* Variables and functions */
uint32_t read_32_be(unsigned char *b) {
  uint32_t t = 0;
  for (int i = 0; i < 4; i++) {
    t *= 0x100;
    t += b[i];
  }
  return t;
}


x86 assembly (clang, -O0):
<read_32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1149 <read_32_be+0x49>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <read_32_be+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_32_be(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %3, 16
%8 = shl nuw nsw i32 %6, 8
%9 = or i32 %7, %8
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
%14 = shl nuw nsw i32 %13, 8
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pass_test() { printf("PASSED\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"PASSED\0A\00"
define void @pass_test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"PASSED\00"
define void @pass_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int INT_MAX;
int /*<<< orphan*/ abort();
scalar_t__ foo(unsigned int);
int main(int argc, char *argv[]) {
  unsigned int u = INT_MAX;
  if (foo(u) == 0)
    abort();
  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)
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <foo@plt>
cmp    $0x0,%rax
jne    115b <main+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <foo@plt>
test   %rax,%rax
je     1138 <main+0x18>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @INT_MAX
%4 = tail call i64 @foo(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret i32 0
}
float blue(float value) {
  if (value < 0.25f)
    return 1.f;
  else if (value < 0.5f)
    return 1 - ((value - 0.25f) * 4);
  return 0.f;
}


x86 assembly (clang, -O0):
<blue>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112d <blue+0x2d>
movss  0xee9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118c <blue+0x8c>
movss  0xecf(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    117f <blue+0x7f>
movss  -0x8(%rbp),%xmm0
movss  0xeb4(%rip),%xmm1
subss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xea3(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe9b(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118c <blue+0x8c>
jmp    1184 <blue+0x84>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<blue>:
movss  0xefc(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1117 <blue+0x17>
movss  0xeeb(%rip),%xmm1
jmp    1140 <blue+0x40>
xorps  %xmm1,%xmm1
movss  0xee6(%rip),%xmm2
ucomiss %xmm0,%xmm2
jbe    1140 <blue+0x40>
addss  0xedd(%rip),%xmm0
mulss  0xed9(%rip),%xmm0
addss  0xec1(%rip),%xmm0
ret
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @blue(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 2.500000e-01
br i1 %5, label %6, label %7
6: ; preds = %1
store float 1.000000e+00, float* %2
br label %17
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp olt float %8, 5.000000e-01
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load float, float* %3
%12 = fsub float %11, 2.500000e-01
%13 = fneg float %12
%14 = call float @llvm.fmuladd.f32(float %13, float 4.000000e+00, float 1.000000e+00)
store float %14, float* %2
br label %17
15: ; preds = %7
br label %16
16: ; preds = %15
store float 0.000000e+00, float* %2
br label %17
17: ; preds = %16, %10, %6
%18 = load float, float* %2
ret float %18
}

LLVM IR (-O2):
define float @blue(float %0) {
%2 = fcmp olt float %0, 2.500000e-01
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fcmp olt float %0, 5.000000e-01
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = fadd float %0, -2.500000e-01
%7 = fneg float %6
%8 = tail call float @llvm.fmuladd.f32(float %7, float 4.000000e+00, float 1.000000e+00)
br label %9
9: ; preds = %3, %1, %5
%10 = phi float [ %8, %5 ], [ 1.000000e+00, %1 ], [ 0.000000e+00, %3 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ append();
int current();
int /*<<< orphan*/ lex_error();
void expect_ch(int ch) {
  if (ch == current())
    append();
  else
    lex_error();
}


x86 assembly (clang, -O0):
<expect_ch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <current@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jne    1161 <expect_ch+0x31>
mov    $0x0,%al
call   1030 <append@plt>
jmp    1168 <expect_ch+0x38>
mov    $0x0,%al
call   1040 <lex_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_ch>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <current@plt>
cmp    %ebx,%eax
jne    1146 <expect_ch+0x16>
xor    %eax,%eax
pop    %rbx
jmp    1030 <append@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <lex_error@plt>

LLVM IR (-O0):
define void @expect_ch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @current()
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @append()
br label %10
8: ; preds = %1
%9 = call i32 (...) @lex_error()
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @expect_ch(i32 %0) {
%2 = tail call i32 (...) @current()
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @append()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @lex_error()
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
long mergeSort(int *, int *, int /*<<< orphan*/, int);
long pocet_neusporiadanych_dvojic(int *a, int n) {
  int *x = (int *)malloc(n * sizeof(int));
  return mergeSort(a, x, 0, n - 1);
}


x86 assembly (clang, -O0):
<pocet_neusporiadanych_dvojic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <mergeSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pocet_neusporiadanych_dvojic>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <mergeSort@plt>

LLVM IR (-O0):
define i64 @pocet_neusporiadanych_dvojic(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* %4
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %3
%13 = load i32*, i32** %5
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = call i64 @mergeSort(i32* %12, i32* %13, i32 0, i32 %15)
ret i64 %16
}

LLVM IR (-O2):
define i64 @pocet_neusporiadanych_dvojic(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = add nsw i32 %1, -1
%7 = tail call i64 @mergeSort(i32* %0, i32* %5, i32 0, i32 %6)
ret i64 %7
}
int CRYPTO_pop_info(void) { return (0); }


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

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

LLVM IR (-O0):
define i32 @CRYPTO_pop_info() {
ret i32 0
}

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

/* Variables and functions */
void uDMAChannelRequest(uint32_t ui32Base, uint32_t ui32ChannelNum) {
  ;
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000014))) = 1 << ui32ChannelNum;
}


x86 assembly (clang, -O0):
<uDMAChannelRequest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    -0x4(%rbp),%eax
add    $0x14,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelRequest>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
movslq %edi,%rcx
mov    %rax,0x14(%rcx)
ret

LLVM IR (-O0):
define void @uDMAChannelRequest(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = sext i32 %6 to i64
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 20
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
store volatile i64 %7, i64* %11
ret void
}

LLVM IR (-O2):
define void @uDMAChannelRequest(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sext i32 %3 to i64
%5 = add nsw i32 %0, 20
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
store volatile i64 %4, i64* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ tx(int /*<<< orphan*/);
void tx_or_die(uint8_t c) {
  {
    if (!(tx(c))) {
      perror("error writing to stdout");
      exit(EXIT_FAILURE);
    }
  };
}


x86 assembly (clang, -O0):
<tx_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <tx@plt>
cmp    $0x0,%eax
jne    1166 <tx_or_die+0x36>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx_or_die>:
push   %rax
call   1040 <tx@plt>
test   %eax,%eax
je     113c <tx_or_die+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [24 x i8] c"error writing to stdout\00"
@EXIT_FAILURE = global i32 0
define void @tx_or_die(i32 %0) {
%2 = tail call i32 @tx(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_UD_PIN() { clear_io_bit(0x34, 1); }


x86 assembly (clang, -O0):
<TOSH_CLR_UD_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
mov    $0x1,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_UD_PIN>:
mov    $0x34,%edi
mov    $0x1,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_UD_PIN() {
%1 = call i32 @clear_io_bit(i32 52, i32 1)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_UD_PIN() {
%1 = tail call i32 @clear_io_bit(i32 52, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panel_set_led(int, int);
void panel_update_run_led(int state) {
  static int oldstate = 0;
  if (state != oldstate) {
    if (state) {
      panel_set_led(10, 2);
    } else {
      panel_set_led(10, 0);
    }
    oldstate = state;
  }
}


x86 assembly (clang, -O0):
<panel_update_run_led>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    0x2f08(%rip),%eax
je     115d <panel_update_run_led+0x4d>
cmpl   $0x0,-0x4(%rbp)
je     1148 <panel_update_run_led+0x38>
mov    $0xa,%edi
mov    $0x2,%esi
call   1030 <panel_set_led@plt>
jmp    1154 <panel_update_run_led+0x44>
mov    $0xa,%edi
xor    %esi,%esi
call   1030 <panel_set_led@plt>
mov    -0x4(%rbp),%eax
mov    %eax,0x2ecf(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panel_update_run_led>:
push   %rbx
cmp    %edi,0x2f15(%rip)
je     1135 <panel_update_run_led+0x25>
mov    %edi,%ebx
xor    %esi,%esi
test   %edi,%edi
setne  %sil
add    %esi,%esi
mov    $0xa,%edi
call   1030 <panel_set_led@plt>
mov    %ebx,0x2ef7(%rip)
pop    %rbx
ret

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

LLVM IR (-O2):
@panel_update_run_led.oldstate = internal unnamed_addr global i32 0
define void @panel_update_run_led(i32 %0) {
%2 = load i32, i32* @panel_update_run_led.oldstate
%3 = icmp eq i32 %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = icmp eq i32 %0, 0
%6 = select i1 %5, i32 0, i32 2
%7 = tail call i32 @panel_set_led(i32 10, i32 %6)
store i32 %0, i32* @panel_update_run_led.oldstate
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("Kaixo Mundua!!!\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Kaixo Mundua!!!\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Kaixo Mundua!!!\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
int fromDecimal(int n, int b) {
  int result = 0;
  int multiplier = 1;
  while (n > 0) {
    result += n % b * multiplier;
    multiplier *= 10;
    n /= b;
  }
  return result;
}


x86 assembly (clang, -O0):
<fromDecimal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114d <fromDecimal+0x4d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0xa,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1118 <fromDecimal+0x18>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromDecimal>:
test   %edi,%edi
jle    1124 <fromDecimal+0x24>
mov    %edi,%eax
xor    %ecx,%ecx
mov    $0x1,%edi
nopl   (%rax)
cltd
idiv   %esi
imul   %edi,%edx
add    %edx,%ecx
add    %edi,%edi
lea    (%rdi,%rdi,4),%edi
test   %eax,%eax
jg     1110 <fromDecimal+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fromDecimal(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
store i32 0, i32* %5
store i32 1, i32* %6
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %5
%17 = add nsw i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %6
%19 = mul nsw i32 %18, 10
store i32 %19, i32* %6
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = sdiv i32 %21, %20
store i32 %22, i32* %3
br label %7
23: ; preds = %7
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @fromDecimal(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %10, %4 ], [ 0, %2 ]
%7 = phi i32 [ %12, %4 ], [ %0, %2 ]
%8 = srem i32 %7, %1
%9 = mul nsw i32 %8, %5
%10 = add nsw i32 %9, %6
%11 = mul nsw i32 %5, 10
%12 = sdiv i32 %7, %1
%13 = icmp sgt i32 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %15
}
int sortedOrder(int a, int b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i32 @sortedOrder(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeArray(char *arr[]) {
  int i = 0;
  while (arr[i] != NULL) {
    free(arr[i++]);
  }
}


x86 assembly (clang, -O0):
<freeArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1156 <freeArray+0x46>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    1123 <freeArray+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeArray>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <freeArray+0x21>
add    $0x8,%rbx
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <freeArray+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @freeArray(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %10, %4 ], [ %2, %1 ]
%7 = add nuw nsw i64 %5, 1
%8 = tail call i32 @free(i8* %6)
%9 = getelementptr inbounds i8*, i8** %0, i64 %7
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  printf("Enter two numbers\n");
  scanf("%d %d", &a, &b);
  printf("The gcd is %d", gcd(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <gcd@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1060 <gcd@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter two numbers\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [14 x i8] c"The gcd is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @gcd(i32 %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [14 x i8] c"The gcd is %d\00"
@str = [18 x i8] c"Enter two numbers\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @gcd(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
void fast_log_bsend_error_dump(struct fast_log_entry *fe
                               __attribute__((unused)),
                               char *buf __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
%struct.fast_log_entry = type opaque
define void @fast_log_bsend_error_dump(%struct.fast_log_entry* nocapture %0, i8* nocapture %1) {
ret void
}
void netsnmp_generic_delete_table(void *table) {}


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

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

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

LLVM IR (-O2):
define void @netsnmp_generic_delete_table(i8* nocapture %0) {
ret void
}
__attribute__((no, noclone)) char *f5(char *p, int i) { return p - i; }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %rdi,%rax
movslq %esi,%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @f5(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 = sext i32 %6 to i64
%8 = sub i64 0, %7
%9 = getelementptr inbounds i8, i8* %5, i64 %8
ret i8* %9
}

LLVM IR (-O2):
define i8* @f5(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = sub nsw i64 0, %3
%5 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %5
}
/* Variables and functions */
int rand();
int randi(int a, int b) { return (rand() % (b - a)) + a; }


x86 assembly (clang, -O0):
<randi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randi>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randi(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @randi(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
void close_xls(fd) int fd;
{
  do_eof(fd);
  close(fd);
}


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

x86 assembly (clang, -O2):
<close_xls>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <do_eof@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @close_xls(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @do_eof to i32 (i32, ...)*)(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %5)
ret void
}

LLVM IR (-O2):
define void @close_xls(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @do_eof to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
ret void
}
void Android420ToI420() {}


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

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

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

LLVM IR (-O2):
define void @Android420ToI420() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x43() {
  Assert_real((isprint(67)),
              "/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_isprint.c",
              340, ("isprint should be 1 for C"));
}


x86 assembly (clang, -O0):
<t_isprint_0x43>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x154,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x43>:
push   %rax
mov    $0x43,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x154,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for C\00"
define void @t_isprint_0x43() {
%1 = call i32 @isprint(i32 67)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 340, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for C\00"
define void @t_isprint_0x43() {
%1 = tail call i32 @isprint(i32 67)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 340, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ KTraderParse_error(char const *);
void kiotradererror(const char *s) { KTraderParse_error(s); }


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

x86 assembly (clang, -O2):
<kiotradererror>:
jmp    1030 <KTraderParse_error@plt>

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

LLVM IR (-O2):
define void @kiotradererror(i8* %0) {
%2 = tail call i32 @KTraderParse_error(i8* %0)
ret void
}
long __syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6) {
  unsigned long __ret;
  __asm__ __volatile__("push %6 ; call __vsyscall6 ; add $4,%%esp"
                       : "=a"(__ret)
                       : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4),
                         "g"(0 + (long[]){a5, a6})
                       : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall6>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%r8
mov    %r8,-0x48(%rbp)
mov    0x10(%rbp),%r8
mov    %r8,-0x40(%rbp)
lea    -0x48(%rbp),%r8
mov    %r8,-0x50(%rbp)
push   -0x50(%rbp)
call   1030 <__vsyscall6@plt>
add    $0x4,%esp
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall6>:
mov    %rcx,%r10
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rax
mov    0x8(%rsp),%rsi
mov    %r9,-0x10(%rsp)
mov    %rsi,-0x8(%rsp)
lea    -0x10(%rsp),%rsi
mov    %rsi,-0x18(%rsp)
mov    %r10,%rdi
mov    %r8,%rsi
push   -0x18(%rsp)
call   1030 <__vsyscall6@plt>
add    $0x4,%esp
ret

LLVM IR (-O0):
define i64 @__syscall6(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca [2 x i64]
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%17 = load i64, i64* %8
%18 = load i64, i64* %9
%19 = load i64, i64* %10
%20 = load i64, i64* %11
%21 = load i64, i64* %12
%22 = getelementptr inbounds [2 x i64], [2 x i64]* %16, i64 0, i64 0
%23 = load i64, i64* %13
store i64 %23, i64* %22
%24 = getelementptr inbounds i64, i64* %22, i64 1
%25 = load i64, i64* %14
store i64 %25, i64* %24
%26 = getelementptr inbounds [2 x i64], [2 x i64]* %16, i64 0, i64 0
%27 = getelementptr inbounds i64, i64* %26, i64 0
%28 = call i64 asm sideeffect "push $6 ; call __vsyscall6 ; add $$4,%esp", "={ax},{ax},{dx},{cx},{di},{si},imr,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %17, i64 %18, i64 %19, i64 %20, i64 %21, i64* %27)
store i64 %28, i64* %15
%29 = load i64, i64* %15
ret i64 %29
}

LLVM IR (-O2):
define i64 @__syscall6(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca [2 x i64]
%9 = getelementptr inbounds [2 x i64], [2 x i64]* %8, i64 0, i64 0
store i64 %5, i64* %9
%10 = getelementptr inbounds [2 x i64], [2 x i64]* %8, i64 0, i64 1
store i64 %6, i64* %10
%11 = call i64 asm sideeffect "push $6 ; call __vsyscall6 ; add $$4,%esp", "={ax},{ax},{dx},{cx},{di},{si},imr,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64* %9)
ret i64 %11
}
__attribute__((noipa)) void foo(char *p) {
  if (__builtin_strlen(p) != 9)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x9,%rax
je     1144 <foo+0x24>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1040 <strlen@plt>
cmp    $0x9,%rax
jne    112e <foo+0xe>
pop    %rax
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = icmp ne i64 %4, 9
br i1 %5, label %6, label %7
6: ; preds = %1
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 9
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_putc(int /*<<< orphan*/);
void serial_write(void *buf, size_t len) {
  char *p = buf;
  while (len-- > 0)
    serial_putc(*p++);
}


x86 assembly (clang, -O0):
<serial_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    115d <serial_write+0x4d>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%edi
call   1030 <serial_putc@plt>
jmp    1128 <serial_write+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <serial_write+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <serial_putc@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <serial_write+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @serial_write(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %8, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = add i64 %6, -1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = tail call i32 @serial_putc(i32 %10)
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
int ti_sum_start(double const *options) { return (int)options[0] - 1; }


x86 assembly (clang, -O0):
<ti_sum_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_sum_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_sum_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_sum_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
void atomic_barrier() { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @atomic_barrier() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @atomic_barrier() {
fence seq_cst
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
int skip_whitespace(const char **str) {
  while (isspace(**str))
    ++*str;
  return 1;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1148 <skip_whitespace+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <skip_whitespace+0xc>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     113a <skip_whitespace+0x2a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <skip_whitespace+0x10>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @skip_whitespace(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %9, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = call i64 @isspace(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
br label %3
13: ; preds = %3
ret i32 1
}

LLVM IR (-O2):
define i32 @skip_whitespace(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = tail call i64 @isspace(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret i32 1
}
unsigned char __atomic_fetch_add_1(volatile void *atom, unsigned char value,
                                   int memorder) {
  unsigned char xchg;
  unsigned char cmp;
  __atomic_load((unsigned char *)atom, (unsigned char *)&cmp, 0);
  do {
    xchg = ((cmp + value));
  } while (
      !__atomic_compare_exchange((unsigned char *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_add_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
movzbl -0x9(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x12(%rbp),%al
mov    -0x11(%rbp),%dl
lock cmpxchg %dl,(%rcx)
mov    %al,%cl
sete   %al
mov    %al,-0x15(%rbp)
mov    %cl,-0x14(%rbp)
test   $0x1,%al
jne    114e <__atomic_fetch_add_1+0x4e>
mov    -0x14(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111a <__atomic_fetch_add_1+0x1a>
movzbl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_add_1>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
lea    (%rcx,%rsi,1),%edx
lock cmpxchg %dl,(%rdi)
jne    1110 <__atomic_fetch_add_1+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @__atomic_fetch_add_1(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = load atomic i8, i8* %10 monotonic
store i8 %11, i8* %8
br label %12
12: ; preds = %27, %3
%13 = load i8, i8* %8
%14 = zext i8 %13 to i32
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = add nsw i32 %14, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
br label %19
19: ; preds = %12
%20 = load i8*, i8** %4
%21 = load i8, i8* %8
%22 = load i8, i8* %7
%23 = cmpxchg weak i8* %20, i8 %21, i8 %22 seq_cst seq_cst
%24 = extractvalue { i8, i1 } %23, 0
%25 = extractvalue { i8, i1 } %23, 1
br i1 %25, label %27, label %26
26: ; preds = %19
store i8 %24, i8* %8
br label %27
27: ; preds = %26, %19
%28 = zext i1 %25 to i8
store i8 %28, i8* %9
%29 = load i8, i8* %9
%30 = trunc i8 %29 to i1
%31 = xor i1 %30, true
br i1 %31, label %12, label %32
32: ; preds = %27
%33 = load i8, i8* %8
ret i8 %33
}

LLVM IR (-O2):
define zeroext i8 @__atomic_fetch_add_1(i8* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = load atomic i8, i8* %0 monotonic
br label %5
5: ; preds = %5, %3
%6 = phi i8 [ %4, %3 ], [ %10, %5 ]
%7 = add i8 %6, %1
%8 = cmpxchg weak i8* %0, i8 %6, i8 %7 seq_cst seq_cst
%9 = extractvalue { i8, i1 } %8, 1
%10 = extractvalue { i8, i1 } %8, 0
br i1 %9, label %11, label %5
11: ; preds = %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ err_exit(char *, int /*<<< orphan*/);
char *strchr(char const *, int);
char *Strchr(const char *s, int c) {
  if (!s)
    err_exit("Strchr(NULL)\n", 0);
  return strchr(s, c);
}


x86 assembly (clang, -O0):
<Strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <Strchr+0x28>
lea    0xebf(%rip),%rdi
xor    %esi,%esi
call   1040 <err_exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   %rdi,%rdi
jne    113b <Strchr+0x1b>
lea    0xecc(%rip),%rdi
xor    %esi,%esi
call   1040 <err_exit@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strchr@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Strchr(NULL)\0A\00"
define i8* @Strchr(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 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @err_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
br label %9
9: ; preds = %7, %2
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i8* @strchr(i8* %10, i32 %11)
ret i8* %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"Strchr(NULL)\0A\00"
define i8* @Strchr(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @err_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
br label %6
6: ; preds = %4, %2
%7 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ triangleTest();
int main() {
  triangleTest();
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ hd44780_clear_display();
int8_t dmd_clearscreen(void) { return (hd44780_clear_display()); }


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

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

LLVM IR (-O0):
define i32 @dmd_clearscreen() {
%1 = call i32 (...) @hd44780_clear_display()
ret i32 %1
}

LLVM IR (-O2):
define i32 @dmd_clearscreen() {
%1 = tail call i32 (...) @hd44780_clear_display()
ret i32 %1
}
void mp_msg_c(int x, const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @mp_msg_c(i32 %0, i8* nocapture %1, ...) {
ret void
}