xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gdb1253();
int /*<<< orphan*/ gdb1338();
int /*<<< orphan*/ gdb1718();
int /*<<< orphan*/ jump_at_beginning();
int /*<<< orphan*/ standard();
int main(void) {
  standard();
  gdb1253();
  gdb1718();
  gdb1338();
  jump_at_beginning();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <standard@plt>
mov    $0x0,%al
call   1060 <gdb1253@plt>
mov    $0x0,%al
call   1070 <gdb1718@plt>
mov    $0x0,%al
call   1030 <gdb1338@plt>
mov    $0x0,%al
call   1040 <jump_at_beginning@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <standard@plt>
xor    %eax,%eax
call   1060 <gdb1253@plt>
xor    %eax,%eax
call   1070 <gdb1718@plt>
xor    %eax,%eax
call   1030 <gdb1338@plt>
xor    %eax,%eax
call   1040 <jump_at_beginning@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @standard()
%3 = call i32 (...) @gdb1253()
%4 = call i32 (...) @gdb1718()
%5 = call i32 (...) @gdb1338()
%6 = call i32 (...) @jump_at_beginning()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @standard()
%2 = tail call i32 (...) @gdb1253()
%3 = tail call i32 (...) @gdb1718()
%4 = tail call i32 (...) @gdb1338()
%5 = tail call i32 (...) @jump_at_beginning()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ out(char const *, char const *, char *, int);
void out_offset(const char *type, const char *field, int offset) {
  out(type, field, "OFFSET", offset);
}


x86 assembly (clang, -O0):
<out_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdx
call   1030 <out@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_offset>:
mov    %edx,%ecx
lea    0xee7(%rip),%rdx
jmp    1030 <out@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"OFFSET\00"
define void @out_offset(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @out(i8* %0, i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
struct name *create_struct(void) {}


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

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

LLVM IR (-O0):
%struct.name = type opaque
define %struct.name* @create_struct() {
%1 = alloca %struct.name*
%2 = load %struct.name*, %struct.name** %1
ret %struct.name* %2
}

LLVM IR (-O2):
%struct.name = type opaque
define noalias %struct.name* @create_struct() {
ret %struct.name* undef
}
/* Variables and functions */
int /*<<< orphan*/ uart_crlf();
int /*<<< orphan*/ uart_puts(char const *);
void uart_putsln(const char *s) {
  uart_puts(s);
  uart_crlf();
}


x86 assembly (clang, -O0):
<uart_putsln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <uart_puts@plt>
mov    $0x0,%al
call   1030 <uart_crlf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @uart_putsln(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @uart_puts(i8* %3)
%5 = call i32 (...) @uart_crlf()
ret void
}

LLVM IR (-O2):
define void @uart_putsln(i8* %0) {
%2 = tail call i32 @uart_puts(i8* %0)
%3 = tail call i32 (...) @uart_crlf()
ret void
}
/* Variables and functions */
double pow(double, double);
double xyzToLabPreproc(double t) {
  if (t > 0.008856451676) {
    return pow(t, (1.0 / 3.0));
  } else {
    return (t * 7.787037037) + 0.1379310345;
  }
}


x86 assembly (clang, -O0):
<xyzToLabPreproc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1150 <xyzToLabPreproc+0x40>
movsd  -0x10(%rbp),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1172 <xyzToLabPreproc+0x62>
movsd  -0x10(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyzToLabPreproc>:
ucomisd 0xee8(%rip),%xmm0
jbe    1127 <xyzToLabPreproc+0x17>
movsd  0xef6(%rip),%xmm1
jmp    1030 <pow@plt>
mulsd  0xed9(%rip),%xmm0
addsd  0xed9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @xyzToLabPreproc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0x3F822354D274C934
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @pow(double %7, double 0x3FD5555555555555)
store double %8, double* %2
br label %12
9: ; preds = %1
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double %10, double 0x401F25ED097A9F7B, double 0x3FC1A7B96123F618)
store double %11, double* %2
br label %12
12: ; preds = %9, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @xyzToLabPreproc(double %0) {
%2 = fcmp ogt double %0, 0x3F822354D274C934
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @pow(double %0, double 0x3FD5555555555555)
br label %7
5: ; preds = %1
%6 = tail call double @llvm.fmuladd.f64(double %0, double 0x401F25ED097A9F7B, double 0x3FC1A7B96123F618)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ aes_decrypt(unsigned char *, unsigned char *,
                               unsigned long *, int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
void aes_128_decrypt(unsigned char blk[16], unsigned long expanded_key[44]) {
  unsigned char tmp_blk[16];
  memcpy(tmp_blk, blk, 16);
  aes_decrypt(tmp_blk, blk, expanded_key, 128);
}


x86 assembly (clang, -O0):
<aes_128_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x80,%ecx
call   1040 <aes_decrypt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_128_decrypt>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x80,%ecx
call   1040 <aes_decrypt@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @aes_128_decrypt(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca [16 x i8]
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @memcpy(i8* %6, i8* %7, i32 16)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = load i64*, i64** %4
%12 = call i32 @aes_decrypt(i8* %9, i8* %10, i64* %11, i32 128)
ret void
}

LLVM IR (-O2):
define void @aes_128_decrypt(i8* %0, i64* %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %0, i32 16)
%6 = call i32 @aes_decrypt(i8* %4, i8* %0, i64* %1, i32 128)
ret void
}
/* Variables and functions */
double pow(double, double);
double exponent(double a, double b) { return pow(a, b); }


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

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

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

LLVM IR (-O2):
define double @exponent(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ menuparms;

/* Variables and functions */
int /*<<< orphan*/ Q_snprintfz(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ trap_Cmd_Args();
int /*<<< orphan*/ trap_Cmd_ExecuteText(int /*<<< orphan*/, char *);
void CG_SC_ChannelAdd(void) {
  char menuparms[1024];
  Q_snprintfz(menuparms, sizeof(menuparms), "menu_tvchannel_add %s\n",
              trap_Cmd_Args());
  trap_Cmd_ExecuteText(0, menuparms);
}


x86 assembly (clang, -O0):
<CG_SC_ChannelAdd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x400(%rbp),%rax
mov    %rax,-0x408(%rbp)
mov    $0x0,%al
call   1030 <trap_Cmd_Args@plt>
mov    -0x408(%rbp),%rdi
mov    %eax,%ecx
mov    $0x400,%esi
lea    0xe9b(%rip),%rdx
call   1040 <Q_snprintfz@plt>
lea    -0x400(%rbp),%rsi
xor    %edi,%edi
call   1050 <trap_Cmd_ExecuteText@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_SC_ChannelAdd>:
push   %rbx
sub    $0x400,%rsp
xor    %eax,%eax
call   1030 <trap_Cmd_Args@plt>
lea    0xeba(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %eax,%ecx
call   1040 <Q_snprintfz@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <trap_Cmd_ExecuteText@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"menu_tvchannel_add %s\0A\00"
define void @CG_SC_ChannelAdd() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 (...) @trap_Cmd_Args()
%4 = call i32 @Q_snprintfz(i8* %2, i32 1024, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%6 = call i32 @trap_Cmd_ExecuteText(i32 0, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"menu_tvchannel_add %s\0A\00"
define void @CG_SC_ChannelAdd() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @trap_Cmd_Args()
%4 = call i32 @Q_snprintfz(i8* %2, i32 1024, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @trap_Cmd_ExecuteText(i32 0, i8* %2)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int getpid();
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(scalar_t__);
void seed_random() {
  struct timeval time;
  gettimeofday(&time, NULL);
  srand((((time.tv_sec ^ getpid()) * 1000001) + time.tv_usec));
}


x86 assembly (clang, -O0):
<seed_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
xor    %ecx,%eax
imul   $0xf4241,%eax,%eax
movslq %eax,%rdi
add    -0x8(%rbp),%rdi
call   1050 <srand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed_random>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    (%rsp),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
xor    %ebx,%eax
imul   $0xf4241,%eax,%eax
movslq %eax,%rdi
add    0x8(%rsp),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define void @seed_random() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i32 (...) @getpid()
%6 = xor i32 %4, %5
%7 = mul nsw i32 %6, 1000001
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
%12 = call i32 @srand(i64 %11)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define void @seed_random() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 (...) @getpid()
%7 = xor i32 %6, %5
%8 = mul nsw i32 %7, 1000001
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = add nsw i64 %11, %9
%13 = tail call i32 @srand(i64 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ prfile(int);
int /*<<< orphan*/ stderr;
void FatalErrorHandler() {
  fprintf(stderr, "FATAL XWINDOWS ERROR\n\n");
  prfile(-3);
}


x86 assembly (clang, -O0):
<FatalErrorHandler>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffd,%edi
call   1030 <prfile@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FatalErrorHandler>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffd,%edi
pop    %rax
jmp    1030 <prfile@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"FATAL XWINDOWS ERROR\0A\0A\00"
define void @FatalErrorHandler() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @prfile(i32 -3)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"FATAL XWINDOWS ERROR\0A\0A\00"
define void @FatalErrorHandler() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @prfile(i32 -3)
ret void
}
int do_602() { return 602; }


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

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

LLVM IR (-O0):
define i32 @do_602() {
ret i32 602
}

LLVM IR (-O2):
define i32 @do_602() {
ret i32 602
}
void __attribute__((no)) HEX00_lconfigInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_lconfigInit() {
ret void
}
/* Type definitions */
typedef int int8_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int8_t sign(int32_t in) {
  if (in > 0) {
    return 1;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    111f <sign+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <sign+0x26>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xor    %eax,%eax
test   %rdi,%rdi
setg   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @sign(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @sign(i64 %0) {
%2 = icmp sgt i64 %0, 0
%3 = select i1 %2, i32 1, i32 -1
ret i32 %3
}
char *internal_backend_name(void) { return "AIXSLURM"; }


x86 assembly (clang, -O0):
<internal_backend_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_backend_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"AIXSLURM\00"
define i8* @internal_backend_name() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"AIXSLURM\00"
define i8* @internal_backend_name() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
void check_transition(void) {}


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

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

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

LLVM IR (-O2):
define void @check_transition() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
char *strdup(char *);
int strlen(char *);
char *path_creator(char *dirname, char *filename) {
  if (dirname[strlen(dirname) - 1] != '/') {
    strcat(dirname, "/");
  }
  char *path = strdup(dirname);
  strcat(path, filename);
  return path;
}


x86 assembly (clang, -O0):
<path_creator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     117a <path_creator+0x4a>
mov    -0x8(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_creator>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
je     1157 <path_creator+0x27>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @path_creator(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 47
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %15, %2
%19 = load i8*, i8** %3
%20 = call i8* @strdup(i8* %19)
store i8* %20, i8** %5
%21 = load i8*, i8** %5
%22 = load i8*, i8** %4
%23 = call i32 @strcat(i8* %21, i8* %22)
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @path_creator(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = tail call i8* @strdup(i8* %0)
%13 = tail call i32 @strcat(i8* %12, i8* %1)
ret i8* %12
}
char prev(char c) { return c == 'A' ? 'G' : (char)(c - 1); }


x86 assembly (clang, -O0):
<prev>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jne    1124 <prev+0x24>
mov    $0x47,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <prev+0x31>
movsbl -0x1(%rbp),%eax
sub    $0x1,%eax
movsbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prev>:
lea    -0x1(%rdi),%eax
cmp    $0x41,%dil
movzbl %al,%ecx
mov    $0x47,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @prev(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, 65
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 1
%11 = trunc i32 %10 to i8
%12 = sext i8 %11 to i32
br label %13
13: ; preds = %7, %6
%14 = phi i32 [ 71, %6 ], [ %12, %7 ]
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @prev(i8 signext %0) {
%2 = icmp eq i8 %0, 65
%3 = add i8 %0, -1
%4 = select i1 %2, i8 71, i8 %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ IAPuissance4Difficile();
int /*<<< orphan*/ IAPuissance4Facile();
int hasard(int, int);
void IAPuissance4Normal(void) {
  int aleatoire;
  aleatoire = hasard(1, 2);
  if (aleatoire == 1)
    IAPuissance4Facile();
  else if (aleatoire == 2)
    IAPuissance4Difficile();
}


x86 assembly (clang, -O0):
<IAPuissance4Normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <hasard@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1160 <IAPuissance4Normal+0x30>
mov    $0x0,%al
call   1040 <IAPuissance4Facile@plt>
jmp    1176 <IAPuissance4Normal+0x46>
cmpl   $0x2,-0x4(%rbp)
jne    1171 <IAPuissance4Normal+0x41>
mov    $0x0,%al
call   1050 <IAPuissance4Difficile@plt>
jmp    1176 <IAPuissance4Normal+0x46>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IAPuissance4Normal>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <hasard@plt>
cmp    $0x2,%eax
je     1152 <IAPuissance4Normal+0x22>
cmp    $0x1,%eax
jne    115a <IAPuissance4Normal+0x2a>
xor    %eax,%eax
pop    %rcx
jmp    1040 <IAPuissance4Facile@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <IAPuissance4Difficile@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @IAPuissance4Normal() {
%1 = alloca i32
%2 = call i32 @hasard(i32 1, i32 2)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @IAPuissance4Facile()
br label %13
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @IAPuissance4Difficile()
br label %12
12: ; preds = %10, %7
br label %13
13: ; preds = %12, %5
ret void
}

LLVM IR (-O2):
define void @IAPuissance4Normal() {
%1 = tail call i32 @hasard(i32 1, i32 2)
switch i32 %1, label %6 [
i32 1, label %2
i32 2, label %4
]
2: ; preds = %0
%3 = tail call i32 (...) @IAPuissance4Facile()
br label %6
4: ; preds = %0
%5 = tail call i32 (...) @IAPuissance4Difficile()
br label %6
6: ; preds = %0, %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int main(int argc, char *argv[]) {
  FILE *fp;
  fp = fopen("/dev/null", "r");
  fclose(fp);
  fp = fopen("/dev/zero", "r");
  fclose(fp);
  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)
lea    0xec3(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xeaf(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rbx
mov    %rbx,%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
call   1030 <fclose@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"/dev/zero\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @fclose(i32* %8)
%10 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %6
%11 = load i32*, i32** %6
%12 = call i32 @fclose(i32* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"/dev/zero\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @fclose(i32* %3)
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @fclose(i32* %5)
ret i32 0
}
int nisplusserver_add(const char *ifname, const int ifindex,
                      const char *addrPlain) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @nisplusserver_add(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
ot(ptr) char ptr[];
{
  tab();
  outasm(ptr);
}


x86 assembly (clang, -O0):
<ot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <tab@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <outasm@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ot>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <tab@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <outasm@plt>

LLVM IR (-O0):
define i32 @ot(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @tab()
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @outasm to i32 (i8*, ...)*)(i8* %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @ot(i8* %0) {
%2 = tail call i32 (...) @tab()
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outasm to i32 (i8*, ...)*)(i8* %0)
ret i32 undef
}
void __attribute__((weak)) usb_hp_can1_tx_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<usb_hp_can1_tx_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_hp_can1_tx_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.usb_hp_can1_tx_isr = [19 x i8] c"usb_hp_can1_tx_isr\00"
define weak void @usb_hp_can1_tx_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.usb_hp_can1_tx_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.usb_hp_can1_tx_isr = [19 x i8] c"usb_hp_can1_tx_isr\00"
define weak void @usb_hp_can1_tx_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.usb_hp_can1_tx_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wait();
void delay() { wait(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ glRasterPos3fv(int /*<<< orphan*/ *);
void RasterPos3fv(GLfloat v[3]) { glRasterPos3fv(v); }


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

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

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

LLVM IR (-O2):
define void @RasterPos3fv(i32* %0) {
%2 = tail call i32 @glRasterPos3fv(i32* %0)
ret void
}
void shortcircuit_or(int *x) {
  if (x == 0 || *x == 2) {
    x = 17;
  } else {
    x = 32;
  };
}


x86 assembly (clang, -O0):
<shortcircuit_or>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <shortcircuit_or+0x20>
mov    -0x8(%rbp),%rax
cmpl   $0x2,(%rax)
jne    112e <shortcircuit_or+0x2e>
mov    $0x11,%eax
mov    %rax,-0x8(%rbp)
jmp    1137 <shortcircuit_or+0x37>
mov    $0x20,%eax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @shortcircuit_or(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %5, %1
store i32* inttoptr (i64 17 to i32*), i32** %2
br label %11
10: ; preds = %5
store i32* inttoptr (i64 32 to i32*), i32** %2
br label %11
11: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @shortcircuit_or(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ signal(int, void (*)(int));
void sigUsr1(int sig) { signal(sig, sigUsr1); }


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

x86 assembly (clang, -O2):
<sigUsr1>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <signal@plt>

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

LLVM IR (-O2):
define void @sigUsr1(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @sigUsr1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sin(double);
int /*<<< orphan*/ sinf(float);
int /*<<< orphan*/ sinl(long double);
void uninitvar_sin(void) {
  float f;
  (void)sinf(f);
  double d;
  (void)sin(d);
  long double ld;
  (void)sinl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1040 <sinf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <sin@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_sin>:
sub    $0x18,%rsp
call   1040 <sinf@plt>
call   1050 <sin@plt>
call   1030 <sinl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_sin() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @sinf(float %4)
%6 = load double, double* %2
%7 = call i32 @sin(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @sinl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_sin() {
%1 = tail call i32 @sinf(float undef)
%2 = tail call i32 @sin(double undef)
%3 = tail call i32 @sinl(x86_fp80 undef)
ret void
}
double fpp(double x) { return (6 * x - 10 * x + 7); }


x86 assembly (clang, -O0):
<fpp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xece(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpp>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fpp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double 1.000000e+01, %4
%6 = fneg double %5
%7 = call double @llvm.fmuladd.f64(double 6.000000e+00, double %3, double %6)
%8 = fadd double %7, 7.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @fpp(double %0) {
%2 = fmul double %0, -1.000000e+01
%3 = tail call double @llvm.fmuladd.f64(double %0, double 6.000000e+00, double %2)
%4 = fadd double %3, 7.000000e+00
ret double %4
}
/* Variables and functions */
char *escape_for_dquotes(char const *, int);
char *dquoted_arg_hook(const char match[]) {
  return escape_for_dquotes(match, 1);
}


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

x86 assembly (clang, -O2):
<dquoted_arg_hook>:
mov    $0x1,%esi
jmp    1030 <escape_for_dquotes@plt>

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

LLVM IR (-O2):
define i8* @dquoted_arg_hook(i8* %0) {
%2 = tail call i8* @escape_for_dquotes(i8* %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int read(int, char *, int);
int read_pipe(int s, char *buf, int len) { return read(s, buf, len); }


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

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

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

LLVM IR (-O2):
define i32 @read_pipe(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int LZ4_compressHC2_withStateHC(void *, char const *, char *, int,
                                int /*<<< orphan*/);
int LZ4_compressHC_withStateHC(void *state, const char *source, char *dest,
                               int inputSize) {
  return LZ4_compressHC2_withStateHC(state, source, dest, inputSize, 0);
}


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

x86 assembly (clang, -O2):
<LZ4_compressHC_withStateHC>:
xor    %r8d,%r8d
jmp    1030 <LZ4_compressHC2_withStateHC@plt>

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

LLVM IR (-O2):
define i32 @LZ4_compressHC_withStateHC(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @LZ4_compressHC2_withStateHC(i8* %0, i8* %1, i8* %2, i32 %3, i32 0)
ret i32 %5
}
int mod(char a, char b) {
  if (a < b)
    return b - a;
  else if (a >= b)
    return a - b;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    1132 <mod+0x32>
movsbl -0x6(%rbp),%eax
movsbl -0x5(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <mod+0x59>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jl     1154 <mod+0x54>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <mod+0x59>
jmp    1159 <mod+0x59>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %esi,%eax
sub    %edi,%eax
mov    %edi,%ecx
sub    %esi,%ecx
cmp    %sil,%dil
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mod(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %13, %15
store i32 %16, i32* %3
br label %30
17: ; preds = %2
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %19, %21
br i1 %22, label %23, label %29
23: ; preds = %17
%24 = load i8, i8* %4
%25 = sext i8 %24 to i32
%26 = load i8, i8* %5
%27 = sext i8 %26 to i32
%28 = sub nsw i32 %25, %27
store i32 %28, i32* %3
br label %30
29: ; preds = %17
br label %30
30: ; preds = %11, %23, %29
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @mod(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = icmp slt i8 %0, %1
%6 = sub nsw i32 %4, %3
%7 = sub nsw i32 %3, %4
%8 = select i1 %5, i32 %6, i32 %7
ret i32 %8
}
void i8080_hal_iff(int on) {}


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

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

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

LLVM IR (-O2):
define void @i8080_hal_iff(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ strerror_r(int, char *, size_t);
char *sol_util_strerror(int errnum, char *buf, size_t buflen) {
  char *ret;
  if (buflen < 1)
    return NULL;
  buf[0] = '\0';
  ret = (char *)strerror_r(errnum, buf, buflen);
  if (buf[0] != '\0')
    ret = buf;
  return ret;
}


x86 assembly (clang, -O0):
<sol_util_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    113b <sol_util_strerror+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1176 <sol_util_strerror+0x66>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strerror_r@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116e <sol_util_strerror+0x5e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sol_util_strerror>:
test   %rdx,%rdx
je     112a <sol_util_strerror+0x1a>
push   %rbx
mov    %rsi,%rbx
movb   $0x0,(%rsi)
call   1030 <strerror_r@plt>
cmpb   $0x0,(%rbx)
cmovne %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @sol_util_strerror(i32 %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i64, i64* %7
%10 = icmp ult i64 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %3
store i8* null, i8** %4
br label %29
12: ; preds = %3
%13 = load i8*, i8** %6
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 0, i8* %14
%15 = load i32, i32* %5
%16 = load i8*, i8** %6
%17 = load i64, i64* %7
%18 = call i64 @strerror_r(i32 %15, i8* %16, i64 %17)
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %8
%20 = load i8*, i8** %6
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %12
%26 = load i8*, i8** %6
store i8* %26, i8** %8
br label %27
27: ; preds = %25, %12
%28 = load i8*, i8** %8
store i8* %28, i8** %4
br label %29
29: ; preds = %27, %11
%30 = load i8*, i8** %4
ret i8* %30
}

LLVM IR (-O2):
define i8* @sol_util_strerror(i32 %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %11, label %5
5: ; preds = %3
store i8 0, i8* %1
%6 = tail call i64 @strerror_r(i32 %0, i8* %1, i64 %2)
%7 = inttoptr i64 %6 to i8*
%8 = load i8, i8* %1
%9 = icmp eq i8 %8, 0
%10 = select i1 %9, i8* %7, i8* %1
br label %11
11: ; preds = %3, %5
%12 = phi i8* [ %10, %5 ], [ null, %3 ]
ret i8* %12
}
/* Variables and functions */
int wdog_ping();
int wdog_pmon_ping(void) { return wdog_ping(); }


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

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

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

LLVM IR (-O2):
define i32 @wdog_pmon_ping() {
%1 = tail call i32 (...) @wdog_ping()
ret i32 %1
}
int test_imm_7Aint8_mem(signed char *val) {
  return ((*val) & (0x7A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Aint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x7a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Aint8_mem>:
testb  $0x7a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 122
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ I2S0_ISR();
int /*<<< orphan*/ I2S1_ISR();
int /*<<< orphan*/ QEI_ISR();
void I2S0_I2S1_QEI_ISR(void) {
  I2S0_ISR();
  I2S1_ISR();
  QEI_ISR();
}


x86 assembly (clang, -O0):
<I2S0_I2S1_QEI_ISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <I2S0_ISR@plt>
mov    $0x0,%al
call   1030 <I2S1_ISR@plt>
mov    $0x0,%al
call   1040 <QEI_ISR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2S0_I2S1_QEI_ISR>:
push   %rax
xor    %eax,%eax
call   1050 <I2S0_ISR@plt>
xor    %eax,%eax
call   1030 <I2S1_ISR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <QEI_ISR@plt>

LLVM IR (-O0):
define void @I2S0_I2S1_QEI_ISR() {
%1 = call i32 (...) @I2S0_ISR()
%2 = call i32 (...) @I2S1_ISR()
%3 = call i32 (...) @QEI_ISR()
ret void
}

LLVM IR (-O2):
define void @I2S0_I2S1_QEI_ISR() {
%1 = tail call i32 (...) @I2S0_ISR()
%2 = tail call i32 (...) @I2S1_ISR()
%3 = tail call i32 (...) @QEI_ISR()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ reverse(char *);
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char *input = NULL;
  scanf("%m[^\n]s", &input);
  reverse(input);
  printf("%s", input);
  free(input);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xea2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xea0(%rip),%rdi
mov    %rsp,%rsi
call   1070 <scanf@plt>
mov    (%rsp),%rdi
call   1030 <reverse@plt>
mov    (%rsp),%rsi
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%rdi
call   1040 <free@plt>
mov    $0xa,%edi
call   1050 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%m[^\0A]s\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %1)
%4 = load i8*, i8** %1
%5 = call i32 @reverse(i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @free(i8* %8)
%10 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int, char const *);
int /*<<< orphan*/ stderr;
void assert_rtn(const char *func, const char *file, int line, const char *msg) {
  fprintf(stderr, "libunwind: %s %s:%d - %s\n", func, file, line, msg);
  assert(false);
  abort();
}


x86 assembly (clang, -O0):
<assert_rtn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
lea    0xe99(%rip),%rsi
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<assert_rtn>:
push   %rax
mov    %rcx,%r9
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"libunwind: %s %s:%d - %s\0A\00"
define void @assert_rtn(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12, i8* %13)
%15 = call i32 @assert(i32 0)
%16 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"libunwind: %s %s:%d - %s\0A\00"
define void @assert_rtn(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2, i8* %3)
%7 = tail call i32 @assert(i32 0)
%8 = tail call i32 (...) @abort()
unreachable
}