xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void print() {
  int t = 0;
  scanf("%d", &t);
  if (t == -1) {
    return;
  }
  print();
  printf("%d ", t);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0xffffffff,-0x4(%rbp)
jne    115e <print+0x2e>
jmp    1172 <print+0x42>
call   1040 <print@plt>
mov    -0x4(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0xffffffff,0x4(%rsp)
je     1166 <print+0x36>
call   1040 <print@plt>
mov    0x4(%rsp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define void @print() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %0, %6
ret void
}
long toB(int n) {
  int i;
  long rtn = 1;
  for (i = 1; i <= n; i++) {
    rtn = rtn * 2;
  }
  return rtn;
}


x86 assembly (clang, -O0):
<toB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113c <toB+0x3c>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1116 <toB+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toB>:
test   %edi,%edi
jle    1118 <toB+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <toB+0x1e>
mov    $0x1,%eax
jmp    1139 <toB+0x39>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%rax
add    $0xfffffff8,%edi
jne    1130 <toB+0x30>
test   %ecx,%ecx
je     1148 <toB+0x48>
nopl   (%rax)
add    %rax,%rax
add    $0xffffffff,%ecx
jne    1140 <toB+0x40>
ret

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

LLVM IR (-O2):
define i64 @toB(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %25, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i64 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i64 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i64 [ undef, %3 ], [ %12, %9 ]
%17 = phi i64 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i64 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i64 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i64 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i64 %26
}
int main() {
  char *fulltext = "Mary had a little lamb, its fleece was white as snow.";
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"Mary had a little lamb, its fleece was white as snow.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
caddr_t _sbrk(int incr) {
  (void)incr;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @_sbrk(i32 %0) {
ret i32 0
}
void yy_1_SemiPreTransient(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XtRemoveTimeOut() {
ret void
}
int test_imm_04int16_reg(short val) {
  return ((val) & (-0x04 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_04int16_reg>:
cmp    $0x4,%di
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_04int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -4
%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_04int16_reg(i16 signext %0) {
%2 = icmp ult i16 %0, 4
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
void test79_PrintImpl_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test79_PrintImpl_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_LinearCombineSSE_init(void) {
  _hmt_register_covercase("HMM_LinearCombineSSE", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_LinearCombineSSE_init>:
lea    0xee9(%rip),%rdi
lea    0xef7(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"HMM_LinearCombineSSE\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_LinearCombineSSE_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"HMM_LinearCombineSSE\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_LinearCombineSSE_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t now;
  struct tm *tm_now;
  char *datetime;
  time(&now);
  tm_now = localtime(&now);
  datetime = asctime(tm_now);
  printf("now datetime: %s\n", datetime);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1060 <time@plt>
lea    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    %rax,%rdi
call   1040 <asctime@plt>
lea    0xe97(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"now datetime: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i32 @time(i32* %2)
%6 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %6, %struct.tm** %3
%7 = load %struct.tm*, %struct.tm** %3
%8 = call i8* @asctime(%struct.tm* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"now datetime: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i8* @asctime(%struct.tm* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _mkdir_error(char const *message, int ret) {
  fputs("mkdir"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_mkdir_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mkdir_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"mkdir: \00"
@stderr = global i32 0
define i32 @_mkdir_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"mkdir: \00"
@stderr = global i32 0
define i32 @_mkdir_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ restore_term();
void end() {
  restore_term();
  exit(0);
}


x86 assembly (clang, -O0):
<end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <restore_term@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<end>:
push   %rax
xor    %eax,%eax
call   1030 <restore_term@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @end() {
%1 = call i32 (...) @restore_term()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @end() {
%1 = tail call i32 (...) @restore_term()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void change_x(void) {
  int x = 80;
  printf("local x: %d\n", x);
}


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

x86 assembly (clang, -O2):
<change_x>:
lea    0xee9(%rip),%rdi
mov    $0x50,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"local x: %d\0A\00"
define void @change_x() {
%1 = alloca i32
store i32 80, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"local x: %d\0A\00"
define void @change_x() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 80)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_isempty() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_isempty"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_proplist_isempty\0A\00"
define i32 @pa_proplist_isempty() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_proplist_isempty\00"
define i32 @pa_proplist_isempty() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int compareWrapper(const void *a, const void *b, void *arg) {
  int (*compare)(const void *, const void *) = arg;
  return compare(a, b);
}


x86 assembly (clang, -O0):
<compareWrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareWrapper>:
jmp    *%rdx

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

LLVM IR (-O2):
define i32 @compareWrapper(i8* %0, i8* %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32 (i8*, i8*)*
%5 = tail call i32 %4(i8* %0, i8* %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void pasc_update(char *name) { printf("ok %s\n", name); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"ok %s\0A\00"
define void @pasc_update(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double ***);
int /*<<< orphan*/ free2_d(double **, int);
void free3_d(double ***t, int dim1, int dim2) {
  int i;
  for (i = 0; i < dim1; ++i) {
    free2_d(t[i], dim2);
  }
  free(t);
}


x86 assembly (clang, -O0):
<free3_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <free3_d+0x47>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%esi
call   1030 <free2_d@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <free3_d+0x19>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free3_d>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
test   %esi,%esi
jle    1155 <free3_d+0x35>
mov    %edx,%r14d
mov    %esi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,8),%rdi
mov    %r14d,%esi
call   1030 <free2_d@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <free3_d+0x20>
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <free@plt>

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

LLVM IR (-O2):
define void @free3_d(double*** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds double**, double*** %0, i64 %8
%10 = load double**, double*** %9
%11 = tail call i32 @free2_d(double** %10, i32 %2)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = tail call i32 @free(double*** %0)
ret void
}
unsigned short tf_H(unsigned short c) { return c / 3; }


x86 assembly (clang, -O0):
<tf_H>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf_H>:
imul   $0xaaab,%edi,%eax
shr    $0x11,%eax
ret

LLVM IR (-O0):
define zeroext i16 @tf_H(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = sdiv i32 %4, 3
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @tf_H(i16 zeroext %0) {
%2 = udiv i16 %0, 3
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(void const *, int /*<<< orphan*/ *);
void process_image(const void *p) {
  FILE *fp;
  fp = fopen("test", "w+");
  fputs(p, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<process_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_image>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [3 x i8] c"w+\00"
define void @process_image(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i8*, i8** %2
%6 = load i32*, i32** %3
%7 = call i32 @fputs(i8* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [3 x i8] c"w+\00"
define void @process_image(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fputs(i8* %0, i32* %2)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int log2u(unsigned int);
unsigned log2u_round_up(unsigned x) {
  assert(x > 0);
  if (x == 1)
    return 0;
  return log2u(x - 1) + 1;
}


x86 assembly (clang, -O0):
<log2u_round_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1152 <log2u_round_up+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1163 <log2u_round_up+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <log2u@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2u_round_up>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1040 <assert@plt>
xor    %eax,%eax
cmp    $0x1,%ebx
je     1144 <log2u_round_up+0x24>
add    $0xffffffff,%ebx
mov    %ebx,%edi
call   1030 <log2u@plt>
add    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @log2u_round_up(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp eq i32 %0, 1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = add i32 %0, -1
%8 = tail call i32 @log2u(i32 %7)
%9 = add nsw i32 %8, 1
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
char frame(int heptnum) {
  switch (heptnum) {
  case 0:
    return 'a';
    break;
  case 1:
    return 'b';
    break;
  case 2:
    return 'c';
    break;
  case 3:
    return 'd';
    break;
  case 4:
    return 'e';
    break;
  case 5:
    return 'f';
    break;
  case 6:
    return 'g';
    break;
  }
  return 'x';
}


x86 assembly (clang, -O0):
<frame>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x6,%rax
ja     116b <frame+0x6b>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x61,-0x1(%rbp)
jmp    116f <frame+0x6f>
movb   $0x62,-0x1(%rbp)
jmp    116f <frame+0x6f>
movb   $0x63,-0x1(%rbp)
jmp    116f <frame+0x6f>
movb   $0x64,-0x1(%rbp)
jmp    116f <frame+0x6f>
movb   $0x65,-0x1(%rbp)
jmp    116f <frame+0x6f>
movb   $0x66,-0x1(%rbp)
jmp    116f <frame+0x6f>
movb   $0x67,-0x1(%rbp)
jmp    116f <frame+0x6f>
movb   $0x78,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<frame>:
lea    0x61(%rdi),%eax
cmp    $0x7,%edi
movzbl %al,%ecx
mov    $0x78,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @frame(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
]
5: ; preds = %1
store i8 97, i8* %2
br label %13
6: ; preds = %1
store i8 98, i8* %2
br label %13
7: ; preds = %1
store i8 99, i8* %2
br label %13
8: ; preds = %1
store i8 100, i8* %2
br label %13
9: ; preds = %1
store i8 101, i8* %2
br label %13
10: ; preds = %1
store i8 102, i8* %2
br label %13
11: ; preds = %1
store i8 103, i8* %2
br label %13
12: ; preds = %1
store i8 120, i8* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @frame(i32 %0) {
%2 = icmp ult i32 %0, 7
%3 = trunc i32 %0 to i8
%4 = add i8 %3, 97
%5 = select i1 %2, i8 %4, i8 120
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int cont, char *argc[]) {
  close(1);
  open("test.txt", O_RDWR);
  printf("FUCK YOU\n");
  close(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <close@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
lea    0xea0(%rip),%rdi
call   1050 <open@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <close@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1050 <open@plt>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@O_RDWR = global i32 0
@.str.1 = [10 x i8] c"FUCK YOU\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @close(i32 1)
%7 = load i32, i32* @O_RDWR
%8 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @close(i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@O_RDWR = global i32 0
@str = [9 x i8] c"FUCK YOU\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @close(i32 1)
%4 = load i32, i32* @O_RDWR
%5 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @close(i32 1)
ret i32 0
}
void cgetenv_(envval, len, envname) int *len;
char *envval;
char *envname;
{
  strcpy(envval, getenv(envname));
  *len = strlen(envval);
}


x86 assembly (clang, -O0):
<cgetenv_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <getenv@plt>
mov    -0x20(%rbp),%rdi
movslq %eax,%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgetenv_>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
xor    %eax,%eax
call   1030 <getenv@plt>
movslq %eax,%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cgetenv_(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @getenv to i32 (i8*, ...)*)(i8* %8)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = call i8* @strcpy(i8* %7, i8* %11)
%13 = load i8*, i8** %4
%14 = call i64 @strlen(i8* %13)
%15 = trunc i64 %14 to i32
%16 = load i32*, i32** %5
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @cgetenv_(i8* %0, i32* nocapture writeonly %1, i8* %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getenv to i32 (i8*, ...)*)(i8* %2)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %6)
%8 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int process_fd(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *);
int process_file(iconv_t cd, FILE *input, FILE *output) {
  return process_fd(cd, fileno(input), output);
}


x86 assembly (clang, -O0):
<process_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fileno@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1030 <process_fd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_file>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <fileno@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <process_fd@plt>

LLVM IR (-O0):
define i32 @process_file(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 = call i32 @fileno(i32* %8)
%10 = load i32*, i32** %6
%11 = call i32 @process_fd(i32 %7, i32 %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @process_file(i32 %0, i32* nocapture %1, i32* %2) {
%4 = tail call i32 @fileno(i32* %1)
%5 = tail call i32 @process_fd(i32 %0, i32 %4, i32* %2)
ret i32 %5
}
void ft_striter(char *s, void (*f)(char *)) {
  if (s)
    while (*s)
      f(s++);
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <ft_striter+0x4c>
jmp    1120 <ft_striter+0x20>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <ft_striter+0x47>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    %rdi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    1120 <ft_striter+0x20>
jmp    114c <ft_striter+0x4c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1133 <ft_striter+0x33>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1133 <ft_striter+0x33>
mov    %rsi,%r14
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
mov    %r15,%rbx
jne    1120 <ft_striter+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %9, %7 ], [ %0, %4 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
tail call void %1(i8* %8)
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_close;
int syscall(int /*<<< orphan*/, int);
int _close(int fd) { return syscall(SYS_close, fd); }


x86 assembly (clang, -O0):
<_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_close>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_close = global i32 0
define i32 @_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_close
%4 = load i32, i32* %2
%5 = call i32 @syscall(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SYS_close = global i32 0
define i32 @_close(i32 %0) {
%2 = load i32, i32* @SYS_close
%3 = tail call i32 @syscall(i32 %2, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ mbtowc(int /*<<< orphan*/ *, char *, int);
wchar_t _Xaw_atowc(unsigned char c) {
  wchar_t wc;
  char str[2];
  str[0] = c;
  str[1] = '\0';
  mbtowc(&wc, str, 1);
  return (wc);
}


x86 assembly (clang, -O0):
<_Xaw_atowc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0xa(%rbp)
movb   $0x0,-0x9(%rbp)
lea    -0xa(%rbp),%rsi
lea    -0x8(%rbp),%rdi
mov    $0x1,%edx
call   1030 <mbtowc@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Xaw_atowc>:
push   %rax
mov    %dil,0x2(%rsp)
movb   $0x0,0x3(%rsp)
lea    0x4(%rsp),%rdi
lea    0x2(%rsp),%rsi
mov    $0x1,%edx
call   1030 <mbtowc@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_Xaw_atowc(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca [2 x i8]
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 %5, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 0, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%9 = call i32 @mbtowc(i32* %3, i8* %8, i32 1)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @_Xaw_atowc(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %0, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %6
%7 = call i32 @mbtowc(i32* %2, i8* %5, i32 1)
%8 = load i32, i32* %2
ret i32 %8
}
/* Type definitions */
struct ath_hal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ath_hal_set_sig_firstep(struct ath_hal *,
                                           int /*<<< orphan*/);
void ath_hal_restore_default_sig_firstep(struct ath_hal *ah) {
  ath_hal_set_sig_firstep(ah, 0);
}


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

x86 assembly (clang, -O2):
<ath_hal_restore_default_sig_firstep>:
xor    %esi,%esi
jmp    1030 <ath_hal_set_sig_firstep@plt>

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

LLVM IR (-O2):
%struct.ath_hal = type { i32 }
define void @ath_hal_restore_default_sig_firstep(%struct.ath_hal* %0) {
%2 = tail call i32 @ath_hal_set_sig_firstep(%struct.ath_hal* %0, i32 0)
ret void
}
/* Variables and functions */
double exp(double);
int pow(double, double);
double Sersic(double rdre, double inv_n, double nb) {
  return exp(nb * (pow(rdre, inv_n) - 1));
}


x86 assembly (clang, -O0):
<Sersic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <pow@plt>
movsd  -0x20(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sersic>:
push   %rax
movsd  %xmm2,(%rsp)
call   1040 <pow@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @Sersic(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = call i32 @pow(double %8, double %9)
%11 = sub nsw i32 %10, 1
%12 = sitofp i32 %11 to double
%13 = fmul double %7, %12
%14 = call double @exp(double %13)
ret double %14
}

LLVM IR (-O2):
define double @Sersic(double %0, double %1, double %2) {
%4 = tail call i32 @pow(double %0, double %1)
%5 = add nsw i32 %4, -1
%6 = sitofp i32 %5 to double
%7 = fmul double %6, %2
%8 = tail call double @exp(double %7)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void multiply(int a, int b) { printf("Multiplication is %d;\n", a * b); }


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

x86 assembly (clang, -O2):
<multiply>:
imul   %edi,%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Multiplication is %d;\0A\00"
define void @multiply(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Multiplication is %d;\0A\00"
define void @multiply(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int stristmp(const char *s) { return (1 & (uintptr_t)s) && s[-1] == 0; }


x86 assembly (clang, -O0):
<stristmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1130 <stristmp+0x30>
mov    -0x8(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stristmp>:
xor    %eax,%eax
test   $0x1,%dil
je     1111 <stristmp+0x11>
xor    %eax,%eax
cmpb   $0x0,-0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @stristmp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 1, %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 -1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 0
br label %13
13: ; preds = %7, %1
%14 = phi i1 [ false, %1 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @stristmp(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 -1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int ftok(char *, int);
int /*<<< orphan*/ printf(char *, int);
void test1() {
  int i = 0;
  for (i = 1; i < 256; ++i) {
    printf("id=%x\t", i);
    printf("key=%x\n", ftok("/tmp", i));
  }
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    117d <test1+0x5d>
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1040 <ftok@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <test1+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xecc(%rip),%r14
lea    0xed4(%rip),%r15
lea    0xec5(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <ftok@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1150 <test1+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"id=%x\09\00"
@.str.1 = [8 x i8] c"key=%x\0A\00"
@.str.2 = [5 x i8] c"/tmp\00"
define void @test1() {
%1 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %1
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 256
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @ftok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %5
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %2
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"id=%x\09\00"
@.str.1 = [8 x i8] c"key=%x\0A\00"
@.str.2 = [5 x i8] c"/tmp\00"
define void @test1() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @ftok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 256
br i1 %7, label %8, label %1
8: ; preds = %1
ret void
}
int Operand_cimm8x4_decode(unsigned int *valp) {
  unsigned cimm8x4_0, imm8_0;
  imm8_0 = *valp & 0xff;
  cimm8x4_0 = (imm8_0 << 2) | 0;
  *valp = cimm8x4_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_cimm8x4_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
or     $0x0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_cimm8x4_decode>:
mov    (%rdi),%eax
movzbl %al,%eax
shl    $0x2,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_cimm8x4_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 255
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 2
%10 = or i32 %9, 0
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32*, i32** %2
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_cimm8x4_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 2
%4 = and i32 %3, 1020
store i32 %4, i32* %0
ret i32 0
}
long double S(long double x1, long double y1, long double m, long double x) {
  return m * (x - x1) + y1;
}


x86 assembly (clang, -O0):
<S>:
push   %rbp
mov    %rsp,%rbp
fldt   0x40(%rbp)
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fldt   -0x10(%rbp)
fsubrp %st,%st(1)
fldt   -0x20(%rbp)
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<S>:
fldt   0x18(%rsp)
fldt   0x28(%rsp)
fldt   0x8(%rsp)
fldt   0x38(%rsp)
fsubp  %st,%st(1)
fmulp  %st,%st(1)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @S(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2, x86_fp80 %3) {
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca x86_fp80
%8 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %5
store x86_fp80 %1, x86_fp80* %6
store x86_fp80 %2, x86_fp80* %7
store x86_fp80 %3, x86_fp80* %8
%9 = load x86_fp80, x86_fp80* %7
%10 = load x86_fp80, x86_fp80* %8
%11 = load x86_fp80, x86_fp80* %5
%12 = fsub x86_fp80 %10, %11
%13 = load x86_fp80, x86_fp80* %6
%14 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %9, x86_fp80 %12, x86_fp80 %13)
ret x86_fp80 %14
}

LLVM IR (-O2):
define x86_fp80 @S(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2, x86_fp80 %3) {
%5 = fsub x86_fp80 %3, %0
%6 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %2, x86_fp80 %5, x86_fp80 %1)
ret x86_fp80 %6
}
/* Variables and functions */
int /*<<< orphan*/ MV_SetReverseStereo(int);
void FX_SetReverseStereo(int setting) { MV_SetReverseStereo(setting); }


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

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

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

LLVM IR (-O2):
define void @FX_SetReverseStereo(i32 %0) {
%2 = tail call i32 @MV_SetReverseStereo(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WATCHDOG_REFRESH_SaveConfig();
void WATCHDOG_REFRESH_Sleep(void) { WATCHDOG_REFRESH_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @WATCHDOG_REFRESH_Sleep() {
%1 = tail call i32 (...) @WATCHDOG_REFRESH_SaveConfig()
ret void
}