xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int i2c_write_leuint08(int, int, int, int);
int SetPullUpBTN(int bus, int chip_addr, uint8_t port, uint8_t Value) {
  switch (port) {
  case 0x02:
    return i2c_write_leuint08(bus, chip_addr, 0x0C, Value);
  case 0x01:
    return i2c_write_leuint08(bus, chip_addr, 0x0D, Value);
  }
}


x86 assembly (clang, -O0):
<SetPullUpBTN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     1164 <SetPullUpBTN+0x54>
jmp    1138 <SetPullUpBTN+0x28>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
jne    117a <SetPullUpBTN+0x6a>
jmp    1149 <SetPullUpBTN+0x39>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%ecx
mov    $0xc,%edx
call   1030 <i2c_write_leuint08@plt>
mov    %eax,-0x4(%rbp)
jmp    117a <SetPullUpBTN+0x6a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%ecx
mov    $0xd,%edx
call   1030 <i2c_write_leuint08@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPullUpBTN>:
cmp    $0x2,%edx
je     1124 <SetPullUpBTN+0x14>
cmp    $0x1,%edx
jne    112e <SetPullUpBTN+0x1e>
mov    $0xd,%edx
jmp    1030 <i2c_write_leuint08@plt>
mov    $0xc,%edx
jmp    1030 <i2c_write_leuint08@plt>
ret

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

LLVM IR (-O2):
define i32 @SetPullUpBTN(i32 %0, i32 %1, i32 %2, i32 %3) {
switch i32 %2, label %9 [
i32 2, label %6
i32 1, label %5
]
5: ; preds = %4
br label %6
6: ; preds = %4, %5
%7 = phi i32 [ 13, %5 ], [ 12, %4 ]
%8 = tail call i32 @i2c_write_leuint08(i32 %0, i32 %1, i32 %7, i32 %3)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ undef, %4 ], [ %8, %6 ]
ret i32 %10
}
/* Type definitions */
typedef double uint32_t;

/* Variables and functions */
double RAND_MAX;
double random();
uint32_t normal_random(uint32_t max_value) {
  double value = max_value;
  value *= random();
  value /= RAND_MAX;
  return value;
}


x86 assembly (clang, -O0):
<normal_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal_random>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
mulsd  (%rsp),%xmm0
mov    0x2ebf(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @normal_random(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
store double %4, double* %3
%5 = call double (...) @random()
%6 = load double, double* %3
%7 = fmul double %6, %5
store double %7, double* %3
%8 = load double, double* @RAND_MAX
%9 = load double, double* %3
%10 = fdiv double %9, %8
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @normal_random(double %0) {
%2 = tail call double (...) @random()
%3 = fmul double %2, %0
%4 = load double, double* @RAND_MAX
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("usage: beacontalk [--help] [interface]\n"
         "example: beacontalk wlan1		\n"
         "Also, make sure you have the right privileges\n");
}


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

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

LLVM IR (-O0):
@.str = [114 x i8] c"usage: beacontalk [--help] [interface]\0Aexample: beacontalk wlan1\09\09\0AAlso, make sure you have the right privileges\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [113 x i8] c"usage: beacontalk [--help] [interface]\0Aexample: beacontalk wlan1\09\09\0AAlso, make sure you have the right privileges\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([113 x i8], [113 x i8]* @str, i64 0, i64 0))
ret void
}
int foo() {
  int a[5] = {1, 2, 3, 4, 5};
  return a[2];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.foo.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @foo() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 3
}
void ExttContentAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttContentAuxTable() {
ret void
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ nanosleep(struct timespec *, struct timespec *);
void nsleep(long nsec) {
  struct timespec sleepTime;
  struct timespec remainingSleepTime;
  sleepTime.tv_sec = 0;
  sleepTime.tv_nsec = nsec;
  while (nanosleep(&sleepTime, &remainingSleepTime) != 0)
    sleepTime = remainingSleepTime;
}


x86 assembly (clang, -O0):
<nsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <nanosleep@plt>
cmp    $0x0,%rax
je     1158 <nsleep+0x48>
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112c <nsleep+0x1c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsleep>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movq   $0x0,0x8(%rsp)
mov    %rdi,(%rsp)
mov    %rsp,%rdi
lea    0x18(%rsp),%rsi
call   1030 <nanosleep@plt>
test   %rax,%rax
je     1159 <nsleep+0x49>
mov    %rsp,%r14
lea    0x18(%rsp),%rbx
xchg   %ax,%ax
movups 0x18(%rsp),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <nanosleep@plt>
test   %rax,%rax
jne    1140 <nsleep+0x30>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @nsleep(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %0, i64* %7
%8 = call i64 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %1, %10
%11 = call i64 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %10
13: ; preds = %10, %1
ret void
}
/* Variables and functions */
int myMax(int, int /*<<< orphan*/, int);
int fib(int n) {
  if (n < 2)
    return myMax(n, 0, -1);
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114c <fib+0x2c>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <myMax@plt>
mov    %eax,-0x4(%rbp)
jmp    116f <fib+0x4f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1040 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1130 <fib+0x10>
mov    %ebx,%edi
jmp    1154 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1040 <fib@plt>
lea    -0x2(%rbx),%edi
add    %eax,%ebp
cmp    $0x4,%ebx
mov    %edi,%ebx
jae    1140 <fib+0x20>
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <myMax@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @myMax(i32 %7, i32 0, i32 -1)
store i32 %8, i32* %2
br label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = call i32 @fib(i32 %11)
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 2
%15 = call i32 @fib(i32 %14)
%16 = add nsw i32 %12, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %9, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %8
3: ; preds = %8, %1
%4 = phi i32 [ 0, %1 ], [ %14, %8 ]
%5 = phi i32 [ %0, %1 ], [ %13, %8 ]
%6 = tail call i32 @myMax(i32 %5, i32 0, i32 -1)
%7 = add nsw i32 %6, %4
ret i32 %7
8: ; preds = %1, %8
%9 = phi i32 [ %13, %8 ], [ %0, %1 ]
%10 = phi i32 [ %14, %8 ], [ 0, %1 ]
%11 = add nsw i32 %9, -1
%12 = tail call i32 @fib(i32 %11)
%13 = add nsw i32 %9, -2
%14 = add nsw i32 %12, %10
%15 = icmp ult i32 %9, 4
br i1 %15, label %3, label %8
}
int test_imm_B3int32_mem(int *val) {
  return ((*val) & (0xB3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B3int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 179
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void LPCByteWrite(unsigned long ulBase, unsigned long ulOffset,
                  unsigned char ucData) {
  ;

  ;
  (*((volatile unsigned char *)(ulBase + 0x00000400 + ulOffset))) = ucData;
}


x86 assembly (clang, -O0):
<LPCByteWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
add    $0x400,%rax
add    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCByteWrite>:
mov    %dl,0x400(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @LPCByteWrite(i64 %0, i64 %1, i8 zeroext %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i64, i64* %4
%9 = add i64 %8, 1024
%10 = load i64, i64* %5
%11 = add i64 %9, %10
%12 = inttoptr i64 %11 to i8*
store volatile i8 %7, i8* %12
ret void
}

LLVM IR (-O2):
define void @LPCByteWrite(i64 %0, i64 %1, i8 zeroext %2) {
%4 = add i64 %0, 1024
%5 = add i64 %4, %1
%6 = inttoptr i64 %5 to i8*
store volatile i8 %2, i8* %6
ret void
}
char getCharInPosition(int i, int j, char *array) {
  int index = i * 50 + j;
  return array[index];
}


x86 assembly (clang, -O0):
<getCharInPosition>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
imul   $0x32,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCharInPosition>:
imul   $0x32,%edi,%eax
add    %esi,%eax
cltq
mov    (%rdx,%rax,1),%al
ret

LLVM IR (-O0):
define signext i8 @getCharInPosition(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 i32, i32* %4
%9 = mul nsw i32 %8, 50
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
store i32 %11, i32* %7
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @getCharInPosition(i32 %0, i32 %1, i8* nocapture %2) {
%4 = mul nsw i32 %0, 50
%5 = add nsw i32 %4, %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %2, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ RIT_DriverIRQHandler();
__attribute__((weak)) void RIT_IRQHandler(void) { RIT_DriverIRQHandler(); }


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

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

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

LLVM IR (-O2):
define weak void @RIT_IRQHandler() {
%1 = tail call i32 (...) @RIT_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char const *);
void expect(const char *msg) { error("%s expected", msg); }


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

x86 assembly (clang, -O2):
<expect>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%s expected\00"
define void @expect(i8* %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ txt;
typedef int /*<<< orphan*/ com;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ system(char *);
int main(void) {
  const char *com = "./yukaCmd.sh ";
  const char *txt = "\"I'm C yukarin\"";
  int size = sizeof(txt) + sizeof(com) + 10;
  char *command = (char *)(malloc(size));
  strcat(command, com);
  strcat(command, txt);
  system(command);
  free(command);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1a,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1040 <system@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1a,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcat@plt>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"./yukaCmd.sh \00"
@.str.1 = [16 x i8] c"\22I'm C yukarin\22\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %2
store i32 26, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = load i8*, i8** %1
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = call i32 @strcat(i8* %11, i8* %12)
%14 = load i8*, i8** %4
%15 = call i32 @system(i8* %14)
%16 = load i8*, i8** %4
%17 = call i32 @free(i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"./yukaCmd.sh \00"
@.str.1 = [16 x i8] c"\22I'm C yukarin\22\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 26)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @system(i8* %2)
%6 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
double calculate(int, int, int, int, double, double, double);
int /*<<< orphan*/ printf(char *, double);
void main(void) {
  double i;
  i = calculate(2, 3, 3, 5, .2, .9, .54);
  printf("Result:%f\n", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x3,%edx
mov    $0x5,%ecx
movsd  0xec1(%rip),%xmm0
movsd  0xec1(%rip),%xmm1
movsd  0xec1(%rip),%xmm2
mov    %edx,%esi
call   1040 <calculate@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
movsd  0xed7(%rip),%xmm2
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
call   1040 <calculate@plt>
lea    0xebf(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Result:%f\0A\00"
define void @main() {
%1 = alloca double
%2 = call double @calculate(i32 2, i32 3, i32 3, i32 5, double 2.000000e-01, double 9.000000e-01, double 5.400000e-01)
store double %2, double* %1
%3 = load double, double* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Result:%f\0A\00"
define void @main() {
%1 = tail call double @calculate(i32 2, i32 3, i32 3, i32 5, double 2.000000e-01, double 9.000000e-01, double 5.400000e-01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}
/* Type definitions */
struct vm_fault {
  int dummy;
};
struct vm_area_struct {
  int dummy;
};

/* Variables and functions */
int drm_do_vm_sg_fault(struct vm_area_struct *, struct vm_fault *);
int drm_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf) {
  return drm_do_vm_sg_fault(vma, vmf);
}


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

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

LLVM IR (-O0):
%struct.vm_area_struct = type { i32 }
%struct.vm_fault = type { i32 }
define i32 @drm_vm_sg_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1) {
%3 = alloca %struct.vm_area_struct*
%4 = alloca %struct.vm_fault*
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %3
store %struct.vm_fault* %1, %struct.vm_fault** %4
%5 = load %struct.vm_area_struct*, %struct.vm_area_struct** %3
%6 = load %struct.vm_fault*, %struct.vm_fault** %4
%7 = call i32 @drm_do_vm_sg_fault(%struct.vm_area_struct* %5, %struct.vm_fault* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.vm_area_struct = type { i32 }
%struct.vm_fault = type { i32 }
define i32 @drm_vm_sg_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1) {
%3 = tail call i32 @drm_do_vm_sg_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1)
ret i32 %3
}
/* Variables and functions */
int sqrt(float);
int i_fun(float x) { return (sqrt(x) + 21.0); }


x86 assembly (clang, -O0):
<i_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  0xecd(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_fun>:
push   %rax
call   1030 <sqrt@plt>
add    $0x15,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i_fun(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @sqrt(float %3)
%5 = sitofp i32 %4 to double
%6 = fadd double %5, 2.100000e+01
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @i_fun(float %0) {
%2 = tail call i32 @sqrt(float %0)
%3 = add i32 %2, 21
ret i32 %3
}
/* Variables and functions */
scalar_t__ strcpy(char *, char const *);
char *r_strcpy(char *dest, const char *src) {
  return (char *)strcpy(dest, src);
}


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

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

LLVM IR (-O0):
define i8* @r_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcpy(i8* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @r_strcpy(i8* %0, i8* %1) {
%3 = tail call i64 @strcpy(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int clamp_int(int val, int min, int max) {
  return (val > min) ? ((val <= max) ? val : max) : 0;
}


x86 assembly (clang, -O0):
<clamp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1141 <clamp_int+0x41>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1130 <clamp_int+0x30>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <clamp_int+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114b <clamp_int+0x4b>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <clamp_int+0x4b>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_int>:
cmp    %edx,%edi
cmovle %edi,%edx
xor    %eax,%eax
cmp    %esi,%edi
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp_int(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
void foo(int x, float p) { int w; }


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

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

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

LLVM IR (-O2):
define void @foo(i32 %0, float %1) {
ret void
}
short f1_if(short x) {
  if (--x)
    return 200;
  if (x <= 0)
    return 100;
  return 0;
}


x86 assembly (clang, -O0):
<f1_if>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x4(%rbp)
cmp    $0x0,%ax
je     112c <f1_if+0x2c>
movw   $0xc8,-0x2(%rbp)
jmp    114a <f1_if+0x4a>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
jg     1144 <f1_if+0x44>
movw   $0x64,-0x2(%rbp)
jmp    114a <f1_if+0x4a>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1_if>:
cmp    $0x1,%di
mov    $0x64,%ecx
mov    $0xc8,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @f1_if(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = add i16 %4, -1
store i16 %5, i16* %3
%6 = icmp ne i16 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 200, i16* %2
br label %14
8: ; preds = %1
%9 = load i16, i16* %3
%10 = sext i16 %9 to i32
%11 = icmp sle i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i16 100, i16* %2
br label %14
13: ; preds = %8
store i16 0, i16* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @f1_if(i16 signext %0) {
%2 = icmp eq i16 %0, 1
%3 = select i1 %2, i16 100, i16 200
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ str_ltrim(char *);
char *str_rtrim(int /*<<< orphan*/);
char *str_atrim(char *src) { return str_rtrim(str_ltrim(src)); }


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

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

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

LLVM IR (-O2):
define i8* @str_atrim(i8* %0) {
%2 = tail call i32 @str_ltrim(i8* %0)
%3 = tail call i8* @str_rtrim(i32 %2)
ret i8* %3
}
void f1(int *restrict xp, int *restrict yp) {
  *xp = *xp + *yp;
  *xp = *xp + *yp;
}


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

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

LLVM IR (-O0):
define void @f1(i32* noalias %0, i32* noalias %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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = add nsw i32 %12, %14
%16 = load i32*, i32** %3
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @f1(i32* noalias nocapture %0, i32* noalias nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = shl i32 %4, 1
%6 = add i32 %5, %3
store i32 %6, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char getchar();
int /*<<< orphan*/ stderr;
uint8_t vdp_h_counter_read(void) {
  fprintf(stderr, "H counter read not implemented.\n");
  char fart = getchar();
}


x86 assembly (clang, -O0):
<vdp_h_counter_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdp_h_counter_read>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getchar@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"H counter read not implemented.\0A\00"
define i32 @vdp_h_counter_read() {
%1 = alloca i32
%2 = alloca i8
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"H counter read not implemented.\0A\00"
define i32 @vdp_h_counter_read() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call signext i8 (...) @getchar()
ret i32 undef
}
/* Variables and functions */
int *init_rng_simple(int, int);
int *finit_rng_sim(int *seed, int *mult) {
  return init_rng_simple(*seed, *mult);
}


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

x86 assembly (clang, -O2):
<finit_rng_sim>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <init_rng_simple@plt>

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

LLVM IR (-O2):
define i32* @finit_rng_sim(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32* @init_rng_simple(i32 %3, i32 %4)
ret i32* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int read_s32b(int /*<<< orphan*/ *);
int read_s32l(int /*<<< orphan*/ *);
int read_s32(FILE *fp, int e) {
  return (e & 1) ? read_s32b(fp) : read_s32l(fp);
}


x86 assembly (clang, -O0):
<read_s32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <read_s32+0x2f>
mov    -0x8(%rbp),%rdi
call   1040 <read_s32b@plt>
mov    %eax,-0x10(%rbp)
jmp    115b <read_s32+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <read_s32l@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_s32>:
test   $0x1,%sil
jne    112b <read_s32+0xb>
jmp    1030 <read_s32l@plt>
jmp    1040 <read_s32b@plt>

LLVM IR (-O0):
define i32 @read_s32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = call i32 @read_s32b(i32* %9)
br label %14
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = call i32 @read_s32l(i32* %12)
br label %14
14: ; preds = %11, %8
%15 = phi i32 [ %10, %8 ], [ %13, %11 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_s32(i32* %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @read_s32b(i32* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @read_s32l(i32* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main(void) {
  int x = 10, y = 20;
  printf("before swap() x=%d - y=%d\n", x, y);
  swap(&x, &y);
  printf(" after swap() x=%d - y=%d\n", x, y);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
movl   $0x14,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"before swap() x=%d - y=%d\0A\00"
@.str.1 = [27 x i8] c" after swap() x=%d - y=%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @swap(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@.str = [27 x i8] c"before swap() x=%d - y=%d\0A\00"
@.str.1 = [27 x i8] c" after swap() x=%d - y=%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, size_t);
void osd_free_executable(void *ptr, size_t size) { munmap(ptr, size); }


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

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

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

LLVM IR (-O2):
define void @osd_free_executable(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret void
}
int check_prime(int num) {
  int i = 1, div;
  div = num % i;
  while (i <= num - 1) {
    div = num % i;
    if (div == 0)
      return 0;
    else
      i = i + 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1157 <check_prime+0x57>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1149 <check_prime+0x49>
movl   $0x0,-0x4(%rbp)
jmp    115e <check_prime+0x5e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <check_prime+0x18>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
xor    %eax,%eax
cmp    $0x2,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @check_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
store i32 %8, i32* %5
br label %9
9: ; preds = %24, %1
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = icmp sle i32 %10, %12
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 0, i32* %2
br label %26
21: ; preds = %14
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %24
24: ; preds = %21
br label %9
25: ; preds = %9
store i32 1, i32* %2
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x09() {
  Assert_real((isdigit(9) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              50, ("isdigit should be 0 for 0x09"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x09\00"
define void @t_isdigit_0x09() {
%1 = call i64 @isdigit(i32 9)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x09\00"
define void @t_isdigit_0x09() {
%1 = tail call i64 @isdigit(i32 9)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int strlen(char *);
void send_message(int sock, char *message) {
  int message_length;
  message_length = strlen(message);
  send(sock, message, message_length, 0);
}


x86 assembly (clang, -O0):
<send_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
define void @send_message(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @send(i32 %8, i8* %9, i32 %10, i32 0)
ret void
}

LLVM IR (-O2):
define void @send_message(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ *strchr(char *, int);
extern int get_ok_char(void) {
  int c;
  while ((c = getchar()) != EOF && strchr("yYnN", c) == NULL) {
    ;
  }
  return c;
}


x86 assembly (clang, -O0):
<get_ok_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
mov    0x2eab(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1161 <get_ok_char+0x41>
mov    -0x4(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <strchr@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1171 <get_ok_char+0x51>
jmp    1176 <get_ok_char+0x56>
jmp    1128 <get_ok_char+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ok_char>:
push   %rbp
push   %r14
push   %rbx
mov    0x2ebd(%rip),%rbx
lea    0xece(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
cmp    (%rbx),%eax
je     115c <get_ok_char+0x3c>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1140 <get_ok_char+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [5 x i8] c"yYnN\00"
define i32 @get_ok_char() {
%1 = alloca i32
br label %2
2: ; preds = %12, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = icmp eq i32* %8, null
br label %10
10: ; preds = %6, %2
%11 = phi i1 [ false, %2 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %2
13: ; preds = %10
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [5 x i8] c"yYnN\00"
define i32 @get_ok_char() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = icmp eq i32* %6, null
br i1 %7, label %1, label %8
8: ; preds = %1, %5
ret i32 %2
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ itoa_recursive(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int n = INT_MIN;
  char s[12] = {0};
  itoa_recursive(n, s);
  printf("number character string is \'%s\'\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1050 <itoa_recursive@plt>
lea    -0x14(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
movl   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <itoa_recursive@plt>
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
@.str = [33 x i8] c"number character string is '%s'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [12 x i8]
store i32 0, i32* %1
%4 = load i32, i32* @INT_MIN
store i32 %4, i32* %2
%5 = bitcast [12 x i8]* %3 to i8*
%6 = load i32, i32* %2
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%8 = call i32 @itoa_recursive(i32 %6, i8* %7)
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@.str = [33 x i8] c"number character string is '%s'\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = load i32, i32* @INT_MIN
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = call i32 @itoa_recursive(i32 %2, i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int setenv(char const *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int setenv_int(const char *opt, int value) {
  char buf[16];
  sprintf(buf, "%d", value);
  return setenv(opt, buf, 1);
}


x86 assembly (clang, -O0):
<setenv_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setenv_int>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @setenv_int(i8* %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @setenv(i8* %0, i8* %4, i32 1)
ret i32 %6
}