xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char const *strchr(char const *, char);
int test_strchr(void) {
  const char *str = "hello";
  printf("\tstrchr");
  if (strchr(str, 'l') != &str[2])
    return 1;
  if (strchr(str, 'q') != NULL)
    return 1;
  if (strchr(str, '\0') != NULL)
    return 1;
  printf("\tpassed.\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x6c,%esi
call   1030 <strchr@plt>
mov    -0x10(%rbp),%rcx
add    $0x2,%rcx
cmp    %rcx,%rax
je     116a <test_strchr+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <test_strchr+0xa2>
mov    -0x10(%rbp),%rdi
mov    $0x71,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     118e <test_strchr+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <test_strchr+0xa2>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     11af <test_strchr+0x8f>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <test_strchr+0xa2>
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [8 x i8] c"\09strchr\00"
@.str.2 = [10 x i8] c"\09passed.\0A\00"
define i32 @test_strchr() {
%1 = alloca i32
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 108)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = icmp ne i8* %5, %7
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %22
10: ; preds = %0
%11 = load i8*, i8** %2
%12 = call i8* @strchr(i8* %11, i8 signext 113)
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %1
br label %22
15: ; preds = %10
%16 = load i8*, i8** %2
%17 = call i8* @strchr(i8* %16, i8 signext 0)
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 1, i32* %1
br label %22
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %22
22: ; preds = %20, %19, %14, %9
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"\09strchr\00"
define i32 @test_strchr() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c))
    c -= 0x20;
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1136 <toupper+0x26>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ showRoutes();
void cmdShowRouteTbl(int cmdType, struct cmd_arg *pCmdArg) { showRoutes(); }


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

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

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdShowRouteTbl(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @showRoutes()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdShowRouteTbl(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @showRoutes()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int ndepths;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
void set_Screen_ndepths(void *_p, int _v) { ((Screen *)_p)->ndepths = (int)_v; }


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

x86 assembly (clang, -O2):
<set_Screen_ndepths>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_Screen_ndepths(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_Screen_ndepths(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
extern void countdown(int signum) {
  static int num = 10;
  printf("%d..\n", num);
  num--;
  if (num < 0) {
    printf("Done!\n");
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<countdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eff(%rip),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2eeb(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2ee2(%rip)
cmpl   $0x0,0x2edb(%rip)
jge    1177 <countdown+0x57>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countdown>:
push   %rax
mov    0x2f01(%rip),%esi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2eed(%rip),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x2ee4(%rip)
test   %eax,%eax
jle    115a <countdown+0x2a>
pop    %rax
ret
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@countdown.num = internal global i32 10
@.str = [6 x i8] c"%d..\0A\00"
@.str.1 = [7 x i8] c"Done!\0A\00"
@EXIT_SUCCESS = global i32 0
define void @countdown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @countdown.num
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @countdown.num
%6 = add nsw i32 %5, -1
store i32 %6, i32* @countdown.num
%7 = load i32, i32* @countdown.num
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @EXIT_SUCCESS
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@countdown.num = internal unnamed_addr global i32 10
@.str = [6 x i8] c"%d..\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [6 x i8] c"Done!\00"
define void @countdown(i32 %0) {
%2 = load i32, i32* @countdown.num
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @countdown.num
%5 = add nsw i32 %4, -1
store i32 %5, i32* @countdown.num
%6 = icmp slt i32 %4, 1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}
/* Variables and functions */
int piBoardRev();
int wiringPiI2CSetupInterface(char const *, int const);
int wiringPiI2CSetup(const int devId) {
  int rev;
  const char *device;
  rev = piBoardRev();
  if (rev == 1)
    device = "/dev/i2c-0";
  else
    device = "/dev/i2c-1";
  return wiringPiI2CSetupInterface(device, devId);
}


x86 assembly (clang, -O0):
<wiringPiI2CSetup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <piBoardRev@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114f <wiringPiI2CSetup+0x2f>
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    115a <wiringPiI2CSetup+0x3a>
lea    0xeb5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <wiringPiI2CSetupInterface@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiringPiI2CSetup>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <piBoardRev@plt>
cmp    $0x1,%eax
lea    0xecc(%rip),%rax
lea    0xed0(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <wiringPiI2CSetupInterface@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/i2c-0\00"
@.str.1 = [11 x i8] c"/dev/i2c-1\00"
define i32 @wiringPiI2CSetup(i32 %0) {
%2 = tail call i32 (...) @piBoardRev()
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @wiringPiI2CSetupInterface(i8* %4, i32 %0)
ret i32 %5
}
int isItemTag(int *tag) {
  if (tag[0] == 'i' && tag[1] == 't' && tag[2] == 'e')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isItemTag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x69,(%rax)
jne    113d <isItemTag+0x3d>
mov    -0x10(%rbp),%rax
cmpl   $0x74,0x4(%rax)
jne    113d <isItemTag+0x3d>
mov    -0x10(%rbp),%rax
cmpl   $0x65,0x8(%rax)
jne    113d <isItemTag+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <isItemTag+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isItemTag>:
cmpl   $0x69,(%rdi)
jne    1116 <isItemTag+0x16>
cmpl   $0x74,0x4(%rdi)
jne    1116 <isItemTag+0x16>
mov    $0x1,%eax
cmpl   $0x65,0x8(%rdi)
je     1118 <isItemTag+0x18>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isItemTag(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 105
br i1 %7, label %8, label %19
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 116
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 101
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %2
br label %20
19: ; preds = %13, %8, %1
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @isItemTag(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 105
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 116
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 101
br i1 %11, label %13, label %12
12: ; preds = %8, %4, %1
br label %13
13: ; preds = %8, %12
%14 = phi i32 [ 0, %12 ], [ 1, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ph_ftp_data_destroy(void *handler) {
  free(handler);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ph_ftp_data_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void abort(void) {
  sigset_t set;
  sigemptyset(&set);
  sigaddset(&set, SIGABRT);
  sigprocmask(SIG_UNBLOCK, &set, NULL);
  raise(SIGABRT);
  _exit(255);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1060 <sigemptyset@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1070 <sigaddset@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1040 <raise@plt>
mov    $0xff,%edi
call   1050 <_exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <sigemptyset@plt>
mov    0x2e70(%rip),%r14
mov    (%r14),%esi
mov    %rbx,%rdi
call   1070 <sigaddset@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
mov    (%r14),%edi
call   1040 <raise@plt>
mov    $0xff,%edi
call   1050 <_exit@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
@SIG_UNBLOCK = global i32 0
define void @abort() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIGABRT
%4 = call i32 @sigaddset(i32* %1, i32 %3)
%5 = load i32, i32* @SIG_UNBLOCK
%6 = call i32 @sigprocmask(i32 %5, i32* %1, i32* null)
%7 = load i32, i32* @SIGABRT
%8 = call i32 @raise(i32 %7)
%9 = call i32 @_exit(i32 255)
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@SIG_UNBLOCK = global i32 0
define void @abort() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGABRT
%5 = call i32 @sigaddset(i32* %1, i32 %4)
%6 = load i32, i32* @SIG_UNBLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %1, i32* null)
%8 = load i32, i32* @SIGABRT
%9 = call i32 @raise(i32 %8)
%10 = call i32 @_exit(i32 255)
unreachable
}
void swap(unsigned *a, unsigned *b) {
  unsigned t = *a;
  *a = *b;
  *b = t;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cwrapper_q_sortrev_float_with_float(float *, float *,
                                                       int /*<<< orphan*/, int);
void quicksortrev_float_with_float_(float numbers[], float indices[],
                                    int *array_size) {
  cwrapper_q_sortrev_float_with_float(numbers, indices, 0, (*array_size) - 1);
}


x86 assembly (clang, -O0):
<quicksortrev_float_with_float_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <cwrapper_q_sortrev_float_with_float@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksortrev_float_with_float_>:
mov    (%rdx),%ecx
add    $0xffffffff,%ecx
xor    %edx,%edx
jmp    1030 <cwrapper_q_sortrev_float_with_float@plt>

LLVM IR (-O0):
define void @quicksortrev_float_with_float_(float* %0, float* %1, i32* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32*
store float* %0, float** %4
store float* %1, float** %5
store i32* %2, i32** %6
%7 = load float*, float** %4
%8 = load float*, float** %5
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1
%12 = call i32 @cwrapper_q_sortrev_float_with_float(float* %7, float* %8, i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
define void @quicksortrev_float_with_float_(float* %0, float* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
%6 = tail call i32 @cwrapper_q_sortrev_float_with_float(float* %0, float* %1, i32 0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void usage(int exit_status) {
  puts("EasyLogo 1.0 (C) 2000 by Paolo Scaffardi\n"
       "\n"
       "Syntax:	easylogo [options] inputfile [outputvar [outputfile]]\n"
       "\n"
       "Options:\n"
       "  -r     Output RGB instead of YUYV\n"
       "  -g     Compress with gzip\n"
       "  -b     Preallocate space in bss for decompressing image\n"
       "  -h     Help output\n"
       "\n"
       "Where: 'inputfile'   is the TGA image to load\n"
       "       'outputvar'   is the variable name to create\n"
       "       'outputfile'  is the output header file (default is "
       "'inputfile.h')");
  exit(exit_status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [430 x i8] c"EasyLogo 1.0 (C) 2000 by Paolo Scaffardi\0A\0ASyntax:\09easylogo [options] inputfile [outputvar [outputfile]]\0A\0AOptions:\0A -r Output RGB instead of YUYV\0A -g Compress with gzip\0A -b Preallocate space in bss for decompressing image\0A -h Help output\0A\0AWhere: 'inputfile' is the TGA image to load\0A 'outputvar' is the variable name to create\0A 'outputfile' is the output header file (default is 'inputfile.h')\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([430 x i8], [430 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [430 x i8] c"EasyLogo 1.0 (C) 2000 by Paolo Scaffardi\0A\0ASyntax:\09easylogo [options] inputfile [outputvar [outputfile]]\0A\0AOptions:\0A -r Output RGB instead of YUYV\0A -g Compress with gzip\0A -b Preallocate space in bss for decompressing image\0A -h Help output\0A\0AWhere: 'inputfile' is the TGA image to load\0A 'outputvar' is the variable name to create\0A 'outputfile' is the output header file (default is 'inputfile.h')\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([430 x i8], [430 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int iswprint(int /*<<< orphan*/);
int iswprint_l(wint_t c, locale_t l) { return iswprint(c); }


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

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

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

LLVM IR (-O2):
define i32 @iswprint_l(i32 %0, i32 %1) {
%3 = tail call i32 @iswprint(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ s();
int main() {
  s();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @s()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int condition_reduction(int *, int);
int main(void) {
  int a[30] = {67, 32, 45, 43, 21, -11, 12, 3,  4,  5,  6,  76, -32, 56, -32,
               -1, 4,  5,  6,  99, 43,  22, -3, 22, 16, 34, 55, 31,  87, 324};
  int ret = condition_reduction(a, 16);
  if (ret != -3)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x78,%edx
call   1040 <memcpy@plt>
lea    -0x80(%rbp),%rdi
mov    $0x10,%esi
call   1050 <condition_reduction@plt>
mov    %eax,-0x84(%rbp)
cmpl   $0xfffffffd,-0x84(%rbp)
je     117f <main+0x4f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
mov    0xf45(%rip),%rax
mov    %rax,0x70(%rsp)
movaps 0xf29(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf0d(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xef1(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe9d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe81(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x10,%esi
call   1040 <condition_reduction@plt>
cmp    $0xfffffffd,%eax
jne    119c <main+0x7c>
xor    %eax,%eax
add    $0x78,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.a = [30 x i32] [i32 67, i32 32, i32 45, i32 43, i32 21, i32 -11, i32 12, i32 3, i32 4, i32 5, i32 6, i32 76, i32 -32, i32 56, i32 -32, i32 -1, i32 4, i32 5, i32 6, i32 99, i32 43, i32 22, i32 -3, i32 22, i32 16, i32 34, i32 55, i32 31, i32 87, i32 324]
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [30 x i32]* %2 to i8*
%5 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 0
%6 = call i32 @condition_reduction(i32* %5, i32 16)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, -3
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [30 x i32] [i32 67, i32 32, i32 45, i32 43, i32 21, i32 -11, i32 12, i32 3, i32 4, i32 5, i32 6, i32 76, i32 -32, i32 56, i32 -32, i32 -1, i32 4, i32 5, i32 6, i32 99, i32 43, i32 22, i32 -3, i32 22, i32 16, i32 34, i32 55, i32 31, i32 87, i32 324]
define i32 @main() {
%1 = alloca [30 x i32]
%2 = bitcast [30 x i32]* %1 to i8*
%3 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 0
%4 = call i32 @condition_reduction(i32* %3, i32 16)
%5 = icmp eq i32 %4, -3
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}
unsigned int get_phymm_size() { return 128 * 1024 * 1024; }


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

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

LLVM IR (-O0):
define i32 @get_phymm_size() {
ret i32 134217728
}

LLVM IR (-O2):
define i32 @get_phymm_size() {
ret i32 134217728
}
void postvisit(int V) {}


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

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

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

LLVM IR (-O2):
define void @postvisit(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int test_ais_17(void) {
  fprintf(stderr, "test_ais_17() failed: Not Written\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_ais_17>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ais_17>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"test_ais_17() failed: Not Written\0A\00"
define i32 @test_ais_17() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"test_ais_17() failed: Not Written\0A\00"
define i32 @test_ais_17() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
float Sleef_ldexpf(float x, int k) { return __builtin_ldexpf(x, k); }


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

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

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

LLVM IR (-O2):
define float @Sleef_ldexpf(float %0, i32 %1) {
%3 = tail call float @ldexpf(float %0, i32 %1)
ret float %3
}
/* Variables and functions */
double avgScore(float *);
int /*<<< orphan*/ printScores(float *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ readScores(float *);
int main() {
  float scores[8] = {0.0};
  readScores(scores);
  printScores(scores);
  printf("\n\nAverage Score = %2.2f\n", avgScore(scores));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
call   1070 <readScores@plt>
lea    -0x30(%rbp),%rdi
call   1050 <printScores@plt>
lea    -0x30(%rbp),%rdi
call   1060 <avgScore@plt>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <readScores@plt>
mov    %rbx,%rdi
call   1040 <printScores@plt>
mov    %rbx,%rdi
call   1050 <avgScore@plt>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A\0AAverage Score = %2.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x float]
store i32 0, i32* %1
%3 = bitcast [8 x float]* %2 to i8*
%4 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 0
%5 = call i32 @readScores(float* %4)
%6 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 0
%7 = call i32 @printScores(float* %6)
%8 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 0
%9 = call double @avgScore(float* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A\0AAverage Score = %2.2f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call i32 @readScores(float* %3)
%5 = call i32 @printScores(float* %3)
%6 = call double @avgScore(float* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}
int ctrl_ResetWrapper(void *hSpiGci, int status) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ctrl_ResetWrapper(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ afficheRectangle(int, int, char);
int main() {
  afficheRectangle(3, 4, '#');
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
mov    $0x23,%edx
call   1030 <afficheRectangle@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @afficheRectangle(i32 3, i32 4, i8 signext 35)
ret i32 0
}
void ui_error_string(const char *text) {}


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

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

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

LLVM IR (-O2):
define void @ui_error_string(i8* nocapture %0) {
ret void
}
void update_reject(design, iteration, which1, which2,
                   current_eval) struct Design *design;
int iteration, which1, which2;
double current_eval;
{
  void revert(), write_step();
  revert(design, which1, which2);
}


x86 assembly (clang, -O0):
<update_reject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <revert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_reject>:
mov    %edx,%esi
mov    %ecx,%edx
xor    %eax,%eax
jmp    1030 <revert@plt>

LLVM IR (-O0):
%struct.Design = type opaque
define void @update_reject(%struct.Design* %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = alloca %struct.Design*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store %struct.Design* %0, %struct.Design** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load %struct.Design*, %struct.Design** %6
%12 = load i32, i32* %8
%13 = load i32, i32* %9
ret void
}

LLVM IR (-O2):
%struct.Design = type opaque
define void @update_reject(%struct.Design* %0, i32 %1, i32 %2, i32 %3, double %4) {
tail call void (%struct.Design*, i32, i32, ...) bitcast (void (...)* @revert to void (%struct.Design*, i32, i32, ...)*)(%struct.Design* %0, i32 %2, i32 %3)
ret void
}
void strcat1(char *s, char *t) {
  while (*++s)
    ;
  while (*s++ = *t++)
    ;
}


x86 assembly (clang, -O0):
<strcat1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,0x1(%rax)
je     112a <strcat1+0x2a>
jmp    110c <strcat1+0xc>
jmp    112f <strcat1+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115e <strcat1+0x5e>
jmp    112f <strcat1+0x2f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat1>:
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strcat1+0x10>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1120 <strcat1+0x20>
ret

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

LLVM IR (-O2):
define void @strcat1(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %5, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ one;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_IPV6;
int /*<<< orphan*/ IPV6_V6ONLY;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int set_ipv6_only(int fd) {
  int one = 1;
  return setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one));
}


x86 assembly (clang, -O0):
<set_ipv6_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ipv6_only>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_IPV6 = global i32 0
@IPV6_V6ONLY = global i32 0
define i32 @set_ipv6_only(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_IPV6
%6 = load i32, i32* @IPV6_V6ONLY
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@IPPROTO_IPV6 = global i32 0
@IPV6_V6ONLY = global i32 0
define i32 @set_ipv6_only(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_IPV6
%5 = load i32, i32* @IPV6_V6ONLY
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
int ddsGetHeight(unsigned const char *buffer) {
  return (buffer[12] & 0xFF) | (buffer[13] & 0xFF) << 8 |
         (buffer[14] & 0xFF) << 16 | (buffer[15] & 0xFF) << 24;
}


x86 assembly (clang, -O0):
<ddsGetHeight>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0xc(%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0xd(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0xe(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0xf(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddsGetHeight>:
mov    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ddsGetHeight(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 12
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 13
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 14
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = and i32 %18, 255
%20 = shl i32 %19, 16
%21 = or i32 %14, %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 15
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = and i32 %25, 255
%27 = shl i32 %26, 24
%28 = or i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @ddsGetHeight(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 13
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 14
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 15
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw i32 %17, 24
%19 = or i32 %14, %18
ret i32 %19
}
void XcmsRGBToRGBi() {}


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

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

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

LLVM IR (-O2):
define void @XcmsRGBToRGBi() {
ret void
}
int lt(double a, double b) { return a < b; }


x86 assembly (clang, -O0):
<lt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @lt(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lt(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int f() {
  int i = 1;
  int j = 0;
  i = i + 1;
  int i1 = i;
  i = i1 + 1;
  int i2 = i;
  j = (i1 - 1) + i2;
  i = i + 1;
  return j;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %1
store i32 0, i32* %2
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = load i32, i32* %1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = load i32, i32* %1
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
store i32 %14, i32* %2
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @f() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ funcao1(int *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int valor;
  scanf("%d", &valor);
  funcao1(&valor);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    -0x4(%rbp),%rdi
call   1030 <funcao1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <funcao1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = call i32 @funcao1(i32* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @funcao1(i32* %1)
ret i32 0
}
/* Variables and functions */
char getchar();
clear(void) {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1130 <clear+0x20>
jmp    1118 <clear+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clear+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clear() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @clear() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
int client_error(const char *msg) {
  perror(msg);
  return -1;
}


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

x86 assembly (clang, -O2):
<client_error>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @client_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret i32 -1
}
void glmTransposeMatrix2d(double m[4]) {
  double temp;
  temp = m[1];
  m[1] = m[2];
  m[2] = temp;
}


x86 assembly (clang, -O0):
<glmTransposeMatrix2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmTransposeMatrix2d>:
movups 0x8(%rdi),%xmm0
shufps $0x4e,%xmm0,%xmm0
movups %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmTransposeMatrix2d(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 1
%6 = load double, double* %5
store double %6, double* %3
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 2
%9 = load double, double* %8
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 1
store double %9, double* %11
%12 = load double, double* %3
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 2
store double %12, double* %14
ret void
}

LLVM IR (-O2):
define void @glmTransposeMatrix2d(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = bitcast double* %2 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = shufflevector <2 x double> %4, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%6 = bitcast double* %2 to <2 x double>*
store <2 x double> %5, <2 x double>* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Py_InitializeEx(int /*<<< orphan*/);
void _cffi_py_initialize(void) { Py_InitializeEx(0); }


x86 assembly (clang, -O0):
<_cffi_py_initialize>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <Py_InitializeEx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cffi_py_initialize>:
xor    %edi,%edi
jmp    1030 <Py_InitializeEx@plt>

LLVM IR (-O0):
define void @_cffi_py_initialize() {
%1 = call i32 @Py_InitializeEx(i32 0)
ret void
}

LLVM IR (-O2):
define void @_cffi_py_initialize() {
%1 = tail call i32 @Py_InitializeEx(i32 0)
ret void
}
void g_error_copy() {}


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

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

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

LLVM IR (-O2):
define void @g_error_copy() {
ret void
}