xunge/DecIR huggingface dataset:
double _Complex sub_double_rc(double a, double _Complex b) { return a - b; }


x86 assembly (clang, -O0):
<sub_double_rc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm0,%xmm1
movaps 0xed8(%rip),%xmm2
movsd  -0x18(%rbp),%xmm0
pxor   %xmm2,%xmm0
movsd  %xmm1,-0x10(%rbp)
movlpd %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_double_rc>:
subsd  %xmm1,%xmm0
xorps  0xef5(%rip),%xmm2
movaps %xmm2,%xmm1
ret

LLVM IR (-O0):
define { double, double } @sub_double_rc(double %0, double %1, double %2) {
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = alloca double
%7 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %2, double* %8
store double %0, double* %6
%9 = load double, double* %6
%10 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%13 = load double, double* %12
%14 = fsub double %9, %11
%15 = fneg double %13
%16 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%17 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %14, double* %16
store double %15, double* %17
%18 = load { double, double }, { double, double }* %4
ret { double, double } %18
}

LLVM IR (-O2):
define { double, double } @sub_double_rc(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fneg double %2
%6 = insertvalue { double, double } poison, double %4, 0
%7 = insertvalue { double, double } %6, double %5, 1
ret { double, double } %7
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_quaddobl_polyhedral_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(475, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_quaddobl_polyhedral_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1db,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_quaddobl_polyhedral_homotopy>:
mov    $0x1db,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @celcon_quaddobl_polyhedral_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 475, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_quaddobl_polyhedral_homotopy() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 475, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void forward(int fd, char *body) {
  write(fd, body, strlen(body));
  write(fd, "\n", sizeof(char));
}


x86 assembly (clang, -O0):
<forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    0xea2(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forward>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xebd(%rip),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @forward(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
%5 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ imprime(char *, int);
int main() {
  char texto[] = "teste de texto";
  imprime(texto, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xed9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed1(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xf(%rbp),%rdi
mov    $0x5,%esi
call   1030 <imprime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6f747865742065,%rax
mov    %rax,0xf(%rsp)
movabs $0x6564206574736574,%rax
20 64 65
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x5,%esi
call   1030 <imprime@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.texto = [15 x i8] c"teste de texto\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = bitcast [15 x i8]* %1 to i8*
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = call i32 @imprime(i8* %3, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.texto = [15 x i8] c"teste de texto\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @imprime(i8* %2, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strtod(char const *, char **);
int /*<<< orphan*/ strtof(char const *, char **);
int /*<<< orphan*/ strtold(char const *, char **);
void uninivar_strtof(void) {
  const char *s;
  char **endp;
  (void)strtof(s, endp);
  (void)strtod(s, endp);
  (void)strtold(s, endp);
}


x86 assembly (clang, -O0):
<uninivar_strtof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strtof@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strtold@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninivar_strtof>:
push   %rax
call   1040 <strtof@plt>
call   1030 <strtod@plt>
pop    %rax
jmp    1050 <strtold@plt>

LLVM IR (-O0):
define void @uninivar_strtof() {
%1 = alloca i8*
%2 = alloca i8**
%3 = load i8*, i8** %1
%4 = load i8**, i8*** %2
%5 = call i32 @strtof(i8* %3, i8** %4)
%6 = load i8*, i8** %1
%7 = load i8**, i8*** %2
%8 = call i32 @strtod(i8* %6, i8** %7)
%9 = load i8*, i8** %1
%10 = load i8**, i8*** %2
%11 = call i32 @strtold(i8* %9, i8** %10)
ret void
}

LLVM IR (-O2):
define void @uninivar_strtof() {
%1 = tail call i32 @strtof(i8* undef, i8** undef)
%2 = tail call i32 @strtod(i8* undef, i8** undef)
%3 = tail call i32 @strtold(i8* undef, i8** undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ stderr;
void destroy_allocated(void **data) {
  if (!data) {
    fprintf(stderr, "error: destroy_allocated(): Bad parameter(s)\n");
    return;
  }
  free(*data);
}


x86 assembly (clang, -O0):
<destroy_allocated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1151 <destroy_allocated+0x31>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1040 <fprintf@plt>
jmp    115d <destroy_allocated+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_allocated>:
test   %rdi,%rdi
je     112d <destroy_allocated+0xd>
mov    (%rdi),%rdi
jmp    1030 <free@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"error: destroy_allocated(): Bad parameter(s)\0A\00"
define void @destroy_allocated(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"error: destroy_allocated(): Bad parameter(s)\0A\00"
define void @destroy_allocated(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %9
6: ; preds = %1
%7 = load i8*, i8** %0
%8 = tail call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %3
ret void
}
char **cdio_get_devices_win32(void) { return ((void *)0); }


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

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

LLVM IR (-O0):
define i8** @cdio_get_devices_win32() {
ret i8** null
}

LLVM IR (-O2):
define noalias i8** @cdio_get_devices_win32() {
ret i8** null
}
FNIEMOP_DEF(iemOp_Grp7_vmxoff) {
  IEMOP_BITCH_ABOUT_STUB();
  return IEMOP_RAISE_INVALID_OPCODE();
}


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

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

LLVM IR (-O0):
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @IEMOP_BITCH_ABOUT_STUB()
%4 = call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %4
}

LLVM IR (-O2):
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = tail call i32 (...) @IEMOP_BITCH_ABOUT_STUB()
%3 = tail call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %3
}
void I420ToI010() {}


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

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

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

LLVM IR (-O2):
define void @I420ToI010() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct bladerf {
  int dummy;
};

/* Variables and functions */
int nios_8x32_write(struct bladerf *, int, int /*<<< orphan*/,
                    int /*<<< orphan*/);
int nios_config_write(struct bladerf *dev, uint32_t val) {
  int status = nios_8x32_write(dev, 0x01, 0, val);
  if (status == 0) {
    do {
      do {
      } while (0);
    } while (0);
  }
  return status;
}


x86 assembly (clang, -O0):
<nios_config_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <nios_8x32_write@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1158 <nios_config_write+0x48>
jmp    1144 <nios_config_write+0x34>
jmp    1149 <nios_config_write+0x39>
jmp    114e <nios_config_write+0x3e>
jmp    1153 <nios_config_write+0x43>
jmp    1158 <nios_config_write+0x48>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_config_write>:
mov    %esi,%ecx
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <nios_8x32_write@plt>

LLVM IR (-O0):
%struct.bladerf = type { i32 }
define i32 @nios_config_write(%struct.bladerf* %0, i32 %1) {
%3 = alloca %struct.bladerf*
%4 = alloca i32
%5 = alloca i32
store %struct.bladerf* %0, %struct.bladerf** %3
store i32 %1, i32* %4
%6 = load %struct.bladerf*, %struct.bladerf** %3
%7 = load i32, i32* %4
%8 = call i32 @nios_8x32_write(%struct.bladerf* %6, i32 1, i32 0, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
%struct.bladerf = type { i32 }
define i32 @nios_config_write(%struct.bladerf* %0, i32 %1) {
%3 = tail call i32 @nios_8x32_write(%struct.bladerf* %0, i32 1, i32 0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ create_letter_distribution_diagram(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main() {
  char word[10000];
  fgets(word, 10000, stdin);
  create_letter_distribution_diagram(word);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2720(%rbp),%rdi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    $0x2710,%esi
call   1040 <fgets@plt>
lea    -0x2720(%rbp),%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x2710,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2710,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x2710,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [10000 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 10000, i32 %4)
%6 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%7 = call i32 @create_letter_distribution_diagram(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [10000 x i8]
%2 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 10000, i32 %3)
%5 = call i32 @create_letter_distribution_diagram(i8* %2)
ret i32 0
}
unsigned char f15(unsigned char x, unsigned int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned char) - y));
}


x86 assembly (clang, -O0):
<f15>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %ecx,%esi
mov    $0x8,%ecx
sub    %rsi,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f15>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f15(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = sub i64 8, %12
%14 = trunc i64 %13 to i32
%15 = ashr i32 %10, %14
%16 = or i32 %8, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f15(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ _failed_test_case(int, int /*<<< orphan*/);
char *_get_color_lassert(int);
int /*<<< orphan*/ printf(char *, char *, int, char *, char *);
void _REQUIRE_failed(char *statement, int line) {
  if (statement)
    printf("\n%sFailed statement outside a test case line %d :\n\t%s %s\n",
           _get_color_lassert(1), line, statement, _get_color_lassert(0));
  _failed_test_case(1, 0);
}


x86 assembly (clang, -O0):
<_REQUIRE_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1187 <_REQUIRE_failed+0x57>
mov    $0x1,%edi
call   1040 <_get_color_lassert@plt>
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1040 <_get_color_lassert@plt>
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    %rax,%r8
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <_failed_test_case@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_REQUIRE_failed>:
test   %rdi,%rdi
je     116f <_REQUIRE_failed+0x3f>
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0x1,%edi
call   1040 <_get_color_lassert@plt>
mov    %rax,%rbp
xor    %edi,%edi
call   1040 <_get_color_lassert@plt>
lea    0xea6(%rip),%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
mov    %rbx,%rcx
mov    %rax,%r8
call   1030 <printf@plt>
pop    %rbx
pop    %r14
pop    %rbp
mov    $0x1,%edi
xor    %esi,%esi
jmp    1050 <_failed_test_case@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"\0A%sFailed statement outside a test case line %d :\0A\09%s %s\0A\00"
define void @_REQUIRE_failed(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 %7, label %13
7: ; preds = %2
%8 = call i8* @_get_color_lassert(i32 1)
%9 = load i32, i32* %4
%10 = load i8*, i8** %3
%11 = call i8* @_get_color_lassert(i32 0)
%12 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10, i8* %11)
br label %13
13: ; preds = %7, %2
%14 = call i32 @_failed_test_case(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"\0A%sFailed statement outside a test case line %d :\0A\09%s %s\0A\00"
define void @_REQUIRE_failed(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i8* @_get_color_lassert(i32 1)
%6 = tail call i8* @_get_color_lassert(i32 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %1, i8* %0, i8* %6)
br label %8
8: ; preds = %4, %2
%9 = tail call i32 @_failed_test_case(i32 1, i32 0)
ret void
}
int main() {
  struct a {
    int x;
    int y;
    char z;
  };
  struct b {
    int x;
    int y;
  };
  struct b k;
  (*((volatile struct a *)&k)).z = 'q';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x71,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.b = type { i32, i32 }
%struct.a = type { i32, i32, i8 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.b
store i32 0, i32* %1
%3 = bitcast %struct.b* %2 to %struct.a*
%4 = getelementptr inbounds %struct.a, %struct.a* %3, i32 0, i32 2
store volatile i8 113, i8* %4
ret i32 0
}

LLVM IR (-O2):
%struct.b = type { i32, i32 }
define i32 @main() {
ret i32 0
}
void MxFree(double **x, long vc, long vlen) {
  long j;
  for (j = 0; j < vc; j++)
    free(*(x + j));
  free(x);
  return;
}


x86 assembly (clang, -O0):
<MxFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    115c <MxFree+0x4c>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <MxFree+0x1c>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MxFree>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %rsi,%rsi
jle    1142 <MxFree+0x32>
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <MxFree+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @MxFree(double** nocapture %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds double*, double** %0, i64 %6
%8 = bitcast double** %7 to i8**
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %3
%13 = bitcast double** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM8_TRG_COM_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM8_TRG_COM_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM8_TRG_COM_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bill(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  bill("hello C");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <bill@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <bill@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"hello C\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bill(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"hello C\00"
define i32 @main() {
%1 = tail call i32 @bill(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int HelpItem134(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem134() {
ret i32 0
}
float sync(x)
double x;
{
  extern double sin();
  return (sin(x) / x);
}


x86 assembly (clang, -O0):
<sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
divsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sync(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = load double, double* %2
%6 = fdiv double %4, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @sync(double %0) {
%2 = tail call double @sin(double %0)
%3 = fdiv double %2, %0
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ bin_append_posn(int const, int const, char *, int);
scalar_t__ strlen(char *);
__attribute__((visibility("hidden"))) void
bin_append(const int arg, const int length, char *binary) {
  int bin_posn = (int)strlen(binary);
  bin_append_posn(arg, length, binary, bin_posn);
  binary[bin_posn + length] = '\0';
}


x86 assembly (clang, -O0):
<bin_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <bin_append_posn@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x8(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_append>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %edi,%r14d
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbp
mov    %r14d,%edi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1030 <bin_append_posn@plt>
add    %r15d,%ebp
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define hidden void @bin_append(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = call i32 @bin_append_posn(i32 %11, i32 %12, i8* %13, i32 %14)
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = load i32, i32* %5
%19 = add nsw i32 %17, %18
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %16, i64 %20
store i8 0, i8* %21
ret void
}

LLVM IR (-O2):
define hidden void @bin_append(i32 %0, i32 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @bin_append_posn(i32 %0, i32 %1, i8* %2, i32 %5)
%7 = add nsw i32 %5, %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %2, i64 %8
store i8 0, i8* %9
ret void
}
void bpop() {
  asm volatile("popq %%rbx\n\t"
               "popq %%rax\n\t"
               "movb %%bl, (%%rax)\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<bpop>:
push   %rbp
mov    %rsp,%rbp
pop    %rbx
pop    %rax
mov    %bl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpop>:
pop    %rbx
pop    %rax
mov    %bl,(%rax)
ret

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

LLVM IR (-O2):
define void @bpop() {
tail call void asm sideeffect "popq %rbx\0A\09popq %rax\0A\09movb %bl, (%rax)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
int settimeofday(const struct timeval *tv, const struct timezone *tz) {
  (void)tv;
  (void)tz;
  StubBug("STUB:"
          "0");
  return -1;
}


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

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@.str = [7 x i8] c"STUB:0\00"
define i32 @settimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load %struct.timezone*, %struct.timezone** %4
%7 = call i32 @StubBug(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@.str = [7 x i8] c"STUB:0\00"
define i32 @settimeofday(%struct.timeval* nocapture readnone %0, %struct.timezone* nocapture readnone %1) {
%3 = tail call i32 @StubBug(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
zddopen(unit) int unit;
{ return (zddopen_func(unit, 0)); }


x86 assembly (clang, -O0):
<zddopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <zddopen_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zddopen>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <zddopen_func@plt>

LLVM IR (-O0):
define i32 @zddopen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @zddopen_func to i32 (i32, i32, ...)*)(i32 %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @zddopen(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @zddopen_func to i32 (i32, i32, ...)*)(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ repl();
int main(void) {
  repl();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @repl()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char const *, char *, int /*<<< orphan*/);
int check_pass(const char *pass) {
  if (strncmp(pass, "test123", strlen("test123")) == 0) {
    return (~0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_pass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xeb3(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1168 <check_pass+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <check_pass+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pass>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"test123\00"
define i32 @check_pass(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"test123\00"
define i32 @check_pass(i8* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
int NoSwapLong(int num) { return num; }


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

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

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

LLVM IR (-O2):
define i32 @NoSwapLong(i32 returned %0) {
ret i32 %0
}
int fun955() { return 955; }


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

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

LLVM IR (-O0):
define i32 @fun955() {
ret i32 955
}

LLVM IR (-O2):
define i32 @fun955() {
ret i32 955
}
/* Type definitions */
struct trie_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_trie_helper(int /*<<< orphan*/, struct trie_node *);
void print_trie(struct trie_node *root) { print_trie_helper(0, root); }


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

x86 assembly (clang, -O2):
<print_trie>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <print_trie_helper@plt>

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

LLVM IR (-O2):
%struct.trie_node = type { i32 }
define void @print_trie(%struct.trie_node* %0) {
%2 = tail call i32 @print_trie_helper(i32 0, %struct.trie_node* %0)
ret void
}
/* Variables and functions */
int tadd_ok(int, int);
int tsub_ok(int x, int y) { return tadd_ok(x, -y); }


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

x86 assembly (clang, -O2):
<tsub_ok>:
neg    %esi
jmp    1030 <tadd_ok@plt>

LLVM IR (-O0):
define i32 @tsub_ok(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 0, %6
%8 = call i32 @tadd_ok(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @tsub_ok(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i32 @tadd_ok(i32 %0, i32 %3)
ret i32 %4
}
void fsl_elbc_select_chip(struct mtd_info *mtd, int chip) {}


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

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

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

LLVM IR (-O2):
%struct.mtd_info = type opaque
define void @fsl_elbc_select_chip(%struct.mtd_info* nocapture %0, i32 %1) {
ret void
}
__attribute__((__const__)) float clipf(float x, float min, float max) {
  if (x < min)
    return min;
  if (x > max)
    return max;
  return x;
}


x86 assembly (clang, -O0):
<clipf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <clipf+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <clipf+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <clipf+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <clipf+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clipf>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @clipf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %6
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %7
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %5
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @clipf(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_NonEvaluatableExpressionUsedForInContext(long p_position) {
  _Error(p_position, "Non-evaluatable expression used for in context");
}


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

x86 assembly (clang, -O2):
<Error_NonEvaluatableExpressionUsedForInContext>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Non-evaluatable expression used for in context\00"
define void @Error_NonEvaluatableExpressionUsedForInContext(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Non-evaluatable expression used for in context\00"
define void @Error_NonEvaluatableExpressionUsedForInContext(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CRTC_Reset();
int /*<<< orphan*/ CRTC_SetType(int /*<<< orphan*/);
void CRTC_Initialise(void) {
  CRTC_SetType(0);
  CRTC_Reset();
}


x86 assembly (clang, -O0):
<CRTC_Initialise>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <CRTC_SetType@plt>
mov    $0x0,%al
call   1030 <CRTC_Reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRTC_Initialise>:
push   %rax
xor    %edi,%edi
call   1040 <CRTC_SetType@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CRTC_Reset@plt>

LLVM IR (-O0):
define void @CRTC_Initialise() {
%1 = call i32 @CRTC_SetType(i32 0)
%2 = call i32 (...) @CRTC_Reset()
ret void
}

LLVM IR (-O2):
define void @CRTC_Initialise() {
%1 = tail call i32 @CRTC_SetType(i32 0)
%2 = tail call i32 (...) @CRTC_Reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, int);
void g_memset(void *ptr, int val, int size) { memset(ptr, val, size); }


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

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

LLVM IR (-O0):
define void @g_memset(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
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @memset(i8* %7, i32 %8, i32 %9)
ret void
}

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

/* Variables and functions */
unsigned int qemu_get_byte(int /*<<< orphan*/ *);
unsigned int qemu_get_be32(FILE *f) {
  unsigned int v;
  v = (unsigned int)qemu_get_byte(f) << 24;
  v |= qemu_get_byte(f) << 16;
  v |= qemu_get_byte(f) << 8;
  v |= qemu_get_byte(f);
  return v;
}


x86 assembly (clang, -O0):
<qemu_get_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <qemu_get_byte@plt>
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <qemu_get_byte@plt>
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <qemu_get_byte@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <qemu_get_byte@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qemu_get_be32>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <qemu_get_byte@plt>
mov    %eax,%ebp
shl    $0x18,%ebp
mov    %r14,%rdi
call   1030 <qemu_get_byte@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
or     %ebp,%ebx
mov    %r14,%rdi
call   1030 <qemu_get_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %r14,%rdi
call   1030 <qemu_get_byte@plt>
or     %ebp,%eax
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @qemu_get_be32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @qemu_get_byte(i32* %4)
%6 = shl i32 %5, 24
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @qemu_get_byte(i32* %7)
%9 = shl i32 %8, 16
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32*, i32** %2
%13 = call i32 @qemu_get_byte(i32* %12)
%14 = shl i32 %13, 8
%15 = load i32, i32* %3
%16 = or i32 %15, %14
store i32 %16, i32* %3
%17 = load i32*, i32** %2
%18 = call i32 @qemu_get_byte(i32* %17)
%19 = load i32, i32* %3
%20 = or i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @qemu_get_be32(i32* %0) {
%2 = tail call i32 @qemu_get_byte(i32* %0)
%3 = shl i32 %2, 24
%4 = tail call i32 @qemu_get_byte(i32* %0)
%5 = shl i32 %4, 16
%6 = or i32 %5, %3
%7 = tail call i32 @qemu_get_byte(i32* %0)
%8 = shl i32 %7, 8
%9 = or i32 %6, %8
%10 = tail call i32 @qemu_get_byte(i32* %0)
%11 = or i32 %9, %10
ret i32 %11
}
void gdk_region_intersect() {}


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

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

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

LLVM IR (-O2):
define void @gdk_region_intersect() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int main(void) { return (EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @EXIT_SUCCESS
ret i32 %1
}
int slash(char c) { return c == '/'; }


x86 assembly (clang, -O0):
<slash>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slash>:
xor    %eax,%eax
cmp    $0x2f,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @slash(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 47
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @slash(i8 signext %0) {
%2 = icmp eq i8 %0, 47
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t _adc_read(void) {
  uint16_t val = *(unsigned char *)0x5405;
  uint16_t valh = *(unsigned char *)0x5404;
  return val | (valh << 8);
}


x86 assembly (clang, -O0):
<_adc_read>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5405,%eax
movzbl (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x5404,%eax
movzbl (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_adc_read>:
movzbl 0x5405,%ecx
movzbl 0x5404,%eax
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_adc_read() {
%1 = alloca i32
%2 = alloca i32
%3 = load i8, i8* inttoptr (i64 21509 to i8*)
%4 = zext i8 %3 to i32
store i32 %4, i32* %1
%5 = load i8, i8* inttoptr (i64 21508 to i8*)
%6 = zext i8 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = shl i32 %8, 8
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @_adc_read() {
%1 = load i8, i8* inttoptr (i64 21509 to i8*)
%2 = zext i8 %1 to i32
%3 = load i8, i8* inttoptr (i64 21508 to i8*)
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: mph [-a] [-m maxlen] [-l] [-d (2|3)] "
                  "[-c x.y] [-s|-S seed] foobar\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [74 x i8] c"usage: mph [-a] [-m maxlen] [-l] [-d (2|3)] [-c x.y] [-s|-S seed] foobar\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [74 x i8] c"usage: mph [-a] [-m maxlen] [-l] [-d (2|3)] [-c x.y] [-s|-S seed] foobar\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double _log10(double);
double log10(double x) { return _log10(x); }


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

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

LLVM IR (-O0):
define double @log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @_log10(double %3)
ret double %4
}

LLVM IR (-O2):
define double @log10(double %0) {
%2 = tail call double @_log10(double %0)
ret double %2
}