xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main() {
  if ('0') {
    puts("TRUE");
  } else
    puts("FALSE");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"TRUE\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 5, b = 6;
  int sum;
  sum = a + b;
  printf("Sum: %d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"Sum: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 11)
ret i32 0
}
/* Variables and functions */
int getchar();
void read_line(char *buffer) {
  int character;
  do {
    character = getchar();
    *buffer = (char)character;
    ++buffer;
  } while (character != '\n');
  *(--buffer) = '\0';
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    111c <read_line+0xc>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,-0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
cmp    $0xa,%eax
jne    1120 <read_line+0x10>
movb   $0x0,-0x1(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @read_line(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 (...) @getchar()
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = icmp eq i32 %4, 10
br i1 %7, label %8, label %2
8: ; preds = %2
store i8 0, i8* %3
ret void
}
void print_obst(double p[], double q[], int i, int j) {}


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

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

LLVM IR (-O0):
define void @print_obst(double* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @print_obst(double* nocapture %0, double* nocapture %1, i32 %2, i32 %3) {
ret void
}
int test_switch(int i) {
  switch (i) {
  case 1:
  case 2:
  case 4:
  case 8:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<test_switch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     1140 <test_switch+0x40>
jmp    111e <test_switch+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1140 <test_switch+0x40>
jmp    112f <test_switch+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
jne    114c <test_switch+0x4c>
jmp    1140 <test_switch+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1153 <test_switch+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_switch>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     1117 <test_switch+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @test_switch(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1, label %5
i32 2, label %5
i32 4, label %5
i32 8, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.test_switch = [8 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 1]
define i32 @test_switch(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.test_switch, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void derived_real_who_am_i(void) { printf("I'm derived!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"I'm derived!\0A\00"
define void @derived_real_who_am_i() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"I'm derived!\00"
define void @derived_real_who_am_i() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, int);
int inet6_opt_set_val(void *databuf, int offset, void *val, socklen_t vallen) {
  memcpy((uint8_t *)databuf + offset, val, vallen);
  return offset + vallen;
}


x86 assembly (clang, -O0):
<inet6_opt_set_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_opt_set_val>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
movslq %esi,%rbx
lea    (%rdi,%rbx,4),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <memcpy@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inet6_opt_set_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @memcpy(i32* %13, i8* %14, i32 %15)
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @inet6_opt_set_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = tail call i32 @memcpy(i32* %7, i8* %2, i32 %3)
%9 = add nsw i32 %3, %1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                         char const *);
void warn_errno(const char *message) {
  error(0, errno, "warning: %s", message);
}


x86 assembly (clang, -O0):
<warn_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
xor    %edi,%edi
lea    0xece(%rip),%rdx
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_errno>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
lea    0xedd(%rip),%rdx
xor    %edi,%edi
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@errno = global i32 0
@.str = [12 x i8] c"warning: %s\00"
define void @warn_errno(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @error(i32 0, i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_19int16_reg(short val) {
  return ((val) & (0x19 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_19int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x19,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_19int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 25
%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_19int16_reg(i16 signext %0) {
%2 = and i16 %0, 25
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double inchesToMillimetres(double inches) { return inches * 25.4; }


x86 assembly (clang, -O0):
<inchesToMillimetres>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inchesToMillimetres>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @inchesToMillimetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.540000e+01
ret double %4
}

LLVM IR (-O2):
define double @inchesToMillimetres(double %0) {
%2 = fmul double %0, 2.540000e+01
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __LDREXW(volatile uint32_t *addr) {
  uint32_t result;
  return (result);
}


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

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

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

LLVM IR (-O2):
define i32 @__LDREXW(i32* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int mblen(const char *s, size_t n) {
  if (s) {
    if (n == 0 || *s == 0)
      return 0;
    return 1;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<mblen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <mblen+0x4a>
cmpq   $0x0,-0x18(%rbp)
je     1132 <mblen+0x32>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <mblen+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1151 <mblen+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1151 <mblen+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mblen>:
test   %rdi,%rdi
je     1113 <mblen+0x13>
xor    %eax,%eax
test   %rsi,%rsi
je     1112 <mblen+0x12>
cmpb   $0x0,(%rdi)
setne  %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @mblen(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp eq i64 %1, 0
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = load i8, i8* %0
%8 = icmp ne i8 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2, %4
%11 = phi i32 [ 0, %4 ], [ 1, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ write4ToEco(unsigned char *, unsigned int);
void conv4FromX86ToEco(unsigned char *p) {
  unsigned int data;
  data = *(unsigned int *)p;
  write4ToEco(p, data);
}


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

x86 assembly (clang, -O2):
<conv4FromX86ToEco>:
mov    (%rdi),%esi
jmp    1030 <write4ToEco@plt>

LLVM IR (-O0):
define void @conv4FromX86ToEco(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = call i32 @write4ToEco(i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @conv4FromX86ToEco(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @write4ToEco(i8* %0, i32 %3)
ret void
}
void fakeClConnectionTerminated(long errorCode) {}


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

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

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

LLVM IR (-O2):
define void @fakeClConnectionTerminated(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned short);
int main(int argc, char **argv) {
  short s1 = (argc >= 3) ? argc : -769;
  unsigned short us2 = (unsigned short)s1;
  printf("s1   = %d\n", s1);
  printf("us2  = %u\n", us2);
  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)
cmpl   $0x3,-0x8(%rbp)
jl     113b <main+0x2b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1148 <main+0x38>
mov    $0xfffffcff,%eax
mov    %eax,-0x18(%rbp)
jmp    1148 <main+0x38>
mov    -0x18(%rbp),%eax
mov    %ax,-0x12(%rbp)
mov    -0x12(%rbp),%ax
mov    %ax,-0x14(%rbp)
lea    0xea2(%rip),%rdi
movzwl -0x12(%rbp),%esi
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
movzwl -0x14(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3,%edi
mov    $0xfcff,%eax
cmovge %edi,%eax
movzwl %ax,%ebx
lea    0xeda(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"s1 = %d\0A\00"
@.str.1 = [11 x i8] c"us2 = %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i16
%7 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %10
%14 = phi i32 [ %11, %10 ], [ -769, %12 ]
%15 = trunc i32 %14 to i16
store i16 %15, i16* %6
%16 = load i16, i16* %6
store i16 %16, i16* %7
%17 = load i16, i16* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %17)
%19 = load i16, i16* %7
%20 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"s1 = %d\0A\00"
@.str.1 = [11 x i8] c"us2 = %u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 2
%4 = trunc i32 %0 to i16
%5 = select i1 %3, i16 %4, i16 -769
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void superio_reset(int addrreg, int datareg) {
  outb(0xaa, addrreg);
  outb(0x02, addrreg);
  outb(0x02, datareg);
}


x86 assembly (clang, -O0):
<superio_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xaa,%edi
call   1030 <outb@plt>
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<superio_reset>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xaa,%edi
mov    %ebp,%esi
call   1030 <outb@plt>
mov    $0x2,%edi
mov    %ebp,%esi
call   1030 <outb@plt>
mov    $0x2,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @superio_reset(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 = call i32 @outb(i32 170, i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @outb(i32 2, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @outb(i32 2, i32 %9)
ret void
}

LLVM IR (-O2):
define void @superio_reset(i32 %0, i32 %1) {
%3 = tail call i32 @outb(i32 170, i32 %0)
%4 = tail call i32 @outb(i32 2, i32 %0)
%5 = tail call i32 @outb(i32 2, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int g_DUMMY_cons_fprintf(FILE *file, const char *format, ...) {
  file = file;
  format = format;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @g_DUMMY_cons_fprintf(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
store i32* %5, i32** %3
%6 = load i8*, i8** %4
store i8* %6, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @g_DUMMY_cons_fprintf(i32* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cquat_norm2(double const *);
double sqrt(int /*<<< orphan*/);
double cquat_norm(const double *q) { return sqrt(cquat_norm2(q)); }


x86 assembly (clang, -O0):
<cquat_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cquat_norm2@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cquat_norm>:
push   %rax
call   1030 <cquat_norm2@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @cquat_norm(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @cquat_norm2(double* %3)
%5 = call double @sqrt(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @cquat_norm(double* %0) {
%2 = tail call i32 @cquat_norm2(double* %0)
%3 = tail call double @sqrt(i32 %2)
ret double %3
}
unsigned char is_digit(const char c) { return (c >= 48 && c <= 57) ? 1 : 0; }


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

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

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

LLVM IR (-O2):
define zeroext i8 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ouch(int sig) { printf("\nGot it !!! %d", sig); }


x86 assembly (clang, -O0):
<ouch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ouch>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"\0AGot it !!! %d\00"
define void @ouch(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
void *malloc(size_t);
scalar_t__ size_multiply_overflow(size_t, size_t);
__attribute__((malloc)) __attribute__((alloc_size(1, 2))) void *
malloc_multiply(size_t size, size_t need) {
  if (size_multiply_overflow(size, need))
    return NULL;
  return malloc(size * need);
}


x86 assembly (clang, -O0):
<malloc_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <size_multiply_overflow@plt>
cmp    $0x0,%rax
je     1154 <malloc_multiply+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1166 <malloc_multiply+0x46>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_multiply>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <size_multiply_overflow@plt>
test   %rax,%rax
je     113e <malloc_multiply+0x1e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
imul   %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define noalias i8* @malloc_multiply(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = call i64 @size_multiply_overflow(i64 %6, i64 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* null, i8** %3
br label %16
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = mul i64 %12, %13
%15 = call i8* @malloc(i64 %14)
store i8* %15, i8** %3
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @malloc_multiply(i64 %0, i64 %1) {
%3 = tail call i64 @size_multiply_overflow(i64 %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = mul i64 %1, %0
%7 = tail call i8* @malloc(i64 %6)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ null, %2 ]
ret i8* %9
}
/* Variables and functions */
int i2c_smbus_write_byte_data(int, int, int);
int ci20I2CWriteReg8(int fd, int reg, int data) {
  return i2c_smbus_write_byte_data(fd, reg, data);
}


x86 assembly (clang, -O0):
<ci20I2CWriteReg8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <i2c_smbus_write_byte_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ci20I2CWriteReg8>:
jmp    1030 <i2c_smbus_write_byte_data@plt>

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

LLVM IR (-O2):
define i32 @ci20I2CWriteReg8(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @i2c_smbus_write_byte_data(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int print_info(unsigned int *);
int main(int argc, char *argv[]) {
  unsigned int myaddr;
  int ret;
  myaddr = 0x0;
  ret = print_info(&myaddr);
  if (!ret)
    abort();
  myaddr = 0x01020304;
  ret = print_info(&myaddr);
  if (ret)
    abort();
  exit(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)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <print_info@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    116a <main+0x3a>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x1020304,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <print_info@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     118e <main+0x5e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1050 <print_info@plt>
test   %eax,%eax
je     1164 <main+0x34>
movl   $0x1020304,0x4(%rsp)
01
lea    0x4(%rsp),%rdi
call   1050 <print_info@plt>
test   %eax,%eax
jne    1164 <main+0x34>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = call i32 @print_info(i32* %6)
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
store i32 16909060, i32* %6
%14 = call i32 @print_info(i32* %6)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %13
%20 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @print_info(i32* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %2
store i32 16909060, i32* %3
%10 = call i32 @print_info(i32* %3)
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %9
%15 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int fn_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_105_ch_110_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
    char const *);
int fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_105_ch_110_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_105_ch_110_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_105_ch_110_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_105_ch_110_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_105_ch_110_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_105_ch_110_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(i8* %0) {
%2 = tail call i32 @fn_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_105_ch_110_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(i8* %0)
ret i32 %2
}
/* Variables and functions */
int EXIT_SUCCESS;
char *concat(char *, char *);
int /*<<< orphan*/ free_memory(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *first_string = "Learning ";
  char *second_string = "c11 language programming";
  char *full_string = concat(first_string, second_string);
  printf("%s\n", full_string);
  free_memory(full_string);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeb9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <concat@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <free_memory@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1040 <concat@plt>
mov    %rax,%rbx
lea    0xed5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <free_memory@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Learning \00"
@.str.1 = [25 x i8] c"c11 language programming\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %3
%7 = call i8* @concat(i8* %5, i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @free_memory(i8* %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [10 x i8] c"Learning \00"
@.str.1 = [25 x i8] c"c11 language programming\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i8* @concat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free_memory(i8* %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void rop3_32_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = *D & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_32_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_32_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_32_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i8, i8* %6
%48 = zext i8 %47 to i32
%49 = and i32 %46, %48
%50 = or i32 %43, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_32_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int MapFileRead(void *, unsigned char *, unsigned int, unsigned int *);
int SSB_FILE_READ(void *p, unsigned char *buf, unsigned int num_read,
                  unsigned int *num_written) {
  int ret;
  ret = MapFileRead(p, buf, num_read, num_written);
  return ret;
}


x86 assembly (clang, -O0):
<SSB_FILE_READ>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <MapFileRead@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSB_FILE_READ>:
jmp    1030 <MapFileRead@plt>

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

LLVM IR (-O2):
define i32 @SSB_FILE_READ(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = tail call i32 @MapFileRead(i8* %0, i8* %1, i32 %2, i32* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xd8() {
  Assert_real((isascii(216) == 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_isascii.c",
              1085, ("isascii should be 0 for 0xd8"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xd8>:
push   %rax
mov    $0xd8,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x43d,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xd8\00"
define void @t_isascii_0xd8() {
%1 = call i64 @isascii(i32 216)
%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 1085, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xd8\00"
define void @t_isascii_0xd8() {
%1 = tail call i64 @isascii(i32 216)
%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 1085, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int __htclog_init_mask(const char *a1 __attribute__((__unused__)),
                       unsigned int a2 __attribute__((__unused__)),
                       int a3 __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @__htclog_init_mask(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void stub_os_init(const char *fname) {
  fatal("delbin"
        ": OS not supported\n");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"delbin: OS not supported\0A\00"
define void @stub_os_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"delbin: OS not supported\0A\00"
define void @stub_os_init(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int main() {
  char *p = NULL;
  free(p);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @free(i8* null)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ UART_OutChar(int);
void UART_OutUHex(uint32_t number) {
  if (number >= 0x10) {
    UART_OutUHex(number / 0x10);
    UART_OutUHex(number % 0x10);
  } else {
    if (number < 0xA) {
      UART_OutChar(number + '0');
    } else {
      UART_OutChar((number - 0x0A) + 'A');
    }
  }
}


x86 assembly (clang, -O0):
<UART_OutUHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jl     115e <UART_OutUHex+0x3e>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <UART_OutUHex@plt>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <UART_OutUHex@plt>
jmp    118b <UART_OutUHex+0x6b>
cmpl   $0xa,-0x4(%rbp)
jge    1178 <UART_OutUHex+0x58>
mov    -0x4(%rbp),%edi
add    $0x30,%edi
call   1030 <UART_OutChar@plt>
jmp    1186 <UART_OutUHex+0x66>
mov    -0x4(%rbp),%edi
sub    $0xa,%edi
add    $0x41,%edi
call   1030 <UART_OutChar@plt>
jmp    118b <UART_OutUHex+0x6b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_OutUHex>:
cmp    $0x10,%edi
jl     1136 <UART_OutUHex+0x16>
push   %rbx
mov    %edi,%ebx
and    $0xf,%ebx
shr    $0x4,%edi
call   1040 <UART_OutUHex@plt>
mov    %ebx,%edi
pop    %rbx
lea    0x37(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
mov    %eax,%edi
jmp    1030 <UART_OutChar@plt>

LLVM IR (-O0):
define void @UART_OutUHex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 16
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 16
%8 = load i32, i32* %2
%9 = srem i32 %8, 16
br label %23
10: ; preds = %1
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 48
%16 = call i32 @UART_OutChar(i32 %15)
br label %22
17: ; preds = %10
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 10
%20 = add nsw i32 %19, 65
%21 = call i32 @UART_OutChar(i32 %20)
br label %22
22: ; preds = %17, %13
br label %23
23: ; preds = %22, %5
ret void
}

LLVM IR (-O2):
define void @UART_OutUHex(i32 %0) {
%2 = icmp sgt i32 %0, 15
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = and i32 %0, 15
%5 = lshr i32 %0, 4
tail call void @UART_OutUHex(i32 %5)
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %0, %1 ], [ %4, %3 ]
%8 = icmp slt i32 %7, 10
%9 = select i1 %8, i32 48, i32 55
%10 = add nsw i32 %7, %9
%11 = tail call i32 @UART_OutChar(i32 %10)
ret void
}
int do_837() { return 837; }


x86 assembly (clang, -O0):
<do_837>:
push   %rbp
mov    %rsp,%rbp
mov    $0x345,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_837>:
mov    $0x345,%eax
ret

LLVM IR (-O0):
define i32 @do_837() {
ret i32 837
}

LLVM IR (-O2):
define i32 @do_837() {
ret i32 837
}
/* Variables and functions */
int step(char *, char *);
int RE_match(char *string, char *exprbuf) { return (step(string, exprbuf)); }


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

x86 assembly (clang, -O2):
<RE_match>:
jmp    1030 <step@plt>

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

LLVM IR (-O2):
define i32 @RE_match(i8* %0, i8* %1) {
%3 = tail call i32 @step(i8* %0, i8* %1)
ret i32 %3
}